Oracle DBA, How To, Error, Cause and Action

GoldenGate Capturing from one source database in real-time mode

Capturing from one source database in real-time mode


This example captures changes from source database DBMS1 by deploying an integrated
capture session at a downstream mining database DBMSCAP. This assumes that the
following users exist:

  • User GGADM1 in DBMS1 whose credentials Extract will use to fetch data and metadata from DBMS1. User GGADM1 has select privileges on V_$DATABASE view at the source database. It is assumed that the DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE() procedure was called to grant appropriate privileges to this user at the source database.
  • User GGADMCAP in DBMSCAP whose credentials Extract will use to retrieve logical change records from the logmining server at the downstream mining database DBMSCAP. It is assumed that the DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE() procedure was called to grant appropriate privileges to this user at the mining database. User GGADMCAP has select privileges on V_$DATABASE view at the downstream mining database.

Prepare the mining database to archive its local redo
1. The downstream mining database must be in archivelog mode. You can do this by issuing the following 
    DDL.

      STARTUP MOUNT;
      ALTER DATABASE ARCHIVELOG;
      ALTER DATABASE OPEN;

2. At the downstream mining database, set log_archive_dest_1 to archive local redo.
      ALTER SYSTEM SET
      LOG_ARCHIVE_DEST_1='LOCATION=/home/arc_dest/local
      VALID_FOR=(ONLINE_LOGFILE, PRIMARY_ROLE)'

3. Enable log_archive_dest_1.
       ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE

Prepare the mining database to archive redo received in standby redo logs from the source database

1. At the downstream mining database, set log_archive_dest_2 as shown in the following example.
        ALTER SYSTEM SET
        LOG_ARCHIVE_DEST_2='LOCATION=/home/arc_dest/srl_dbms1
        VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)'

2. Enable log_archive_dest_2 as shown in the following example.
        ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE

3. Set DG_CONFIG at the downstream mining database.
          ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(dbms1,dbmscap)'


Prepare the source database to send redo to the mining database

1. Make sure that the source database is running with the required compatibility.

select name, value from v$parameter where name = 'compatible';
NAME      VALUE
--------- ---------------------
compatible 11.1.0.7.0

The minimum compatibility setting required from integrated capture is 10.2.0.0.0.

2. Set DG_CONFIG at the source database.
     ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(dbms1,dbmscap)';

3. Set up redo transport at the source database.
       ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=DBMSCAP.EXAMPLE.COM 
           ASYNC OPTIONAL
           NOREGISTER
           VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=dbmscap';

4. Enable the downstream destination.
       ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;


Set up integrated capture (ext1) on DBMSCAP

1. Register Extract with the downstream mining database.
 
     GGSCI> DBLOGIN USERID ggadm1@dbms1 PASSWORD ggadm1pw
     GGSCI> MININGDBLOGIN USERID ggadmcap@dbmscap PASSWORD ggadmcappw
     GGSCI> REGISTER EXTRACT ext1 DATABASE

2. Create Extract at the downstream mining database.
   
     GGSCI> ADD EXTRACT ext1 INTEGRATED TRANLOG BEGIN NOW

3. Edit Extract parameter file ext1.prm. The following lines must be present to take advantage of real-time capture.

USERID ggadm1@dbms1 PASSWORD ggadm1pw
TRANLOGOPTIONS MININGUSER ggadmcap@dbmscap MININGPASSWORD ggadmcappw
TRANLOGOPTIONS INTEGRATEDPARAMS (downstream_real_time_mine Y)

4. Start Extract.

START EXTRACT ext1