Golden Gate Maintenance: tips & tricks

From Robs_Wiki
Jump to: navigation, search

Query all report files for any errors or warnings

$ cd $GG_HOME/dirrpt
$ $for i in $(ls -rt /u01/app/oracle/product/gg12.1.2/oggcore_1/dirrpt/X*); do grep -w ERROR $i; done

Zip all report files in a single file

Sometimes Oracle Supports asks for all the reports:

$ cd $GG_HOME
$ zip -r dirrpt.zip dirrpt

How to run a ggsci batch script

Create file my_batch.oby which contains all the statements you want to execute, for example:

add trandata hr.table_1
add trandata hr.table_2
add trandata hr.table_3

Now start this batch script as follows:

$ cd $GG_HOME
./ggsci
ggsci> dblogin useridalias my_alias
ggsci> OBEY ./my_batch.oby
ggsci> exit

Log the ggsci actions

- start the script session
 
$script ggsci.log
Script started, file is ggsci.log
 
-- reset the environment
$ . oraenv => prd12c
 
-- perform normal operations
 
$./ggsci
 
Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
AIX 6, ppc, 64bit (optimized), Oracle 12c on Jan 22 2016 00:48:45
Operating system character set identified as ISO-8859-1.
 
Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved. 
 
 
GGSCI> dblogin userid ggadmin password ggadmin
Successfully logged into database.
 
GGSCI> info all
 
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
 
MANAGER     RUNNING
 
GGSCI> exit
 
-- leave the script session
 
$ exit
 
Script done, file is ggsci.log

Trace a Golden Gate replicat or extract

GGSCI (gfd-dm1dbadm01.atradiusnet.com as ggadmin@dggt01_1) 43> send replicat rrob trace /home/oracle/rob/rob2.trc

Sending trace request to REPLICAT RROB ...
Trace file /home/oracle/rob/rob2.trc opened.


GGSCI (gfd-dm1dbadm01.atradiusnet.com as ggadmin@dggt01_1) 44> send replicat rrob trace off

Sending trace request to REPLICAT RROB ...
Closing all trace files..

Check the syntax of the parameter files with the checkprm utility

You can check the syntax of the GoldenGate parameter files with the checkprm utility:

$ cd $GG_HOME
$ ./checkprm dirprm/r1rob.prm

2017-09-18 11:08:20  INFO    OGG-02095  Successfully set environment variable ORACLE_SID=prd12c.

2017-09-18 11:08:20  INFO    OGG-02095  Successfully set environment variable ORACLE_HOME=.

2017-09-18 11:08:20  INFO    OGG-02095  Successfully set environment variable NLS_LANG=ENGLISH_UNITED KINGDOM.WE8MSWIN1252.

2017-09-18 11:08:20  INFO    OGG-10139  Parameter file dirprm/r1rob.prm:  Validity check: PASS.

Runtime parameter validation is not reflected in the above check.