Dear Readers,
In the article, we will see Oracle GoldenGate Miscellaneous commands (Part-2)
To check part -1 use below link
Oracle goldengate miscellaneous commands part-1
To install Oracle GoldenGate use below link
Installation of Oracle GoldenGate
Miscellaneous Commands are :
- 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(sample.txt) in any location
1 2 3 4 5 6 7 |
[oracle@gg ogg_src]$ pwd /u01/app/oracle/product/ogg_src [oracle@gg ogg_src]$ cat sample.txt START MANAGER START EXTRACT EXTINT START EXTRACT DPINT INFO ALL |
Connect to GGSCI
1 2 3 4 5 6 7 8 9 10 |
[oracle@gg ogg_src]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 19.1.0.0.0 OGGCORE_19.1.0.0.0_PLATFORMS_190508.1447_FBO Linux, x64, 64bit (optimized), Oracle 12c on May 9 2019 06:21:59 Operating system character set identified as UTF-8. Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved. GGSCI (gg.orcl.com) 1> |
Check content with SHELL command
1 2 3 4 5 6 |
GGSCI (gg.orcl.com) 1> shell cat /u01/app/oracle/product/ogg_src/sample.txt START MANAGER START EXTRACT EXTINT START EXTRACT DPINT INFO ALL |
Now run the file with OBEY
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
GGSCI (gg.orcl.com) 2> obey /u01/app/oracle/product/ogg_src/sample.txt GGSCI (gg.orcl.com) 3> START MANAGER Manager started. GGSCI (gg.orcl.com) 4> START EXTRACT EXTINT Sending START request to MANAGER ... EXTRACT EXTINT starting GGSCI (gg.orcl.com) 5> START EXTRACT DPINT Sending START request to MANAGER ... EXTRACT DPINT starting GGSCI (gg.orcl.com) 6> INFO ALL Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DPINT 00:00:00 00:01:39 EXTRACT RUNNING EXTINT 00:01:34 00:00:07 |
We can call one OBEY file from another one.
1 2 3 4 5 6 7 8 9 10 11 12 |
GGSCI (gg.orcl.com) 1> shell cat /u01/app/oracle/product/ogg_src/stats_process.txt status manager stats extint stats dpint allownested obey ./info_process.txt GGSCI (gg.orcl.com) 2> shell cat /u01/app/oracle/product/ogg_src/info_process.txt info extract extint info extract dpint |
The above two files OBEY files and we called info_process.txt file into stats_process.txt file
Now run the stats_process.txt file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
GGSCI (gg.orcl.com) 3> obey /u01/app/oracle/product/ogg_src/stats_process.txt GGSCI (gg.orcl.com) 4> status manager Manager is running (IP port TCP:gg.orcl.com.7811, Process ID 30982). GGSCI (gg.orcl.com) 5> stats extint Sending STATS request to EXTRACT EXTINT ... No active extraction maps. DDL replication statistics (for all trails): *** Total statistics since extract started *** Operations 0.00 Mapped operations 0.00 Unmapped operations 0.00 Other operations 0.00 Excluded operations 0.00 GGSCI (gg.orcl.com) 6> stats dpint Sending STATS request to EXTRACT DPINT ... No active extraction maps. GGSCI (gg.orcl.com) 7> allownested Nested OBEY scripts allowed. GGSCI (gg.orcl.com) 8> obey ./info_process.txt **** Halting script [/u01/app/oracle/product/ogg_src/stats_process.txt], starting script [./info_process.txt]... GGSCI (gg.orcl.com) 9> info extract extint EXTRACT EXTINT Last Started 2019-12-19 16:57 Status RUNNING Checkpoint Lag 00:00:09 (updated 00:00:00 ago) Process ID 30987 Log Read Checkpoint Oracle Integrated Redo Logs 2019-12-19 17:17:05 SCN 0.2291862 (2291862) GGSCI (gg.orcl.com) 10> info extract dpint EXTRACT DPINT Last Started 2019-12-19 16:57 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:06 ago) Process ID 31017 Log Read Checkpoint File /u01/app/oracle/product/ogg_src/dirdat/lt000000012 2019-12-19 16:57:47.100199 RBA 1534 GGSCI (gg.orcl.com) 11> **** Terminating script [./info_process.txt], resuming script [/u01/app/oracle/product/ogg_src/stats_process.txt]... GGSCI (gg.orcl.com) 11> |
Successfully runs both the obey files.
Note : ALLOWNESTED Should use in which the file you run first .
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
GGSCI (gg.orcl.com) 1> INFO ALL Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DPINT 00:00:00 00:00:03 EXTRACT RUNNING EXTINT 00:00:05 00:00:06 GGSCI (gg.orcl.com) 2> info credentialstore Reading from credential store: Default domain: OracleGoldenGate Alias: ggadmin@orcl_1 Userid: ggadmin@orcl_1 Alias: ggadmin_src Userid: ggadmin@orcl_1 |
Login to database
1 2 |
GGSCI (gg.orcl.com) 3> dblogin useridalias ggadmin_src Successfully logged into database. |
Now run LAG command
1 2 3 4 5 6 7 8 9 10 |
GGSCI (gg.orcl.com as ggadmin@orcl) 4> LAG EXTINT Sending GETLAG request to EXTRACT EXTINT ... Last record lag 8 seconds. GGSCI (gg.orcl.com as ggadmin@orcl) 5> LAG DPINT Sending GETLAG request to EXTRACT DPINT ... Last record lag 3 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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 (gg2.orcl.com) 3> info credentialstore Reading from credential store: Default domain: OracleGoldenGate Alias: ggadmin_trg Userid: ggadmin@orcl_2 |
Login to database
1 2 |
GGSCI (gg2.orcl.com) 4> dblogin useridalias ggadmin_trg Successfully logged into database. |
Now run LAG command for replicat process
1 2 3 4 5 6 7 8 9 |
GGSCI (gg2.orcl.com as ggadmin@orcl) 5> LAG replicat REPINT Sending GETLAG request to REPLICAT REPINT ... Last record lag 6 seconds. Low watermark lag: 1. High watermark lag: 10. Low watermark position: 2260026. High watermark position: 2292277. At EOF, no more records to process |
CLEAN UP :
- 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.
Syntax
1 |
CLEANUP EXTRACT <span class="italic">group_name</span> [, SAVE <span class="italic">count</span>] |
group_name
The name of an Extract group or a wildcard (*
) to specify multiple groups. For example, T*
cleans up all Extract groups whose names start with T.
SAVE
count
Excludes the specified number of the most recent records from the cleanup.
To cleanup EXTINT process First we need to stop that process
1 2 3 4 5 6 7 8 9 10 11 12 |
GGSCI (gg.orcl.com) 1> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DPINT 00:00:00 00:00:00 EXTRACT RUNNING EXTINT 00:00:05 00:00:04 GGSCI (gg.orcl.com) 2> stop EXTINT Sending STOP request to EXTRACT EXTINT ... Request processed. |
Noe Execute Cleanup Command and then start EXTINT process
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
GGSCI (gg.orcl.com) 3> Cleanup EXTINT Cleanup completed GGSCI (gg.orcl.com) 4> start EXTINT Sending START request to MANAGER ... EXTRACT EXTINT starting GGSCI (gg.orcl.com) 5> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DPINT 00:00:00 00:00:00 EXTRACT RUNNING EXTINT 00:00:21 00:00:03 |
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.
Syntax
1 |
KILL EXTRACT <span class="italic">group_name</span> |
Example :
1 2 3 4 5 6 7 8 9 10 11 |
GGSCI (gg.orcl.com) 6> KILL extract EXTINT Sending KILL request to MANAGER ... Killed process (8946) for EXTRACT EXTINT GGSCI (gg.orcl.com) 7> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DPINT 00:00:00 00:00:02 EXTRACT ABENDED EXTINT 00:00:09 00:00:13 |
I hope above information was very helpful.
Thank you for giving your valuable time to read the above information.If you want to be updated with all our articles send us the Invitation or Follow us :
Facebook Page: KTexperts
Ajay Kumar’s Linkedin : https://www.linkedin.com/in/ajay-kumar90/
Ajay kumar’s Facebook : https://www.facebook.com/www.ajaykumar.binnary