Redgate Test Data Manager

Subsetting options file

The following can be used to control how a subset is made from a source database. All of these are optional.

NameDescriptionNotes
jsonSchemaVersionThe version of schema of the the options file.

Defaults to 1.

desiredSizeThe approximate size to make the target database, in the form x(B|KB|MB|GB|TB) (e.g. 5GB).

This cannot be used in conjunction with StartingTables.

This is an approximate size and the actual size of the target database may be different, especially for small databases.

startingTables

The tables at which to start from when creating a subset.

These are defined with:

NameDescriptionNotes
tableThe table to start from.
filterClauseAn optional SQL filter to be applied.If no filter clause is supplied, all of the data from the table will be included.

This cannot be used in conjunction with DesiredSize.

When there are multiple starting tables, the subsetter brings in all data that matches any of the filter clauses and all data that links to it.

staticDataTablesAny tables to be treated as static data tables.

Tables defined as static data tables will be included, but the subsetter will follow only outward relationships.

Any rows referenced by a foreign key on this table will be included. 

excludedTablesAny tables to ignore when subsetting.Tables that have foreign keys referencing an excluded table will also be excluded.
manualRelationships

Any relationships between tables that are not already defined in the database as foreign keys.

These are defined with:

NameDescription
sourceTableThe source table.
sourceColumnsOne or more columns.
targetTableThe target table.
targetColumnsOne or more columns.
Manual relationships are treated the same foreign keys defined in the database. The referential integrity of these relationships will be maintained when subsetting.
includeTablesRowThresholdThe maximum number of rows a table with no foreign keys can have to be included automatically as a static data table.The default value if not specified is 300.
useTemporaryTables

Use temporary tables as a working space rather than tables in the source database.

This applies to SQL Server only.


Example JSON options file

{
  "jsonSchemaVersion": 1,
  "startingTables": [
    {
      "table":
      {
        "schema": "dbo",
        "name": "Users"
      },
      "filterClause": "OrgId = 1"
    }
  ],
  "staticDataTables": [
    {
      "schema": "dbo",
      "name": "Countries"
    }
  ],
  "excludedTables": [
    {
      "schema": "dbo",
      "name": "Comments"
    }
  ],
  "manualRelationships": [
    {
      "sourceTable": 
        { 
          "schema": "dbo", 
          "name": "SourceTest"
        },
      "sourceColumns": [ "TargetId" ],
      "targetTable": 
        { 
          "schema": "dbo", 
          "name": "TargetTest" 
        },
      "targetColumns": [ "Id" ]
     }
  ],
  "includeTablesRowThreshold": 300
}

Subsetting options file formats

Both JSON and YAML file formats are supported as an ways to configure subsetting behavior.



Didn't find what you were looking for?