Oracle DBA, How To, Error, Cause and Action

Oracle GoldenGate Setup Procedure

A. GoldenGate Software 
At Both Database (Source and Target)
1. Create GoldenGate Home
2. Extract and install GoldenGate

B. GoldenGate Database Level Users And Setting 
At Both Database (Source and Target)
3. Create Oracle GoldenGate DB users
4. Grant appropriate privileges for GoldenGate DB user according to their role (Source or Target)
5. Enable minimal supplemental logging by executing the following command:
    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
6. To ensure that the redo and archive logs contain supplemental log data, switch the logs by executing the
    following command:
    ALTER SYSTEM SWITCH LOGFILE;
7. Verify that supplemental logging is enabled at the database level via the following command.
    (Note: Output of the query must be YES or IMPLICIT.)
    SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;

C. GoldenGate Global Parameter Files
At BOTH GoldenGate Home
8. edit GLOBALS parameter file add
     
         vi GLOBALS
       
            checkpointtable GGS_CHECKPOINT

execute following command for both source and target
$ export ORACLE_SID=source/target
GGSCI> dblogin userid <gguser>, password <password>
GGSCI> add checkpointtable



D. GoldenGate Manager Parameter File
At Source DB having manager using port 15001
9a. GGSCI> edit param mgr


--
--   GoldenGate Manager Parameter File (mgr.prm)
--
--   Set the runtime attributes for manager
--   Parameters are not case sensitive (can be lower, upper, or mixed case).
--   Directory and file names are case sensitive for Linux and UNIX only.
--


--   PORT sets the GoldenGate Manager Listener port.
--   Manager listens on this port for GoldenGate connection requests
--   These requests can come from Director or GoldenGate Extract.
--   Any other entity attemtpting to connect to this port will receive a
--   "refused" reply
PORT 15000


--   DYNAMICPORTLIST sets the port, series, or range of ports where two way
--   communication will be allowed for Director or GoldenGate Extract. If the
--   connect request comes from GoldenGate Extract, Manager will spawn a
--   process of the Server executable. This process receives data transmitted
--   over TCP/IP by Extract and performs a disk operation into the designated
--   file location.
DYNAMICPORTLIST 15010-15020


--   PURGEOLDEXTRACTS is used for housekeeping purposes.
--   Every 10 minutes Manager spawns a housekeeping process that checks for
--   amongst other things, files that are no longer needed. Any files in the -
--   designated directory or folder will be purged if there are no GoldenGate -  
--   processes that require
--   the file (holding a checkpoint to the file).
PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS


--   There are numerous runtime attributes that may be set in this file; 
--   including, but not limited to options that control process failure restart, 
--   process startup, and lag reporting.
--   For more information on other parameter settings related to GoldenGate 
--   Manager, refer to the Oracle GoldenGate for Windows and Unix Reference 
--   Guide.

9.a.1 GGSCI> start mgr
9.a.2 GGSCI> info mgr

At Target DB, having manager using port 15001
9.b GGSCI> edit param mgr

PORT 15001
PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS


9.b.1 GGSCI> start mgr
9.b.2 GGSCI> info mgr


E. Create Trandata at Source
10. Before you can start capturing real-time data, the Oracle database must be set to log the table key values whenever it logs a rows change, so they are available to Oracle GoldenGate in Redo. By default, the database only logs column values that change. This is required so Oracle GoldenGate can locate the correct row on the target for update and delete operations.

GGSCI> dblogin userid gguser, password gguser
GGSCI> add trandata schema.*
GGSCI> info trandata schema.*

F. Configure GoldenGate Extract Process That Generate EXTTRAIL local trail file
At Source DB
11. GGSCI> edit param extract_trail_local

        EXTRACT extract_trail_local
        EXTTRAIL ./dirdat/data_to_go
        USERID gguser, PASSWORD gguser
        TABLE schema.*;
        STATOPTIONS REPORTDETAIL         
        STATOPTIONS RESETREPORTSTATS
        EVENTACTIONS 



12. Once the parameter file created add the Extract Group by executing the following GGSCI commands:
                add extract  extract_trail_local, tranlog, begin now

      This adds the  extractsource Extract to Oracle GoldenGate, specifying that it will read from
      Oracle Redo/Archive, with an initial Redo checkpoint of the current timestamp.


13. Add a local extract trail, with a maximum file size of 50 megabytes per trail that links the trail to the  extractsource  Extract:
   GGSCI>  add exttrail ./dirdat/ew, extract  extract_trail_local, megabytes 50

14. At the GGSCI prompt on the source server, configure the Extract Data Pump to read from the./dirdat/data_to_go  local extract trail, transmit the data to the target server, and write it to the./dirdat/incoming_data remote trail:


GGSCI> edit param pump_trail_to_remote

        EXTRACT pump_trail_to_remote
        RMTHOST remote_host_name, MGRPORT 15001, COMPRESS
        RMTTRAIL ./dirdat/incoming_data 
        PASSTHRU
        TABLE schema.*;


15. Add the Extract Group by executing the following GGSCI commands:

   GGSCI> add extract  pump_trail_to_remote , exttrailsource ./dirdat/incoming_data 

   GGSCI> add rmttrail ./dirdat/ incoming_data, extract  pump_trail_to_remote , megabytes 50

G. Start Both Extract, that generate trail locally and extract pump to remote
At Source DB
16. GGSCI> start extract extract_trail_local
17. GGSCI> start extract pump_trail_to_remote
18. To view all extract information 
      GGSCI> info er *



Both processes should display as “RUNNING.” If you see either “STOPPED” or “ABENDED,” view the report log (view report <extract name>), fix the error, and restart the process.

View the ggserr.log    


Manager, Extract, Replicat: GoldenGate processes
ER: Multiple Extract and Replicat processes
EXTTRAIL: Local trail
RMTTRAIL: Remote trail
TRANDATA: Enables supplemental logging of Primary Keys and/or indexes for a schema or table in the transaction logs
CHECKPOINTTABLE: Checkpoint table (on target database)
TRACETABLE: Oracle trace table (on target database)