Generating Data for Empty Database

This topic describes how to populate an empty database with meaningful test data using Data Generator. Let’s take the Scott database for demonstration purposes.

To generate test data, do the following:

  1. On the Standard toolbar or on the Start page, click New Data Generation.
  2. In the Data Generator Project Properties > Connection section, specify the connection, select the Scott schema, and then click Next.
  3. In the Data Generator Project Properties > Options section, set the required options and click Open.

In the window that opens you can:

  • select columns to be populated (in the Tables and columns to populate pane)
  • select a generator you want to use for each separate column (in the Generation settings pane)
  • customize generation parameters for each generator (in the Generation settings pane)

In addition, Data Generator provides the Preview window that shows a table with the actual generated data.

Selecting generators for individual columns

For a column you select, Data Generator automatically assigns a generator based on the column and table characteristics: name, data type, etc. You may select a different generator for the column and customize the parameters of this generator in the settings pane.

For this test case, we will generate data for columns EMPNO, ENAME, JOB, HIREDATE, SAL, and COMM in the EMP table.

NUMBER generator

When you select the EMPNO column, the NUMBER generator is automatically assigned to this column. The NUMBER generator generates random numeric values for the column. In addition to basic settings, you can specify the Min and Max values for the numbers to be generated.

NUMBER Generator

Last Name generator

When you select the ENAME column, the Last Name generator is automatically assigned to this column. The generator provides realistic last names. In addition to basic settings, you can specify a file to load last names from, as well as trim left and/or right trailing spacings.

Last Name Generator

Job Title generator

When you select the JOB column, the Job Title generator is automatically assigned to this column. The generator provide a wide range of job titles.

In the text box, you can specify a predefined regexp template to customize generated job titles using regexp expressions. The template may be also modified with snippets, counters, files, and columns, and generators .

Job Title Generator

Employment Term generator

When you select the HIREDATE column, the Employment Term generator is automatically assigned to this column. The data grid in the settings pane allows you to select weight ratios of long-term and short-term employees. The percentages of the employees will be automatically recalculated based on the selected weight ratios.

Employment Term Generator

US Annual Salary generator

Select the SAL column, and the US Annual Salary generator will be automatically selected for this column. The generator will populate the column with random salary-like numbers. You can specify a minimum and maximum values for the generated salary amounts.

US Annual Salary generator

While selecting tables and customizing generators, the Preview window displays the actual data to be generated in real-time.

After that, to generate test data, click Data generation icon Populate data to the target schema and follow the steps in Setting up Data Generation.