Data Management (DMS) provides the test data generation feature that allows you to batch generate various test data at a time, including random values, region names, and virtual IP addresses. This feature helps simplify test data generation.
Preparations
A table is created in the database. For more information, see the "Create a table" section in the Manage a database on the SQLConsole tab topic.
In this example, a database named poc_dev
and a table named big_table
are created.
Procedure
This example shows how to generate 1 million rows of test data for the big_table
table.
Log on to the DMS console V5.0.
In the top navigation bar, choose .
NoteIf you use the DMS console in simple mode, move the pointer over the icon in the upper-left corner of the DMS console and choose
.Click Test Data Generation in the upper-right corner of the page. In the Application step on the Test Data Generation Tickets page, set the parameters for submitting a test data generation ticket.
Select one of the following options for the Conflict Handling parameter:
Skip when encountering data conflicts: If a data conflict occurs while writing data of the primary key or a unique key, DMS skips the conflicting data records and continues to write other data records.
Replace when encountering data conflict: If a data conflict occurs while writing data of the primary key or a unique key, DMS updates the original data records and continues to write other data records.
After the parameters are configured, click Submit.
After the ticket is approved, DMS automatically generates and executes SQL statements. You can view the execution progress on the Ticket Details page.
After the test data is generated, go to the SQL Console tab and query the generated test data in the
poc_dev
database.Move the pointer over the database name in the Basic Information section of the page.
Click Query in the menu and you are automatically redirected to the page of SQL Console.
Enter the following SQL statement to query the number of rows in the big_table table, and click Execute.
SELECT COUNT(*) FROM `big_table`;
For more information, see Generate test data.