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
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

{
  "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" ],
     }
  ],
  "includTablesRowThreshold": 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?