Generating Audit Log Tables Based on Target Table Schema
For all target types for which Data Replication supports Merge Apply mode, including Greenplum, Netezza, Oracle, Teradata
, and Vertica
, you can generate audit log tables based on the schema of existing target tables. Also, InitialSync uses audit log tables to process SQL expressions that are defined for source tables in configurations that use SQL Apply mode and have Microsoft SQL Server or MemSQL targets, in certain load scenarios.
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
, select the
Target
option.
In the
Schema/owner
field, enter the schema or owner name of the target tables that you want to use to generate the audit log tables.
Tables that match the selected schema or owner name are listed in the
Tables
box.
At any time, you can click
Refresh
to refresh the schemas for the source and target databases.
To filter the list of tables, in the
Table filter
field, enter the first few letters of the target table names that you want to use for generating the audit log tables. For case-sensitive filtering, enclose the filter value in double quotation marks (").
Only the tables that match the filter criteria display in the
Tables
box.
Select the tables to use for generating the target audit log 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
Schema
field, enter a schema or owner name.
In the
Database type
list, select the target database type.
To generate audit log tables, 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 SQL Apply and Merge Apply, specify 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 specify any alphanumeric string as the suffix. However, 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 enter the suffix that is specified for the
Log table suffix for merge apply
field on the
Runtime Settings
tab >
Calculated Columns
view.
The default suffix is _LOG.
To create the audit log tables, perform one of the following actions:
To generate a script with SQL CREATE TABLE statements, click
Save
. In the
Save
dialog box, save the generated script to a directory of your choice. You can run the script later, if necessary.
To create the audit log tables on the target immediately, click
Run
.
If you cancel the Run operation while it is in process, Data Replication does not cancel any tables that were already created on the target. You can find the SQL CREATE TABLE statements for these tables in the %DBSYNC_HOME%/logs/ui/se.log file.