Oracle GoldenGate Commands and Demonstrates!
In this article, we will see Oracle Golden Gate Commands!
- INFO ALL,
- ALLOWNESTED | NOALLOWNESTED,,
- CREATE SUBDIRS,
- DEFAULTJOURNAL,
- FC,
- HELP,
- HISTORY
- OBEY,
- SHELL,
- VERSIONS
Here, I would like to explain each and every GG commands:
1.INFO ALL :
Use INFO ALL to display the status and lag (where relevant) for all Manager,
Extract, and Replicat processes on a system.
Extract, and Replicat processes on a system.
GGSCI (rac1) > info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPXRACT1 00:00:01 00:00:06
EXTRACT RUNNING EXTRACT1 00:00:07 00:00:04
INFO MANAGER :
To know Manager port ,Process ID and Host ID.
GGSCI (rac1) > info MANAGER
Manager is running (IP port TCP:rac1.7833, Process ID 6852)
INFO EXTRACT <EXTRACT_NAME>
To know about extract process checkpoint Lag, SCN and Last started time and status
GGSCI (rac1) > info EXTRACT EXTRACT1
EXTRACT EXTRACT1 Last Started 2020-03-30 14:32 Status RUNNING
Checkpoint Lag 00:00:10 (updated 00:00:00 ago)
Process ID 62415
Log Read Checkpoint Oracle Integrated Redo Logs
2020-04-02 16:45:12
SCN 0.4456234 (4456234)
INFO EXTRACT <EXTRACT_NAME> DETAIL
To know more about extract process like RBA,Report file,Parameter file,Checkpoint file,Process file and Error log
INFO EXTRACT EXTRACT1,SHOWCH
It will show Latest Read,write CHECKPOINT details
INFO EXTRACT EXTRACT1,SHOWCH 5
It will show history Read,write CHECKPOINT details(Count 5)
INFO ER*
It will show EXTRACT and RMTTRAIL file.
INFO EXTRAIL *
It will show extrail file details like Extrailfile,SEQNO,RBA and Filesize
INFO RMTTRAIL *
It will show extrail file details like Extrailfile,SEQNO,RBA and Filesize
INFO CREDENTIALSTORE
To get information regrading credential store
ALLOWNESTED | NOALLOWNESTED:
Use the ALLOWNESTED and NOALLOWNESTED commands to enable or disable the use of
nested OBEY files. A nested OBEY file is one that contains another OBEY file.
When you exit your GGSCI session, the next GGSCI session will revert back to NOALLOWNESTED.
For more information, see “OBEY”.
Syntax
ALLOWNESTED | NOALLOWNESTED
ALLOWNESTED:
Enables the use of nested OBEY files. The maximum number of nested levels is 16.
NOALLOWNESTED:
This is the default. An attempt to run a nested OBEY file in the default
mode of NOALLOWNESTED will cause an error that is similar to the following:
ERROR: Nested OBEY scripts not allowed. Use ALLOWNESTED to allow nested scripts.
ERROR: Nested OBEY scripts not allowed. Use ALLOWNESTED to allow nested scripts.
CREATE SUBDIRS:
Use CREATE SUBDIRS when installing Oracle GoldenGate. This command creates
the default directories within the Oracle GoldenGate home directory.
Use CREATE SUBDIRS before any other configuration tasks.
Syntax
CREATE SUBDIRS
It will create below directories
List of directories :
dirdat –> Extract data files
dirchk –> Checkpoint file
dirtmp –> Temporary files
dirrpt –> Report file
dirdef –> Database definitions files
dirpcs –> Process status files
dirtmp –> Temporary files
dirsql –> SQL script files
dircrd –> Credential store files
dirwlt –> Master key wallet files
dirdmp –> Dump files
History and FC Commands :
The history command-line lists the last 10 executed GGSCI commands.
When passing an argument of positive number such as 15, to the HISTORY command,
GGSCI lists the last 15 executed commands. The FC command fetches the command
from the history list for re-execution. The example below illustrates using
the three commands HISTORY and FC.
GGSCI (rac1) 2> history
GGSCI Command History
4: allprocesses
5: info extract EXTRACT1,allprocesses
6: info ER *
7: info exttrail *
8: info rmttrail *
9: help
10: help add extract
11: history
12: info extract *, detail
13: history
GGSCI (rac1) 2> fc 7
GGSCI (rac1) 2> info exttrail *
HELP :
Help command displays all commands structure with examples in GGSCI prompt
GGSCI (rac1) 2> help
HELP OBEY
It will show how to add obey files & examples
GGSCI (rac1) 2> help obey
HELP ADD EXTRACT
It will show how to add extract examples
GGSCI (rac1) 2> help ADD EXTRACT
SHELL:
To execute an operating system shell command from within GGSCI, enter the shell ggsci command followed by the operating system command.
GGSCI (rac1) 8> shell ls -lrt
GGSCI (rac1) 8> shell cp ./dirprm/* /tmp/*.prm
GGSCI (rac1) 8> shell ls -lrt /tmp/*.prm
VERSIONS:
The GGSCI command is used to determine the operating system details and database version
GGSCI (rac1) 10> versions
SOME MORE COMMANDS OGG:
OBEY
LAG
CLEANUP
KILL
SEND
OBEY:
To process a file that contains a list of Golden Gate commands.
OBEY is useful for executing commands that are frequently used in sequence.
You can call one OBEY file from another one.
Create a file(obey.cmd) in any location
vi obey.cmd
START MANAGER
START EXTRACT EXTINT
START EXTRACT DPINT
INFO ALL
Connect to GGSCI
oracle@rac1> cd /u01/app/oracle/product/ogg_12c/
./ggsci
Check content with SHELL command
GGSCI (rac1) 4> SHELL cat /u01/app/oracle/product/ogg_12c/obey.cmd
START MANAGER
START EXTRACT EXTINT
START EXTRACT DPINT
INFO ALL
Now run the OBEY file which was created earlier:
GGSCI (rac1) 5> obey /u01/app/oracle/product/ogg_12c/obey.cmd
GGSCI (rac1) 6> START MANAGER
Manager started.
GGSCI (rac1) 7> START EXTRACT EXTRACT1
Sending START request to MANAGER ...
EXTRACT EXTRACT1 starting
GGSCI (rac1) 8> START EXTRACT DPXRACT1
Sending START request to MANAGER ...
EXTRACT DPXRACT1 starting
GGSCI (rac1) 9> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPXRACT1 00:00:00 00:00:21
EXTRACT RUNNING EXTRACT1 00:00:04 00:00:02
LAG:
Lag is the time difference between when changes are made within the source database
and when those changes are applied to the target database.
Extract lag: The difference, in seconds, between the system clock time that a
record was processed by the Extract GoldenGate component and the timestamp of that
record in the data source.
GGSCI (gg.orcl.com) 1> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPXRACT1 00:00:00 00:00:03
EXTRACT RUNNING EXTRACT1 00:00:05 00:00:06
GGSCI (rac1) 10> info credentialstore
Reading from credential store:
Default domain: OracleGoldenGate
Login to database
GGSCI (rac1) 11> dblogin useridalias ggadmin_rac
Successfully logged into database.
Now run LAG command
GGSCI (rac1) 12> LAG EXTRACT1
Sending GETLAG request to EXTRACT EXTRACT1 ...
Last record lag 4 seconds.
GGSCI (rac1) 13> LAG DPXRACT1
Sending GETLAG request to EXTRACT DPXRACT1 ...
Last record lag 5 seconds.
At EOF, no more records to process
Replicat lag: The difference, in seconds, between the system clock time that the
last record was processed by the Replicat GoldenGate component and the timestamp of
the record in the trail files, which are a record of the transactions.
GGSCI (gg2.orcl.com) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPINT 00:00:00 00:00:05
GGSCI (rac2) 1> info credentialstore
Reading from credential store:
Default domain: OracleGoldenGate
GGSCI (rac2) 2> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPCAT 00:00:00 00:00:05
Login to database
GGSCI (rac2) 3> dblogin useridalias ggadmin_tgt
Successfully logged into database.
Now run LAG command for replicat process
GGSCI (rac2) 5> LAG replicat REPCAT
Sending GETLAG request to REPLICAT REPCAT ...
Last record lag 6 seconds.
Low watermark lag: 12.
High watermark lag: 22.
Low watermark position: 4421145.
High watermark position: 4481166.
At EOF, no more records to process
CLEANUP:
CLEANUP command is used to delete run history for the specified Extract or Replicat group.
The cleanup keeps the last run record intact so that Extract can resume processing
from where it left off.
Before using this command, stop Extract by issuing the STOP EXTRACT command.
KILL:
Forcibly terminates the run of an Extract group.
Use KILL EXTRACT to kill an Extract process running in regular or PASSIVE mode.
Use this command only if a process cannot be stopped gracefully with the
STOP EXTRACT command. The Manager process will not attempt to restart a killed Extract process.
Post a Comment: