Making Local-Only Changes in an Active-Active Oracle GoldenGate Configuration
Oracle GoldenGate has always allowed customers to control replication at several levels, including objects, rows, columns, and DDL. However, in active-active or active-passive replication architectures, there are cases where you want to make local-only changes without replicating them to other active GoldenGate replicas within the configured replication set. Examples include:
- Large batch jobs, PDML, or ETL operations can optionally be run as local-only changes on all GoldenGate replicas independently for high performance and efficiency. This may be a useful optimization when these operations make massive changes that can incur significant replication lag.
- Specific local-only updates and logical local-only changes should never be replicated to other replicas to avoid duplication and logical conflicts.
This section describes how to configure local-only changes. This procedure prevents the selected transaction from replicating from the source database to its peer. It does not stop other traffic, prevent a concurrent transaction from the peer from arriving, or make the two databases consistent by itself.
Prerequisites
Before you begin, ensure that:
- The environment uses an Oracle GoldenGate active-active or active-passive architecture with bidirectional replication configured.
- Oracle GoldenGate loop prevention is configured with DBOPTIONS SETTAG and the local Extract’s TRANLOGOPTIONS EXCLUDETAG. This configuration stops a transaction applied by Replicat from being captured again and sent back to its origin.
- Use an Oracle GoldenGate Microservices Architecture release certified for the Oracle Database versions in the replication configuration. Oracle GoldenGate 26ai Microservices Architecture with the recommended GGHub is preferred where supported. This procedure uses AdminClient commands; verify their availability and syntax for the installed GoldenGate release.
- The administrator performing the local-only change has a GoldenGate user account with the Operator role and authorized to execute SET_TAG and DBMS_XSTREAM_ADM.GET_TAG.
- Optionally enable Conflict Detection and Resolution (CDR) to detect unexpected conflicts. CDR is configured consistently on both Replicats. CDR is not a substitute for the local-only tag because the local-only change is intentionally not delivered, so the peer Replicat cannot resolve a conflict for this transaction.
Plan the local-only change
- Identify the scope of the local-only change.
- Use a dedicated database session and set the session’s redo tag to a value excluded by the originating database’s Extract. If a connection pool is used, the application must guarantee that the tag and all local-only change statements use the same physical session and that the session is not returned to the pool while the tag is still set.
- When the local-only change is complete, clear the session redo tag and verify that the change was not written to the outbound trail.
In the example below, Database A and Database B are both actively receiving changes from the application. Each database has a primary Extract that captures local application changes, a Distribution Service path that transports the local trail, and a Replicat that applies changes arriving from the peer. When using GGHub, a Distribution Service is not required when the active Extract and active Replicat are on the same GGHub.
For any local-only change made on a database, the relevant filter is the Extract capturing changes from that database. The following table describes the component and action flow that affects local-only changes.
Note: The Distribution Service is downstream of the Extract, so stopping the Distribution Path is not the isolation mechanism. An untagged local-only change can remain in the source trail and be sent after the path is restarted.
| GoldenGate component | Function or action | Role in local-only changes |
|---|---|---|
| DBMS_XSTREAM_ADM.SET_TAG | Sets a redo tag for subsequent DML and DDL generated by the current database session. | Marks the local-only change transaction before any local-only change DML runs. |
| Local Extract | Reads the local database redo stream. | Uses TRANLOGOPTIONS EXCLUDETAG to discard the tagged local-only change before it enters the outbound trail. |
| Distribution Service path (optional) | Moves the source trail to the peer deployment. | Does not see a local-only change that the local Extract excluded. |
| Peer Replicat | Applies changes that arrive from the peer. | Does not receive the local-only changes. |
Understand tag values
A tag is a hexadecimal byte string. The value passed to DBMS_XSTREAM_ADM.SET_TAG must represent the same bytes as the hexadecimal value in the local Extract’s EXCLUDETAG configuration.
The following is an illustrative two-database layout. The names TAG_A and TAG_B describe the database where the tag is filtered; they are labels for explanation, not literal parameter values.
| Database | Inbound Replicat parameter file | Local outbound Extract parameter file | To suppress a local-only change made locally |
|---|---|---|---|
| Database A | DBOPTIONS SETTAG 0A01 on Replicat A, which applies B→A changes. | TRANLOGOPTIONS EXCLUDETAG 0A01 on Extract A, which captures A→B changes. | Set the dedicated session tag to DBMS_XSTREAM_ADM.SET_TAG(tag => ‘0A01’). |
| Database B | DBOPTIONS SETTAG 0B01 on Replicat B, which applies A→B changes. | TRANLOGOPTIONS EXCLUDETAG 0B01 on Extract B, which captures B→A changes. | Set the dedicated session tag to DBMS_XSTREAM_ADM.SET_TAG(tag => ‘0B01’). |
Use the values that are actually configured in the environment. Do not infer the value from the process name, database name, or direction. If an Extract has several EXCLUDETAG lines, each line excludes one tag. If the Extract uses EXCLUDETAG +, any non-null tag is excluded; use a documented maintenance tag rather than an arbitrary value. Do not use EXCLUDETAG NULL as a shortcut: it has the opposite meaning and excludes untagged changes.
If the local-only change includes DDL, inspect both TRANLOGOPTIONS and DDLOPTIONS in the Extract parameter file. In Oracle database, tag filtering specified with TRANLOGOPTIONS applies to DML, while a separately specified DDLOPTIONS EXCLUDETAG controls DDL. The procedure below is intended primarily for data (DML) local-only changes; validate DDL filtering separately before using it.
Illustrative loop-prevention configuration
-- On Database A: Replicat A applies B→A changes
DBOPTIONS SETTAG 0A01
-- Extract A captures A→B changes
TRANLOGOPTIONS EXCLUDETAG 0A01
-- On Database B: Replicat B applies A→B changes
DBOPTIONS SETTAG 0B01
-- Extract B captures B→A changes
TRANLOGOPTIONS EXCLUDETAG 0B01
Do not change an existing loop-prevention value just to perform a local-only change unless the change has been reviewed as an operational configuration change.
Perform a local-only change
Perform the following steps on the specified database. The example performs a local-only change on Database A, with no replication to Database B.
1. Inspect the active-active path Connect to the deployment that manages Database A. View the parameter files for Extract A and Replicat A, then confirm that the processes and the A→B Distribution Path are operating normally.
ADMINCLIENT Inspect the active-active path from the source deployment
OGG (not connected) 1> CONNECT https://<source-admin-host>:<port> <source-deployment> AS <deployment-user>
OGG (https://<source-admin-host>:<port> <source-deployment>) 2> VIEW PARAMS <extract-a>
OGG (https://<source-admin-host>:<port> <source-deployment>) 3> VIEW PARAMS <replicat-a>
OGG (https://<source-admin-host>:<port> <source-deployment>) 4> INFO EXTRACT <extract-a>
OGG (https://<source-admin-host>:<port> <source-deployment>) 5> INFO DISTPATH <distpath-a-to-b> DETAIL
Confirm that:
-
contains TRANLOGOPTIONS EXCLUDETAG or contains TRANLOGOPTIONS EXCLUDETAG +. -
contains the expected DBOPTIONS SETTAG value for normal B→A loop prevention. - Extract A is running and the A→B Distribution Path is the path you intend to observe. A stopped path does not by itself prevent an untagged transaction from being delivered later.
2. Prepare the local-only change
- Record the database, PDB or service, schema, table, key values, old values, intended new values, operator, ticket, and planned start time.
- Prevent application activity that could update the same rows while the local-only change is being performed. If the peer can update the same rows, coordinate a row-level or application-level maintenance window on both databases.
- Do not stop only the Distribution Path and assume the local-only change is isolated. The local Extract must filter the transaction at capture time.
- If the local Extract does not exclude a safe tag, stop here and follow the procedure for no suitable local-only change tag.
3. Set the session tag and perform the local-only change Connect directly to Database A using the service or PDB that owns the targeted objects. Run the appropriate DBMS_XSTREAM_ADM.SET_TAG command before the first local-only change DML or DDL statement. The procedure affects only the current session and applies to subsequent redo entries generated by that session.
Note: If automatic CDR is enabled on any tables that you are going to change with DML, you can overwrite the value of the timestamp columns, typically CDRTS$ROW, through your SQL statement. You want this value to be identical to the record of the source on the other database. That way, if a conflict occurs on this row in the future, it will be handled properly by the conflict resolution rules.
-- Use the tag that Extract A excludes. This example uses 0A01.
SELECT RAWTOHEX(DBMS_XSTREAM_ADM.GET_TAG) AS TAG_BEFORE FROM DUAL;
EXEC DBMS_XSTREAM_ADM.SET_TAG(tag => '0A01');
SELECT RAWTOHEX(DBMS_XSTREAM_ADM.GET_TAG) AS TAG_ACTIVE FROM DUAL;
– Example only: replace with the approved, narrowly scoped local-only change.
UPDATE hr.customers
SET credit_status = 'REVIEWED',
cdrs$row = TIMESTAMP '2026-09-01 20:55:48'
WHERE customer_id = 12345;
COMMIT;
-- Clear session state before the session is reused.
EXEC DBMS_XSTREAM_ADM.SET_TAG(NULL);
SELECT RAWTOHEX(DBMS_XSTREAM_ADM.GET_TAG) AS TAG_AFTER FROM DUAL;
Session rule The tag is session state, not a transaction option. Keep the tagging call, local-only change statements, commit, and clearing call on the same physical database session. Run no unrelated DML while the tag is active. Because SET_TAG is not transactional, do not expect a rollback to undo the tag setting.
For a multi-statement local-only change, keep the tag active for the complete approved local-only change transaction or batch, and clear it immediately afterward. For a connection pool, closing the dedicated session is safer than returning it to the pool with an uncertain tag state.
4. Complete and verify the local-only change
- Confirm that the session tag is cleared or terminate the dedicated database session.
- Restore normal application access and remove temporary row or object quiescing controls.
- Attach the AdminClient output, SQL verification, tag value, affected keys, commit time, and operator record to the local-only change ticket.
- Leave the normal SETTAG/EXCLUDETAG loop-prevention configuration intact.
For auditability, record the database and service, physical session or maintenance tool, exact tag in hexadecimal, Extract and Distribution Path names, Replicat name, SQL or change-script checksum, affected keys, before and after values, commit timestamp, AdminClient verification output, and the direct peer query result.
AdminClient command reference
The commands used on this page are available in the Oracle GoldenGate 26ai AdminClient command reference:
| Command | Use in this procedure | 26ai reference |
|---|---|---|
| CONNECT | Connect to the Service Manager or Administration Service for a deployment. | CONNECT |
| VIEW PARAMS | Inspect the Extract and Replicat parameter files. | VIEW PARAMS |
| EDIT PARAMS | Add a specific local-only change tag when the existing Extract configuration has no suitable excluded value. | EDIT PARAMS |
| INFO EXTRACT | Check Extract status, lag, and checkpoints. | INFO EXTRACT |
| INFO DISTPATH | Check the Distribution Path status and detailed checkpoints. | INFO DISTPATH |
| STATS EXTRACT | Reset and inspect source Extract operation statistics during the verification window. | STATS EXTRACT |
| STATS REPLICAT | Inspect target-table and CDR statistics during the verification window. | STATS REPLICAT |
| STOP EXTRACT / START EXTRACT | Restart the local Extract after adding a new EXCLUDETAG line. | STOP EXTRACT and START EXTRACT |
Related references
- Excluding Replicat Transactions in Bidirectional Replication documents the Oracle DBOPTIONS SETTAG and Extract TRANLOGOPTIONS EXCLUDETAG loop-prevention method.
TRANLOGOPTIONSdocuments EXCLUDETAG, tag values, the + and NULL behaviors, and filtering of tags set in an Oracle session.DBOPTIONSdocuments the Replicat SETTAGEXCLUDETAGdocuments the Oracle GoldenGate tag-filtering parameter and its Oracle-only scope.DBMS_XSTREAM_ADMdocuments SET_TAG, GET_TAG, hexadecimal tag examples, session scope, and non-transactional behavior. Locate SET_TAG Procedure in the package reference.- Administer Microservices from the Command Line provides an overview of AdminClient.
Note: This Microservices Architecture procedure uses a Distribution Service and Distribution Path. It does not use a Classic Architecture Extract Pump. The local-only decision is made at the originating Oracle Extract by filtering the session-tagged redo.