Generating Target Tables and Audit Log Tables Based on Source Table Schema
Generating Target Tables and Audit Log Tables Based on Source Table Schema
You can generate target tables and audit log tables based on source table schema.
Before you begin, open the configuration and connect to the source and target databases.
Click
Schema
Generate Schema for the Target
on the menu bar, or click the
Generate Schema for the Target
icon button on the Replication Configurations toolbar.
The
Generating Schema for the Target
dialog box appears.
Under
Source/Target
, verify that the
Source
option is selected.
In the
Schema/owner
field, select the schema or owner name for the source tables that you want to use to generate the target tables.
The tables that match the selected schema or owner name are listed under
Tables
.
The following image shows an example list of tables that match a schema or owner name of SCOTT:
To filter the list of tables, in the
Filter
field, enter the first few letters of the source table names that you want to use for generating target tables. For case-sensitive filtering, enclose the filter value in double quotation marks.
Only the tables that match the filter criteria are listed under
Tables
.
At any time, you can click
Refresh
to refresh the schemas for the source and target databases.
Select the tables to use for generating the target tables:
To select all listed tables, click
Select All
.
To select tables individually, select the
Convert
check box in the table row.
Under
Target
, in the
Database type
list, select the target database type.
In the
Schema
field, select a schema name for the target tables if the target database type is the one to which you are already connected and that is specified in the configuration. If you selected a different target database type in the
Database type
list, enter the correct schema name for the target tables manually.
For Microsoft SQL Server targets, in the
Owner
field, select an owner for the target tables if you are already connected to the SQL Server target database. If you are connected to another type of target database but want to generate target tables for a SQL Server target, enter the owner name to use for the SQL Server target tables manually.
If you use Audit Apply or Merge Apply mode and need to generate audit log tables on the target, select the
Generate audit log tables
check box. In the adjacent
Audit tables suffix
field, enter a suffix for the generated audit log table names.
For Merge Apply, enter the suffix that is specified for the
Log table suffix for merge apply
field on the
Runtime Settings
tab >
Calculated Columns
view.
For Audit Apply, you can enter any alphanumeric string as the suffix for the audit log table names. However, if you want to use the
Map All
or
Wildcard map
button to quickly map all of the audit log tables to the corresponding source tables, you must specify the suffix that is specified in the
Log table suffix for merge apply
field on the
Runtime Settings
tab >
Calculated Columns
view.
The default suffix is _LOG.
For Merge Apply mode, if you create a target table manually outside of the Data Replication Console, you must generate the audit log table based on the target table schema.
To create the target tables, perform one of the following actions:
To generate a script with SQL CREATE TABLE statements, click
Save
. Then in the
Save
dialog box, save the generated script to a directory of your choice. You can run the script on the target system later to create the target tables.
To create the tables on the target immediately, click
Run
. You can perform this action only for the target type to which you are already connected.
If you cancel the Run operation while it is in progress, any tables that were already created on the target remain on the target. You can find the SQL CREATE TABLE statements for these tables in the %DBSYNC_HOME%/logs/ui/se.log file.