All Products
Search
Document Center

Data Management:Generate test data

Last Updated:Mar 28, 2026

Data Management (DMS) provides the Test Data Generation feature, powered by a built-in algorithm engine, to help you quickly populate database tables with various types of test data — such as random values, region names, and virtual IP addresses — without writing scripts or exposing production data.

Prerequisites

Before you begin, ensure that you have:

  • A database of one of the supported types listed below

  • Permissions to manage the database in DMS

Supported databases:

Database typeSupported instances
MySQLApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB MyBase for MySQL, PolarDB-X, AnalyticDB for MySQL, and third-party MySQL databases
SQL ServerApsaraDB RDS for SQL Server, ApsaraDB MyBase for SQL Server, and third-party SQL Server databases
PostgreSQLApsaraDB RDS for PostgreSQL, PolarDB for PostgreSQL, ApsaraDB MyBase for PostgreSQL, AnalyticDB for PostgreSQL, and third-party PostgreSQL databases
MariaDBApsaraDB RDS for MariaDB and third-party MariaDB databases
OceanBaseApsaraDB for OceanBase in MySQL mode
PolarDBPolarDB for PostgreSQL (Compatible with Oracle)

Usage notes

  • One table per task. To populate multiple tables, submit a separate task for each.

  • Up to 1,000,000 rows can be generated per task.

  • Throughput is throttled to prevent database overload:

    • 1,000,000 rows × 4 fields: approximately 60 seconds

    • 1,000,000 rows × 40 fields: approximately 120–180 seconds

Generate test data

  1. Log in to DMS 5.0.

  2. In the top navigation bar, choose Database Development > Environment Construction > Test Data Generation.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.pngicon in the upper-left corner of the console and choose All Features > Database Development > Environment Construction > Test Data Generation.

  3. On the Test Data Generation Tickets page, click Test Data Generation in the upper-right corner.

    Note

    Alternatively, open the SQL console for your database, right-click a table in the table list, and choose Data Plans > Test Data Generation.

  4. On the Ticket Application page, fill in the parameters in the Application step and click Submit.

    ParameterDescription
    Task nameA name that helps approvers understand the purpose of the task and helps you find it later.
    Database nameThe database within the instance. Enter a prefix to search, then select from the results.
    Table nameThe table to populate. Enter a prefix to search, then select from the results. Multiple tables are supported.
    Configure the algorithmThe data generation rule for each field. This parameter appears only after you select a table. See Algorithms for details.
    Number of rows generatedThe number of rows to generate. Maximum: 1,000,000.
    Conflict handlingHow DMS handles primary key or unique key conflicts during data writing: Skip when encountering data conflicts skips conflicting rows and continues writing the rest. Replace when encountering data conflict overwrites existing rows and continues writing the rest.
    Change stakeholderUsers who can view the ticket details. Only users involved in the ticket, including approvers, have access.
  5. Wait for a database administrator (DBA) to approve the ticket. After approval, DMS automatically generates the test data and writes it to the target table.

    Note

    By default, test data generation tickets are approved by DBAs. For more information, see Test data generation.

Algorithms

For each field in the target table, choose one of the following algorithms based on your data requirements.

AlgorithmUse when you need toSupported field types
RandomGenerate varied data within defined bounds, such as sequential IDs or values in a numeric rangeINTEGER, TEXT, DATETIME
CustomizeGenerate semantically meaningful data such as names, city names, or industry codesTEXT only
EnumerationRestrict values to a predefined setINTEGER, TEXT, DATETIME

Random

INTEGER fields — choose one of two build types:

  • Self-increasing sequence: generates a sequential series. Set the Starting value and Step.

  • Interval number: generates values within a range. Set the Minimum value and Maximum value.

TEXT fields — choose one of two build types:

  • Variable-length string: generates strings of varying length. Set the Minimum length, Maximum length, and Character range.

  • Do not repeat string: generates unique string values. Set the Options.

DATETIME fields — generates random date and time values within a specified time range.

Customize

Use the Customize algorithm when you need semantically meaningful TEXT data, such as personal information, geographic location information, and industry-related standard data.

Enumeration

Use the Enumeration algorithm when you want DMS to randomly select from a predefined list of values. Add the values to the list before submitting. Supported for INTEGER, TEXT, and DATETIME fields.

What's next

After the test data is written to the database: