GoldenGate
==========
Prepare Golden Gate for replication
--------------------------------------------
On both proddb and devdb
SELECT SUPPLEMENTAL_LOG_DATA_MIN, FORCE_LOGGING
FROM V$DATABASE;
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE FORCE LOGGING;
SELECT SUPPLEMENTAL_LOG_DATA_MIN, FORCE_LOGGING
FROM V$DATABASE;
Enable Golden Gate Replication Parameter:
ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE;
=====================================================
ORACLE_HOME
ORACLE_SID
must be set
SETENV (ORACLE_HOME = "oracle home directory path here")
SETENV (ORACLE_SID = "SID")
Oracle GoldenGate processes use the database shared libraries. You will need to set the
shared library variable for this purpose.
export PATH=$PATH:/app/ggs/tiger/:.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/oracle/product/orcl/lib/
SELECT supplemental_log_data_min, force_logging FROM v$database;
GGSCI = GoldenGate Software Command Interface
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE FORCE LOGGING; (Optional)
after setting the above values, we must switch a logfile.
ALTER SYSTEM SWITCH LOGFILE;
SQL> ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION=TRUE;
Log in to GGSCI and enable supplemental logging for the GoldenGate table/schema, as follows:
GGSCI> DBLOGIN USERID user_name, PASSWORD password
GGSCI> ADD SCHEMATRANDATA schema_name ALLCOLS
OR
GGSCI> ADD SCHEMATRANDATA schema_name NOSCHEDULINGCOLS
To enable logging for particular tables, use ADD TRANDATA . You can specify the
container name, column list.
GGSCI> ADD TRANDATA schema_name.table_name
Supported Operations
The following are supported: insert, update, and delete operations on regular tables, index organized tables,
clustered tables, and materialized views. There are, however, few limitations, as listed here:
• Virtual columns are not captured.
• Tables created as EXTERNAL are not captured.
• Tables created with table compression are not supported.
• Materialized views created with ROWID are not supported.
Database Privileges for GoldenGate Users
Oracle GoldenGate processes, specifically the extract and replicat processes, require database credentials to perform replication.
CREATE SESSION
RESOURCE
DBA
ALTER SYSTEM
dbms_goldengate_auth.grant_admin_privilege
INSERT, UPDATE, DELETE on target schema tables
CREATE TABLE
DDL privileges on target schema (if DDL replication is required)
The base privileges required by the Oracle GoldenGate user in Oracle databases are given through the dbms_goldengate_auth.grant_admin_privileges package.
Use following to grant base privileges to the GoldenGate user ggsuser . Execute the following command to grant privilege to both the capture and apply processes.
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ggsuser');
optional:
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ggsuser','capture');
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ggsuser','apply');
chapter 4