Oracle
This section describes details for configuring Oracle GoldenGate for Oracle.
Prepare Database Users and Privileges
Learn about creating database users and assigning privileges for Oracle GoldenGate for Oracle.
Grant User Privileges for Oracle Database 21c and Lower
The user privileges that are required for connecting to Oracle database from Oracle GoldenGate depend on the type of user.
Privileges should be granted depending on the actions that the user needs to
perform as the GoldenGate Administrator User on the source and target databases. For
example, to grant DML operation privileges to insert, update, and delete transactions to a
user, use the GRANT ANY
INSERT
/UPDATE
/DELETE
privileges and to further
allow users to work with tables and indexes as part of DML operations, use the GRANT
CREATE
/DROP
/ALTER ANY
TABLE
/INDEX
privileges.
If the GoldenGate Administrator user has the DBA role, additional object privileges are not needed. However, there might be security constraints granting the DBA role to the GoldenGate Administration user. The DBA role is not necessarily required for Oracle GoldenGate.
If there are many objects being replicated, you might consider using the ANY privilege for DML and DDL operations. This simplifies the provision of privileges to the GoldenGate Administrator users, as you only need to grant a few privileges depending on the database operations.
The following table describes some of the essential privileges for GoldenGate
Administrator user for Oracle database. For explanation purposes, the table uses
c##ggadmin
as an example of a common user for a multitenant container
database and ggadmin
as the pluggable database (PDB) user.
PDBEAST
and PDBWEST
are used as examples of PDB
names.
Privilege | Extract | Replicat All Modes | Purpose |
---|---|---|---|
|
Yes |
Yes |
Required to create objects In Oracle Database 12cR1 and later, instead of
|
|
Yes |
Yes |
Common user See an example of Permissions granted to an Oracle mutitenant database common user. |
|
Yes |
Yes |
Required to connect to the database. |
|
Yes |
Yes |
Required to add the heartbeat table view. If you want to be specific to each object, you can also provide the privileges for each object individually. You may consider creating a specific database role to maintain such privileges. |
|
Yes |
Yes |
Perform administrative changes, such as enabling logging. |
|
Yes |
Yes |
Required for multitenant architecture and
|
|
Yes | Yes |
|
Grant |
Yes |
Yes |
Capture from Data Vault. See Privileges for Capturing from Oracle Data Vault. |
Grant Replicat privileges in
|
NA | Yes |
Capture from Data Vault. See Privileges for Capturing from Oracle Data Vault. |
|
NA |
Yes |
Apply replicated DML to target objects. See Details of Support for Objects and Operations in Oracle DML |
|
NA |
Yes |
Grant these privileges to the Replicat user, instead of granting
|
If DDL replication is performed, grant the following as Database Vault owner:
|
No | No |
Capture from Data Vault. See Privileges for Capturing from Oracle Data Vault. |
DDL privileges on target objects (if using DDL support) |
NA |
Yes |
Issue replicated DDL on target objects. See Details of Support for Objects and Operations in Oracle DDL. |
|
Yes | Yes | Grants privileges for DDL Replication for tables. |
|
Yes |
Yes |
Grants privileges for creating table in any schema. To allow creating tables
only in a specific schema, use the |
CREATE ANY VIEW |
Yes |
Yes | Grants privilges to create view in any database
schema. To allow creating views in a specific schema, use the CREATE
VIEW privilege.
|
|
Yes |
Yes |
Allow all privileges to work properly on dictionary tables. |
Example: Permissions granted for the Oracle database common user
c##ggadmin
in the following
example:CREATE USER c##ggadmin IDENTIFIED BY passw0rd CONTAINER=all DEFAULT
TABLESPACE GG_DATA TEMPORARY TABLESPACE temp;
GRANT RESOURCE to c##ggadmin;
GRANT CREATE SESSION to c##ggadmin;
GRANT CREATE VIEW to c##ggadmin;
GRANT CREATE TABLE to c##ggadmin;
GRANT CONNECT to c##ggadmin CONTAINER=all;
GRANT DV_GOLDENGATE_ADMIN; –-- for data vault user
GRANT DV_GOLDENGATE_REDO_ACCESS; –-- for data vault user
GRANT ALTER SYSTEM to c##ggadmin;
GRANT ALTER USER to c##ggadmin;
ALTER USER c##ggadmin SET CONTAINER_DATA=all CONTAINER=current;
ALTER USER c##ggadmin QUOTA unlimited ON GG_DATA;
GRANT SELECT ANY DICTIONARY to c##ggadmin;
GRANT SELECT ANY TRANSACTION to c##ggadmin;
EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('c##ggadmin');
In this example, DBA privilege is not provided. If privileges are missing, then the DBA has to grant necessary privileges additionally.
Privileges granted for PDB user ggadmin
are provided in the following
example:
ALTER SESSION SET CONTAINER=dbwest;
CREATE USER ggadmin IDENTIFIED BY PASSWORD CONTAINER=CURRENT;
GRANT CONNECT, RESOURCE, DBA TO ggadmin CONTAINER=CURRENT;
GRANT CREATE SESSION TO ggadmin CONTAINER=CURRENT;
EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('ggadmin');
Note:
Granting DBA role is not mandatory for every user. Privileges should be granted depending on the actions that the user needs to perform on the database. For example, to grant DML operation privileges to insert, update, and delete transactions to ggadmin, use theGRANT ANY INSERT/UPDATE/DELETE
privileges and to further allow users to
work with tables and indexes as part of DML operations, use the GRANT
CREATE/DROP/ALTER ANY TABLE/INDEX
privileges.
Example: Grant privileges using the DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE package
This procedure grants the privileges needed by a user to be an Oracle GoldenGate administrator The following example grants explicit privileges for Extract on Oracle multitenant database:
BEGIN
DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE
(GRANTEE => 'c##ggadmin', PRIVILEGE_TYPE => 'CAPTURE', GRANT_SELECT_PRIVILEGES => TRUE, DO_GRANTS => TRUE, CONTAINER => 'ALL' );
END;
See DBMS_GOLDENGATE_AUTH
in Oracle Database PL/SQL Packages
and Types Reference for more information.
Privileges for Capturing from Oracle Data Vault
Grant the following privileges connected as SYS
user in
Oracle database. These privileges are set for Extract and Replicat user
credentials:
-
EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE ('userID','*', GRANT_OPTIONAL_PRIVILEGES=>'*'); GRANT DV_GOLDENGATE_ADMIN, DV_GOLDENGATE_REDO_ACCESS to userID;
-
Grant Replicat the privileges in
DBMS_MACADM.ADD_AUTH_TO_REALM
if applying to a realm.Connect as Database Vault owner and execute the following scripts:BEGIN DVSYS.DBMS_MACADM.ADD_AUTH_TO_REALM( REALM_NAME => 'Oracle Default Component Protection Realm',GRANTEE => 'userID',AUTH_OPTIONS => 1) ; END ; / EXECUTE_DBMS_MACADM.AUTHORIZE_DDL('SYS', 'SYSTEM');
-
For DDL replication, grant the following as the Database Vault owner:
EXECUTE DBMS_MACADM.AUTHORIZE_DDL (‘userID', ‘SCHEMA FOR DDL’);
Prepare Database Connection, System, and Parameter Settings
Learn about configuring database connection, system, and parameter settings for Oracle GoldenGate for Oracle.
Enable Oracle GoldenGate for Oracle
The database services required to support Oracle GoldenGate capture and apply must be enabled explicitly for all Oracle database versions. This is required for Extract and all Replicat modes.
To enable Oracle GoldenGate, set the following database initialization parameter. All instances in Oracle RAC must have the same setting.
ENABLE_GOLDENGATE_REPLICATION=true
This parameter alters the DBA_FEATURE_USAGE_STATISTICS
view. For
more information about this parameter, see Initialization Parameters.
Setting Flashback Query
To know about the data that Oracle GoldenGate fetches, see Details of Support for Oracle Data Types and Objects.
By default, Oracle GoldenGate uses Flashback Query to fetch the values from the undo (rollback) tablespaces. That way, Oracle GoldenGate can reconstruct a read-consistent row image as of a specific time or SCN to match the redo record.
For best fetch results, configure the source database as follows:
Oracle GoldenGate provides the following parameters to manage fetching.
Parameter or Command | Description |
---|---|
|
Shows Extract fetch statistics on demand. |
|
Sets the |
|
Controls the number of open cursors for prepared
queries that Extract maintains in the source database, and also
for |
|
Controls the default fetch behavior of Extract: whether Extract performs a flashback query or fetches the current image from the table. |
|
Handles the failure of an Extract flashback query, such as if the undo retention expired or the structure of a table changed. Extract can fetch the current image from the table or ignore the failure. |
|
Controls the response by Replicat when it processes trail records that include fetched data or column-missing conditions. |
Handling Other Database Properties
There are some database properties that may affect Oracle GoldenGate and the parameters used to resolve or work around certain conditions.
The following table lists the database properties and the associated concern/resolution.
Database Property | Concern/Resolution |
---|---|
Table with interval partitioning |
To support tables with interval partitioning, make
certain that the |
Table with virtual columns |
Virtual columns are not logged, and Oracle does not permit DML on virtual columns. You can, however, capture this data and map it to a target column that is not a virtual column by doing the following: Include the table in the Extract
In the Replicat |
Table with inherently updateable view |
To replicate to an inherently updateable view, define
a key on the unique columns in the updateable view by using a
|
Redo logs or archives in different locations |
The |
|
To replicate
|
Sequences |
To replicate DDL for sequences
( To replicate just sequence values, use the
|
Configure a Multitenant Container Database
Oracle GoldenGate with Oracle Database allows each pluggable database (PDB) to have Extract registered for a specific PDB, which is called a per-PDB Extract.
The following diagram shows the configuration for different approaches in a multitenant container database configuration:
Description of the illustration pdb_extract_feedbk.png
-
Approach 1: Adding Extract directly from the PDB. This approach is useful when Extract captures from isolated PDBs, managing ownership and responsibility at the PDB level.
-
Approach 2: Adding Extract in the root container and referencing the associated PDBs This approach is useful when Extract captures data from multiple PDBs.
If you use Approach 1, you can create a per-PDB Extract by
connecting as the local PDB user (for example, ggadmin
) and then
register this Extract with the PDB. As you are already logged in as the PDB user,
the container
clause is not required. Similarly, the
SOURCECATALOG
and two-part naming convention is adequate.
c##ggadmin
and create Extract for specific
PDBs. This Extract needs to be registered for the specific PDB using the container
clause. The container clause might contain a single or multiple PDBs.
Note:
Even if you use a root-level Extract, you need the user credentials for each PDB from which you need to capture. The hearbeat table also resides in the individual PDBs.To set up an Extract, see Add a Primary Extract.
Considerations for Multitenant Container Database Configuration
Consider the following guidelines when configuring a multitenant container databases for data replication using Oracle GoldenGate:
-
The different pluggable databases in the multitenant container database can have different character sets. Oracle GoldenGate captures data from any multitenant database with different character sets into one trail file and replicates the data without corruption due to using different character sets.
-
To create and register a per-PDB Extract, you will need to connect to the PDB user such as
ggadmin
created for PDB-level access. Use theUSERIDALIAS
parameter to configure a SQL*Net connection string such asggadmin@pdbeast
. You do not need the container clause or theSOURCECATALOG
to set up the per-PDB Extract. -
To add a user for the root container, Extract must connect to the root container (
cdb$root
) as a common user in order to interact with the logmining server. To specify the root container, use the appropriate SQL*Net connect string for the database user that you specify with theUSERIDALIAS
parameter, such asc##ggadmin@dbeast
. -
To support source CDB 12.2, Extract must specify the trail format as release 12.3. Due to changes in the redo logs, to capture from a multitenant database that is Oracle 12.2 or higher, the trail format release must be 12.3 or higher.
-
DDL replication works as a normal replication for multitenant databases.
See Add Database Connections to add a multitenant container database user in Oracle GoldenGate credentials. See Grant User Privileges for Oracle Database 21c and Lower depending on the Oracle database installation that you need to configure.
Flush Sequence for Multitenant Container Database
You can only use the FLUSH SEQUENCE
command within Oracle
GoldenGate, if the sequence.sql
script applies the database
procedures into the GoldenGate Admin schema of the database.
FLUSH SEQUENCE
command immediately after you
start Extract for the first time during an initial synchronization or a
re-synchronization. This command updates an Oracle sequence, so that initial redo
records are available at the time that Extract starts to capture transaction data.
Normally, redo is not generated until the current cache is exhausted. The flush
gives Replicat an initial start point with which to synchronize to the correct
sequence value on the target system. From then on, Extract can use the redo that is
associated with the usual cache reservation of sequence values.
-
The following Oracle procedures are used by
FLUSH SEQUENCE
:Database Procedure User and Privileges Source
updateSequence
Grants
EXECUTE
to the owner of the Oracle GoldenGate DDL objects, or other selected user if not using DDL support.Target
replicateSequence
Grants
EXECUTE
to the Oracle GoldenGate Replicat user.The
sequence.sql
script installs these procedures. Normally, this script is run as part of the Oracle GoldenGate installation process, but make certain that was done before usingFLUSH SEQUENCE
. Ifsequence.sql
was not run, the flush fails and an error message similar to the following is generated:Cannot flush sequence {0}. Refer to the Oracle GoldenGate for Oracle documentation for instructions on how to set up and run the sequence.sql script. Error {1}.
-
The
GLOBALS
file must contain aGGSCHEMA
parameter that specifies the schema in which the procedures are installed. This user must haveCONNECT
,RESOURCE
, andDBA
privileges. -
Before using
FLUSH SEQUENCE
, issue theDBLOGIN
command as the database user that hasEXECUTE
privilege on theupdateSequence
procedure. If logging into a multitenant container database, log into the pluggable database that contains the sequence that is to be flushed.
FLUSH SEQUENCE
must be issued at the PDB level, to
create an Oracle GoldenGate user in each PDB for which the sequence replication is
required. Use DBLOGIN
to log into that PDB, and run the
FLUSH SEQUENCE
command.
It is recommended that you use the same schema in each PDB, so that it
works with the GGSCHEMA
GLOBALS parameter file.
In the following example, the environment setup is for Oracle 21c to Oracle 21c Replication, with integrated Extract, parallel Replicat using Oracle GoldenGate 21c (21.3.0).
Source CDB | Target CDB |
---|---|
|
SOUTH |
PDB Name: |
PDB Name: |
Common user: PDB user for sequences: |
PDB User: |
sqlplus / as sysdba
ALTER SESSION SESSION SET CONTAINER=CERTMISSN;
CREATE USER ggate IDENTIFIED BY password DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON USERS CONTAINER=CURRENT;
@sequence.sql
sqlplus / as sysdba
ALTER SESSION SET CONTAINER=DBEAST;
@sequence.sql
GGADMIN GLOBALS
GGSCHEMA GGADMIN
FLUSH SEQUENCE
command:DBLOGIN USERIDALIAS ggeast DOMAIN OracleGoldenGate
FLUSH SEQUENCE DBEAST.HR.*
sqlplus / as sysdba
ALTER SESSION SET CONTAINER =PDBWEST;
@sequence.sql
When prompted, enter the PDB user name ggadmin
.
This also applies to the @sequence.sql
script, which
you must also run on each PDB from where you are going to capture.
Configure the Auto Capture Mode for Extract
The auto capture mode allows automatically capturing the tables that have been enabled for Oracle GoldenGate auto capture.
See How to Capture Supplemental Logging for Oracle GoldenGate in the Oracle Database Utilities guide.
-
Easy to configure captured table set
-
No requirement to update
TABLE
/TABLEEXCLUDE
parameter -
No need to stop or restart Extract when captured table set changes
Enabling Auto Capture Mode for Extract
TRANLOGOPTIONS
:
TRANLOGOPTIONS ENABLE_AUTO_CAPTURE | DISABLE_AUTO_CAPTURE
When Extract is running in the auto capture mode, don't filter an LCR if
the object is not part of exclusion list set by TABLE EXCLUDE
parameter or any inclusion list set by TABLE
parameter.
The LIST TABLES
command shows the
list of tables enabled for AUTO_CAPTURE
.
Note:
Auto capture is available from Oracle GoldenGate 21c with Oracle Database 19.18 data patch and higher. In case of database upgrade , any Extract which was registered prior to Oracle Database 19.18 cannot be converted to auto capture. Only new Extracts that are created after upgrateding to Oracle Database 19.18 and later, can be converted to auto capture Extract.See DML Auto Capture and Details of Support for Objects and Operations in Oracle DDL to know about the DML and DDL considerations.
Also see this article Oracle GoldenGate 21c: Auto Capture of Tables to learn more.
Managing Server Resources
Extract interacts with an underlying logmining server in the source database and Replicat interacts with an inbound server in the target database. This section provides guidelines for managing the shared memory consumed by the these servers.
The shared memory that is used by the servers comes from the Streams
pool portion of the System Global Area (SGA) in the database. Therefore, you must
set the database initialization parameter STREAMS_POOL_SIZE
high
enough to keep enough memory available for the number of Extract and Replicat
processes that you expect to run in integrated mode. Note that Streams pool is also
used by other components of the database (like Oracle Streams, Advanced Queuing, and
Datapump export/import), so make certain to take them into account while sizing the
Streams pool for Oracle GoldenGate.
By default, one Extract requests the logmining server to run with
MAX_SGA_SIZE
of 1GB. Thus, if you are running three Extracts in
the same database instance, you need at least 3 GB of memory allocated to the
Streams pool. As a best practice, keep 25 percent of the Streams pool available. For
example, if there are 3 Extracts, set STREAMS_POOL_SIZE
for the
database to the following value:
3 GB * 1.25 = 3.75 GB
Ensuring Row Uniqueness in Source and Target Table
Unless a KEYCOLS
clause is used in the
TABLE
or MAP
statement, Oracle GoldenGate
selects a row identifier to use in the following order of priority, depending on the
number and type of constraints that were logged (see Configure Logging Properties).
-
Primary key if it does not contain any extended (32K)
VARCHAR2/NVARCHAR2
columns. Primary key without invisible columns. -
Unique key: Unique key without invisible columns.
In the case of a non-integrated Replicat, the selection of the unique key is as follows:
-
First unique key alphanumerically with no virtual columns, no UDTs, no function-based columns, no nullable columns, and no extended (32K)
VARCHAR2/NVARCHAR2
columns. To support a key that contains columns that are part of an invisible index, you must use theALLOWINVISIBLEINDEXKEYS
parameter in the Oracle GoldenGateGLOBALS
file. -
First unique key alphanumerically with no virtual columns, no UDTs, no extended (32K)
VARCHAR2/NVARCHAR2
columns, or no function-based columns, but can include nullable columns. To support a key that contains columns that are part of an invisible index, you must use theALLOWINVISIBLEINDEXKEYS
parameter in the Oracle GoldenGateGLOBALS
file.
-
-
Not Nullable Unique keys: At least one column from one of the unique keys must be not nullable. This is because
NOALLOWNULLABLEKEYS
is the default.Note:
ALLOWNULLABLEKEYS
is not valid for integrated Replicat. -
If none of the preceding key types exist (even though there might be other types of keys defined on the table) Oracle GoldenGate constructs a pseudo key of all columns that the database allows to be used in a unique key, excluding virtual columns, UDTs, function-based columns, extended (32K)
VARCHAR2/NVARCHAR2
columns, and any columns that are explicitly excluded from the Oracle GoldenGate configuration by an Oracle GoldenGate user.Unless otherwise excluded due to the preceding restrictions, invisible columns are allowed in the pseudo key.
Note:
If there are other, non-usable keys on a table or if there are no
keys at all on the table, Oracle GoldenGate logs an appropriate message to the
report file. Constructing a key from all of the columns impedes the performance
of Oracle GoldenGate on the source system. On the target, this key causes
Replicat to use a larger, less efficient WHERE
clause.
If a table does not have an appropriate key, or if you prefer the
existing key(s) not to be used, you can define a substitute key if the table has
columns that always contain unique values. You define this substitute key by
including a KEYCOLS
clause within the Extract
TABLE
parameter and the Replicat MAP
parameter. The specified key will override any existing primary or unique key that
Oracle GoldenGate finds. For more information, see Parameters and Functions Reference
for Oracle GoldenGate.
Support for Oracle Sequences
To support Oracle sequences, you must install some database procedures.
From the SQL prompt, run the script
$OGG_HOME/lib/sql/legacy/sequence.sql
on the source and target
database as a DBA.
In a container database (CDB), connect as a local user with DBA privileges in the pluggable database (PDB).
In a non-CDB, connect as DBA for the database.
The Oracle GoldenGate Admin User does not necessarily need DBA privileges. However,
the Oracle GoldenGate Admin User must have the SELECT ANY
DICTIONARY
and the [CREATE |ALTER|DROP] ANY SEQUENCE
privileges in addition to the privileges granted by the OGG_CAPTURE
| OGG_APPLY
role for Oracle Database 23c and higher or through the
procedure call DBMS_GOLDEN_GATE_AUTH.GRANT_ADMIN_PRIVILEGE
for
earlier database versions.
The following example shows how to login to a CDB as the system user and run the
sequence.sql
script:
sqlplus system/***@cdb23_pdbeast
@sequence.sql
You will be
prompted to provide the Oracle GoldenGate Admin User, such as
ggadmin
.
STATUS OF SEQUENCE SUPPORT
--------------------------------------------------------------
SUCCESSFUL installation of Oracle Sequence Replication support
Configure Secure Database Connections from Oracle GoldenGate
-
Include the
USERIDALIAS
option in the Extract and Replicat parameter files -
Set up a connection using TCP or Bequeath protocols
Important:
For Oracle database, it is recommended that you use the TCP or Bequeath protocols with Oracle GoldenGate to be able to use features such as efficient DDL notification. Avoid using the IPC protocol as there are intermittent issues with using this protocol. For details, see Table DDL Change Notification in the Oracle Database Development GuideSecurity Options for Specifying the Connection String in the Extract and Replicat Parameter Files
The following are the security options for specifying the connection string in the Extract or Replicat parameter file.
Credential store method:
USERIDALIAS ggeast
In the case of USERIDALIAS
, the alias
ggeast
is stored in the Oracle GoldenGate credential store with
the actual connection string. The following example uses the INFO
CREDENTIALSTORE
command to display the details of the credentials
configured in Oracle GoldenGate:
INFO CREDENTIALSTORE DOMAIN OracleGoldenGate
Output:
Domain: OracleGoldenGate
Alias: ggeast
Userid: ggadmin@dc1.example.com:1521/DBEAST.example.com
Setting up a Bequeath connection
Valid for Oracle database.
Oracle GoldenGate can connect to a database instance
without using the network listener if a Bequeath connect descriptor is added in the
tnsnames.ora
.
The following example shows the configuration for connecting to a database using Bequeath connect descriptor:
dbbeq = (DESCRIPTION=
(ADDRESS=(PROTOCOL=beq)
(ENVS='ORACLE_SID=sales,ORACLE_HOME=/app/db_home/oracle,LD_LIBRARY_PATH=/app/db_home/oracle/lib')
(PROGRAM=/app/db_home/oracle/bin/oracle)
(ARGV0=oraclesales)
(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))
(CONNECT_DATA=(SID=sales)))
In this example:
/app/db_home
is the target Oracle database installation
directory
sales
is the database service name
ORACLE_SID
, ORACLE_HOME
, and
LD_LIBRARY_PATH
in the ENVS
parameter refers
to the target.
Note:
Make sure that there is no white space between these environment variable settings.Setting up a TCP connection
For Oracle database, you can configure connect description in the
tnsnames.ora
file for setting up a TCP connection
and save it in the credentials store in Oracle GoldenGate. The following example
shows the tnsnames.ora
file with the TCP connect
descriptor:
##tnsnames.ora file sample for database host DBEAST
cdb23_root = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBEAST)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=rdbms.oracle.com)))
cdb23_pdb0 = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBEAST)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cdb1_pdb0.rdbms.oracle.com)))
cdb23_pdbeast = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBEAST)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cdb1_pdbeast.rdbms.oracle.com)))
cdb23_pdbwest = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBEAST)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cdb1_pdbwest.rdbms.oracle.com)))
To configure additional security options using sqlnet.ora
, see Connecting to a Database Using Strong Authentication
Configure Logging Properties
Oracle GoldenGate relies on the redo logs to capture the data that it needs to replicate source transactions. The Oracle redo logs on the source system must be configured properly before you start Oracle GoldenGate processing.
This section addresses the following logging levels that apply to Oracle GoldenGate. The logging level that you use depends on Oracle GoldenGate features that you are using.
Note:
Redo volume is increased as the result of this required logging. You can wait until you are ready to start Oracle GoldenGate processing to enable the logging.
This table shows the Oracle GoldenGate use cases for the different logging properties.
Logging option | Command Name | What it does | Use case |
---|---|---|---|
Forced logging mode |
|
Forces the logging of all transactions and loads. |
Strongly recommended for all Oracle GoldenGate use
cases. |
Minimum database-level supplemental logging |
|
Enables minimal supplemental logging to add row-chaining information to the redo log. |
Required for all Oracle GoldenGate use cases |
Schema-level supplemental logging, default setting |
|
Enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of all tables in a schema. All of these keys together are known as the scheduling columns. |
Enables the logging for all current and future tables
in the schema. If the primary key, unique key, and foreign key
columns are not identical at both source and target, use
|
Schema-level supplemental logging with unconditional logging for all supported columns. (See Enable Schema-level Supplemental Logging for non-supported column types.) |
|
Enables unconditional supplemental logging of all of the columns in a table, for all of the tables in a schema. |
Used for bidirectional and active-active configurations where all column values are checked, not just the changed columns, when attempting to perform an update or delete. This takes more resources though allows for the highest level of real-time data validation and thus conflict detection. This method should also be used if they are going to
be using the |
Schema-level supplemental logging, minimal setting |
|
Enables unconditional supplemental logging of the primary key and all valid unique indexes of all tables in a schema. |
Use only for nonintegrated Replicat. This is the minimum required schema-level logging. |
Table-level supplemental logging with built-in support for integrated Replicat |
|
Enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of a table. All of these keys together are known as the scheduling columns. |
Required for all Oracle GoldenGate use cases unless
schema-level supplemental logging is used. If the primary key,
unique key, and foreign key columns are not identical at both
source and target, use |
Table-level supplemental logging with unconditional logging for all supported columns. (See Enable Table-level Supplemental Logging for non-supported column types.) |
|
Enables unconditional supplemental logging of all of the columns of the table. |
Used for bidirectional and active-active configurations where all column values are checked, not just the changed columns, when attempting to perform an update or delete. This takes more resources though allows for the highest level of real-time data validation and thus conflict detection. It can also be used when the source and target primary, unique, and foreign keys are not the same or are constantly changing between source and target. |
Table-level supplemental logging, minimal setting |
|
Enables unconditional supplemental logging of the primary key and all valid unique indexes of a table. |
Use for nonintegrated Replicat and non-parallel Replicat. This is the minimum required table-level logging. |
Enable Subset Database Replication Logging
Oracle strongly recommends putting the Oracle source database into forced logging mode. Forced logging mode forces the logging of all transactions and loads, overriding any user or storage settings to the contrary. This ensures that no source data in the Extract configuration gets missed.
There is a fine-granular database supplemental logging mode called Subset Database Replication available in LogMiner, which is the basic recommended mode for all Oracle GoldenGate and XStream clients. It replaces the previously used Minimum Supplemental Logging mode.
To know more, see ALTER DATABASE
in the Oracle Database SQL Language Reference.
The subset database replication logging is enabled at
CDB$ROOT
(and all user-PDBs inherit it) currently.
Note:
Database-level primary key (PK) and unique index (UI) logging is only discouraged if you are replicating a subset of tables. You can use it with Live Standby, or if Oracle GoldenGate is going to replicate all tables, like to reduce the downtime for a migration or upgrade.
Perform the following steps to verify and enable, if necessary, subset database replication logging and forced logging.
Enable Schema-level Supplemental Logging
Oracle GoldenGate supports schema-level supplemental logging. Schema-level logging is required for an Oracle source database when using the Oracle GoldenGate DDL replication feature. In all other use cases, it is optional, but then you must use table-level logging instead (see Enable Table-level Supplemental Logging).
By default, schema-level logging automatically enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of all tables in a schema. Options enable you to alter the logging as needed.
Note:
Oracle strongly recommends using schema-level logging rather than
table-level logging, because it ensures that any new tables added to a schema
are captured if they satisfy wildcard specifications. This method is also
recommended because any changes to key columns are automatically reflected in
the supplemental log data too. For example, if a key changes, there is no need
to issue ADD TRANDATA
.
Perform the following steps on the source system to enable schema-level supplemental logging.
Enable Table-level Supplemental Logging
Enable table-level supplemental logging on the source system in the following cases:
-
To enable the required level of logging when not using schema-level logging (see Enable Schema-level Supplemental Logging). Either schema-level or table-level logging must be used. By default, table-level logging automatically enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of a table. Options enable you to alter the logging as needed.
-
To prevent the logging of the primary key for any given table.
-
To log non-key column values at the table level to support specific Oracle GoldenGate features, such as filtering and conflict detection and resolution logic.
-
If the key columns change on a table that only has table-level supplemental logging, you must perform
ADD TRANDATA
on the table prior to allowing any DML activity on the table.
Perform the following steps on the source system to enable table-level supplemental logging or use the optional features of the command.
-
Run the command line on the source system.
-
Issue the
DBLOGIN
command using the alias of a user in the credential store who has privilege to enable table-level supplemental logging.DBLOGIN USERIDALIAS alias
See
USERIDALIAS
in Parameters and Functions Reference for Oracle GoldenGatefor more information aboutDBLOGIN
and additional options. -
Issue the
ADD TRANDATA
command.ADD TRANDATA [PDB.]schema.table [, COLS (columns)] [, NOKEY] [, ALLCOLS | NOSCHEDULINGCOLS]
Where:
-
PDB
is the name of the root container or pluggable database if the table is in a multitenant container database. -
schema
is the source schema that contains the table. -
table
is the name of the table. See Specifying Object Names in Oracle GoldenGate Input for instructions for specifying object names. -
ADD TRANDATA
without other options automatically enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of the table. Unconditional logging forces the primary key values to the log whether or not the key was changed in the current operation. Conditional logging logs all of the column values of a foreign or unique key if at least one of them was changed in the current operation. The default is optional to support nonintegrated Replicat (see alsoNOSCHEDULINGCOLS
) but is required to support integrated Replicat because primary key, unique keys, and foreign keys must all be available to the inbound server to compute dependencies. For more information about integrated Replicat, see unresolvable-reference.html#GUID-6635228F-F992-4DAE-AD5E-0BE5A36542CC. -
ALLCOLS
enables the unconditional supplemental logging of all of the columns of the table. Use to support integrated Replicat when the source and target tables have different scheduling columns. (Scheduling columns are the primary key, the unique key, and the foreign key.) -
NOSCHEDULINGCOLS
is valid for Replicat in nonintegrated mode only. It issues anALTER TABLE
command with anADD SUPPLEMENTAL LOG DATA ALWAYS
clause that is appropriate for the type of unique constraint that is defined for the table, or all columns in the absence of a unique constraint. This command satisfies the basic table-level logging requirements of Oracle GoldenGate when schema-level logging will not be used. See Ensuring Row Uniqueness in Source and Target Table for how Oracle GoldenGate selects a key or index. -
COLS
columns
logs non-key columns that are required for aKEYCOLS
clause or for filtering and manipulation. The parentheses are required. These columns will be logged in addition to the primary key unless theNOKEY
option is also present. -
NOKEY
prevents the logging of the primary key or unique key. Requires aKEYCOLS
clause in theTABLE
andMAP
parameters and aCOLS
clause in theADD TRANDATA
command to log the alternateKEYCOLS
columns.
-
-
If using
ADD TRANDATA
with theCOLS
option, create a unique index for those columns on the target to optimize row retrieval. If you are logging those columns as a substitute key for aKEYCOLS
clause, make a note to add theKEYCOLS
clause to theTABLE
andMAP
statements when you configure the Oracle GoldenGate processes.
Remove Table-level Supplemental Logging
If a table is no longer required to be captured by Oracle GoldenGate and the TABLE
parameter for the table has been removed from the Extract parameter file, or TABLEEXCLUDE
is used to exclude the table from a wildcard statement, then supplemental logging can be removed from the table.
Note:
If the Extract resolves a table that does not have supplemental logging enabled, it will abend depending on the type of DML operation.
Using DELETE TRANDATA
to remove supplemental logging sets the
Replicat Identity level of the table to NOTHING
. Supplemental logging
can be disabled using the Microservices Architecture web interface from the
Administration Service, Configuration page, under the Credential created for a source
database, or can be issued with the DELETE TRANDATA
command.
The following is the syntax for issuing DELETE TRANDATA
.
DBLOGIN USERIDALIAS alias_name
DELETE TRANDATA schema.tablename
To check the level of supplemental logging:
INFO TRANDATA schema.tablename