13 Managing the DDL Replication Environment
For instructions on configuring Oracle GoldenGate DDL support, see Configuring DDL Support.
Note:
This chapter is only relevant for classic capture mode or integrated capture mode in which trigger-based DDL capture is being used.
Topics:
- Disabling DDL Processing Temporarily
You must disable DDL activities before performing an instantiation or other tasks, if directed. - Enabling and Disabling the DDL Trigger
You can enable and disable the trigger that captures DDL operations without making any configuration changes within Oracle GoldenGate. - Maintaining the DDL Marker Table
You can purge rows from the marker table at any time. It does not keep DDL history. - Deleting the DDL Marker Table
Do not delete the DDL marker table unless you want to discontinue synchronizing DDL. - Maintaining the DDL History Table
You can purge the DDL history table to control its size, but do so carefully. - Deleting the DDL History Table
The history table and the DDL trigger are interdependent. An attempt to drop the history table fails if the DDL trigger is enabled. This is a safety measure to prevent the trigger from becoming invalid and missing DDL operations. - Purging the DDL Trace File
To prevent the DDL trace file from consuming excessive disk space, run theddl_cleartrace
script on a regular basis. - Applying Database Patches and Upgrades when DDL Support is Enabled
Database patches and upgrades usually invalidate the Oracle GoldenGate DDL trigger and other Oracle GoldenGate DDL objects. - Apply Oracle GoldenGate Patches and Upgrades when DDL support is Enabled
Use the following steps to apply a patch or upgrade to the DDL objects. - Restoring an Existing DDL Environment to a Clean State
Follow these steps to completely remove, and then reinstall, the Oracle GoldenGate DDL objects. - Removing the DDL Objects from the System
This procedure removes the DDL environment and removes the history that maintains continuity between source and target DDL operations.
Disabling DDL Processing Temporarily
You must disable DDL activities before performing an instantiation or other tasks, if directed.
You can resume DDL processing after the task is finished.
- Disable user DDL operations on the source database.
- If there are previous DDL replication processes that are still active, make certain that the last executed DDL operation was applied to the target before stopping those processes, so that the load data is applied to objects that have the correct metadata.
- Comment out the
DDL
parameter in the Extract and Replicat parameter files that you configured for the new Oracle GoldenGate environment. Comment out any other parameters that support DDL. - Disable the Oracle GoldenGate DDL trigger, if one is in use. See Enabling and Disabling the DDL Trigger.
Parent topic: Managing the DDL Replication Environment
Enabling and Disabling the DDL Trigger
You can enable and disable the trigger that captures DDL operations without making any configuration changes within Oracle GoldenGate.
The following scripts control the DDL trigger.
-
ddl_disable
: Disables the trigger. No further DDL operations are captured or replicated after you disable the trigger. -
ddl_enable
: Enables the trigger. When you enable the trigger, Oracle GoldenGate starts capturing current DDL changes, but does not capture DDL that was generated while the trigger was disabled.
Before running these scripts, disable all sessions that ever issued DDL, including those of the Oracle GoldenGate processes, SQL*Plus, business applications, and any other software that uses Oracle. Otherwise the database might generate an ORA-04021 error. Do not use these scripts if you intend to maintain consistent DDL on the source and target systems.
Parent topic: Managing the DDL Replication Environment
Maintaining the DDL Marker Table
You can purge rows from the marker table at any time. It does not keep DDL history.
To purge the marker table, use the Manager parameter
PURGEMARKERHISTORY
. Manager gets the name of the marker table
from one of the following:
-
The name given with the
MARKERTABLE
parameter in theGLOBALS
file, if specified. -
The default name of
GGS_MARKER
.
PURGEMARKERHISTORY
provides options to specify maximum and minimum
lengths of time to keep a row, based on the last modification date.
Parent topic: Managing the DDL Replication Environment
Deleting the DDL Marker Table
Do not delete the DDL marker table unless you want to discontinue synchronizing DDL.
The marker table and the DDL trigger are interdependent. An attempt to drop the marker table fails if the DDL trigger is enabled. This is a safety measure to prevent the trigger from becoming invalid and missing DDL operations. If you remove the marker table, the following error is generated:
ORA-04098: trigger 'SYS.GGS_DDL_TRIGGER_BEFORE' is invalid and failed re-validation
The proper way to remove an Oracle GoldenGate DDL object depends on your plans for the rest of the DDL environment. To choose the correct procedure, see one of the following:
Parent topic: Managing the DDL Replication Environment
Maintaining the DDL History Table
You can purge the DDL history table to control its size, but do so carefully.
The DDL history table maintains the integrity of the DDL synchronization environment. Purges to this table cannot be recovered through the Oracle GoldenGate interface.
-
To prevent any possibility of DDL history loss, make regular full backups of the history table.
-
To ensure that purged DDL can be recovered, enable Oracle Flashback for the history table. Set the flashback retention time well past the point where it could be needed. For example, if your full backups are at most one week old, retain two weeks of flashback. Oracle GoldenGate can be positioned backward into the flashback for reprocessing.
-
If possible, purge the DDL history table manually to ensure that essential rows are not purged accidentally. If you require an automated purging mechanism, use the
PURGEDDLHISTORY
parameter in the Manager parameter file. You can specify maximum and minimum lengths of time to keep a row.
Note:
Temporary tables created by Oracle GoldenGate to increase performance might be purged at the same time as the DDL history table, according to the same rules. The names of these tables are derived from the name of the history table, and their purging is reported in the Manager report file. This is normal behavior.
Parent topic: Managing the DDL Replication Environment
Deleting the DDL History Table
The history table and the DDL trigger are interdependent. An attempt to drop the history table fails if the DDL trigger is enabled. This is a safety measure to prevent the trigger from becoming invalid and missing DDL operations.
Do not delete the DDL history table unless you want to discontinue synchronizing DDL. The history table contains a record of DDL operations that were issued. Once an Extract switches from using the DDL trigger to not using the trigger, as when source database redo compatibility is advanced to 11.2.0.4 or greater, these objects can be deleted though not immediately. It is imperative that all mining of the redo generated before the compatibility change be complete and that this redo not need to be mined again.
If you remove the history table, the following error is generated:
ORA-04098: trigger 'SYS.GGS_DDL_TRIGGER_BEFORE' is invalid and failed re-validation
The proper way to remove an Oracle GoldenGate DDL object depends on your plans for the rest of the DDL environment. To choose the correct procedure, see one of the following:
Parent topic: Managing the DDL Replication Environment
Purging the DDL Trace File
To prevent the DDL trace file from consuming excessive disk space, run the
ddl_cleartrace
script on a regular basis.
This script deletes the trace file, but Oracle GoldenGate will create it again.
The default name of the DDL trace file is ggs_ddl_trace.log
. It is
in the USER_DUMP_DEST
directory of Oracle. The
ddl_cleartrace
script is in the Oracle GoldenGate directory.
Parent topic: Managing the DDL Replication Environment
Applying Database Patches and Upgrades when DDL Support is Enabled
Database patches and upgrades usually invalidate the Oracle GoldenGate DDL trigger and other Oracle GoldenGate DDL objects.
Before applying a database patch, do the following.
- Log in to SQL*Plus as a user that has
SYSDBA
privileges. - Disable the Oracle GoldenGate DDL trigger by running the
ddl_disable
script in SQL*Plus. - Apply the patch.
- Enable the DDL trigger by running the
ddl_enable
script in SQL*Plus.
Note:
Database upgrades and patches generally operate on Oracle objects. Because Oracle GoldenGate filters out those objects automatically, DDL from those procedures is not replicated when replication starts again.
To avoid recompile errors after the patch or upgrade, which are caused if the trigger is not disabled before the procedure, consider adding calls to @ddl_disable
and @ddl_enable
at the appropriate locations within your scripts.
Parent topic: Managing the DDL Replication Environment
Apply Oracle GoldenGate Patches and Upgrades when DDL support is Enabled
Use the following steps to apply a patch or upgrade to the DDL objects.
This section explains how to apply Oracle GoldenGate patches and upgrades when DDL support is enabled.
Note:
If the release notes or upgrade documentation for your Oracle GoldenGate release contain instructions similar to those provided in this section, follow those instructions instead the ones in this section. Do not use this procedure for an upgrade from an Oracle GoldenGate version that does not support DDL statements that are larger than 30K (pre-version 10.4). To upgrade in that case, follow the instructions in Restoring an Existing DDL Environment to a Clean State.
This procedure may or may not preserve the current DDL synchronization configuration, depending on whether the new build requires a clean installation.
Parent topic: Managing the DDL Replication Environment
Restoring an Existing DDL Environment to a Clean State
Follow these steps to completely remove, and then reinstall, the Oracle GoldenGate DDL objects.
This procedure creates a new DDL environment and removes any current DDL history.
Note:
Due to object interdependencies, all objects must be removed and reinstalled in this procedure.
Parent topic: Managing the DDL Replication Environment
Removing the DDL Objects from the System
This procedure removes the DDL environment and removes the history that maintains continuity between source and target DDL operations.
Note:
Due to object interdependencies, all objects must be removed.
Parent topic: Managing the DDL Replication Environment