All Products
Search
Document Center

Data Management:Test data generation

Last Updated:Jun 20, 2026

The Test Data Generation feature in DMS uses a robust algorithm engine to generate various types of test data in batches, such as random values, region names, and virtual IP addresses. This feature significantly reduces test data preparation effort. This topic describes how to use DMS to generate test data.

Prerequisites

The following database types are supported:

  • MySQL: ApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB MyBase for MySQL, PolarDB-X, AnalyticDB for MySQL, and MySQL databases from other sources

  • SQL Server: ApsaraDB RDS for SQL Server, ApsaraDB MyBase for SQL Server, and SQL Server databases from other sources

  • PostgreSQL: ApsaraDB RDS for PostgreSQL, PolarDB for PostgreSQL, ApsaraDB MyBase for PostgreSQL, AnalyticDB for PostgreSQL, and PostgreSQL databases from other sources

  • MariaDB: ApsaraDB RDS for MariaDB and MariaDB databases from other sources

  • ApsaraDB for OceanBase in MySQL mode

  • PolarDB for PostgreSQL (Compatible with Oracle)

Background

Preparing data for functional or performance testing can be a challenge. Common methods include:

  • Manual entry: Inefficient and not suitable for large datasets.

  • Custom scripts: Costly to maintain, not universally applicable, and often produce data with poor randomness.

  • Production data clones: Insecure and can lead to data privacy risks.

Development often requires a frequent, secure, and efficient way to prepare data with controllable characteristics. The Test Data Generation feature in DMS is designed to meet these needs.

Usage notes

  • You can generate test data for only one table at a time. To generate test data for multiple tables, you must repeat the process for each table.

  • A single task can generate a maximum of 1 million rows of data.

  • The following performance benchmarks are for reference only. DMS throttles traffic to prevent database overload from the rapid generation of large data volumes.

    • Generating 1 million rows for a table with 4 columns takes approximately 60 seconds.

    • Generating 1 million rows for a table with 40 columns takes approximately 120 to 180 seconds.

Procedure

  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, in the SQL Console of the target database, you can right-click the target table and choose Data Plans > Test Data Generation.

  4. On the Test Data Generation ticket application page, complete the fields as described in the following table, and then click Submit.

    Parameter

    Description

    Task name

    A good name helps with future searches and clarifies the task's intent for approvers.

    Database name

    Select the database where you want to generate data. You must have the required permissions for the database.

    Table name

    The table to populate with data. An autocomplete list appears as you type the table name.

    Configure algorithm

    This option appears after you select a Table name. You can configure the generation method for each column. For more information, see Algorithm configuration.

    Number of rows

    The number of data rows to generate.

    Conflict handling

    Select a conflict handling mode. Valid values:

    • Skip when encountering data conflicts: If a data conflict occurs on a primary key or unique key, the conflicting record is skipped and the process continues with the other data.

    • Replace when encountering data conflicts: If a data conflict occurs on a primary key or unique key, the existing row is replaced and the process continues with the other data.

    Change stakeholder

    Add any necessary stakeholders. Users who are not listed as participants, approvers, or stakeholders cannot view the ticket details.

  5. After you submit the ticket, it enters the approval process. Once approved, the system automatically generates the data and inserts it into the target database.

    Note

    By default, the Database Administrator (DBA) of the corresponding database approves Test Data Generation tickets. For more information, see Test Data Generation.

Algorithm configuration

Test data generation algorithms support three methods: random, custom, and enumeration.

  • random

    • For numeric types, two generation methods are available: self-increasing sequence (by specifying a starting value and step) and interval number (generates a random value within a specified range). For integer types using the interval number method, you can set a minimum and maximum value to generate a random integer within that range (for example, from 1 to 100).

    • For text types, two generation methods are available: variable length string (generates a random value within a specified length and character range) and non-repeating string (generates random unique strings).

    • For date and time types, you can generate random values within a specified date or time range.

  • custom

    This method is currently supported only for text types. It provides standard data types for personal information, geolocation, and various industry-specific data.

    Categories also include Basic type and IT-related. Each category has specific subtypes. For example, under personal information, you can select options such as Chinese names, colors, industries, companies, departments, job titles, and universities. After making your selection, click Confirm Algorithm Configuration to save the settings.

  • enumeration

    You can provide a list of values, and DMS will randomly select from this list to populate the data.

    Note

    The enumeration method supports numeric, text, and date/time data types.

    In the value list dialog box, click Add Enumeration Value to add the required values. To delete an existing value, click Remove in the corresponding row. When you are finished, click Confirm Algorithm Configuration.

Related operations

After the test data is generated, you can perform the following operations: