Tuesday, November 1, 2016

Oracle GoldenGate - LOG dump utility


Login to Source Database (ORCL) as a user ‘scott’

SQL> connect scott/oracle@orcl
Connected

SQL> insert into dept values (75,'SQL SERVER','NY');
1 row created.

SQL> insert into dept values (76,'IBM DB2','NJ');
1 row created.

SQL> insert into dept values (77,'SYBASE','VA');
1 row created.

SQL> commit;
Commit complete.

SQL> select * from dept;

DEPTNO  DNAME            LOC
----------  --------------   ----------
75   SQL SERVER       NY
76   IBM DB2          NJ
77   SYBASE           VA

3 rows selected.

Login to GGSCI from Source database:

[oracle@linux66-ggs-11g-12c ~]$ source 11g.env
[oracle@linux66-ggs-11g-12c ~]$ cd $GG
[oracle@linux66-ggs-11g-12c 11g]$ ./logdump

Oracle GoldenGate Log File Dump Utility for Oracle
Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.

Logdump 89 >open dirdat/lt000007
Current LogTrail is /u01/app/ogg/11g/dirdat/lt000007

Logdump 90 >pos 0
Reading forward from RBA 0
Logdump 91 >detail data
Logdump 92 >ghdr on
Logdump 93 >filter include filename SCOTT.DEPT;filter string "VA";filter match all
Logdump 94 >n


Search-1: Finding one more transaction using the string “NJ” Logdump 95 >filter include filename SCOTT.DEPT;filter string "NJ";filter match all Logdump 96 >n Note: Make it Position “0” and search again Logdump 97 >pos 0 Reading forward from RBA 0 Logdump 98 >filter include filename SCOTT.DEPT;filter string "NJ";filter match all Logdump 99 >n
Search-2: Find the transaction using the HEX decimal using “DEPT ID” coulmn (Dept ID : 77 and convert into HEX using calc utility) Logdump 105 >pos 0 Reading forward from RBA 0 Logdump 106 >filter clear Logdump 107 >filter filename SCOTT.DEPT; filter HEX "4D"; filter match all Logdump 108 >n
Logdump 109>n
Logdump 110>filter clear Note: Find the transaction using all the trail files Logdump 115 >ghdr on Logdump 116 >detail on Logdump 117 >filter filename SCOTT.DEPT; filter HEX "4D"; filter string "SYBASE"; filter match all Logdump 118 >count log /u01/app/ogg/11g/dirdat/lt* Current LogTrail is /u01/app/ogg/11g/dirdat/lt000003 LogTrail /u01/app/ogg/11g/dirdat/lt000003 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000003 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000001 LogTrail /u01/app/ogg/11g/dirdat/lt000001 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000001 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000005 LogTrail /u01/app/ogg/11g/dirdat/lt000005 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000005 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000007 LogTrail /u01/app/ogg/11g/dirdat/lt000007 has 1 records LogTrail /u01/app/ogg/11g/dirdat/lt000007 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000006 LogTrail /u01/app/ogg/11g/dirdat/lt000006 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000006 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000002 LogTrail /u01/app/ogg/11g/dirdat/lt000002 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000002 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000000 LogTrail /u01/app/ogg/11g/dirdat/lt000000 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000000 closed Current LogTrail is /u01/app/ogg/11g/dirdat/lt000004 LogTrail /u01/app/ogg/11g/dirdat/lt000004 has 0 records LogTrail /u01/app/ogg/11g/dirdat/lt000004 closed LogTrail /u01/app/ogg/11g/dirdat/lt* has 1 records Total Data Bytes 38 Avg Bytes/Record 38 Insert 1 After Images 1 Filtering matched 1 records suppressed 25 records Average of 1 Transactions Bytes/Trans ..... 86 Records/Trans ... 1 Files/Trans ..... 1 SCOTT.DEPT Partition 4 Total Data Bytes 38 Avg Bytes/Record 38 Insert 1 After Images 1 Login to Target Database (ORCLDB) as a user ‘scott’ SQL> connect scott/oracle@orcl Connected SQL> select * from dept; DEPTNO DNAME LOC ---------- -------------- ---------- 75 SQL SERVER NY 76 IBM DB2 NJ 77 SYBASE VA 3 rows selected. Login to GGSCI from Target database: [oracle@linux66-ggs-11g-12c ~]$ source 11g.env [oracle@linux66-ggs-11g-12c ~]$ cd $GG [oracle@linux66-ggs-11g-12c 11g]$ ./logdump Oracle GoldenGate Log File Dump Utility for Oracle Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1 Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved. Logdump 89 >open dirdat/lt000007 Current LogTrail is /u01/app/ogg/11g/dirdat/lt000007 Logdump 90 >pos 0 Reading forward from RBA 0 Logdump 91 >detail data Logdump 92 >ghdr on Logdump 93 >filter include filename SCOTT.DEPT;filter string "VA";filter match all Logdump 94 >n Finding one more transaction Logdump 95 >filter include filename SCOTT.DEPT;filter string "NJ";filter match all Logdump 96 >n Logdump 97 >pos 0 Reading forward from RBA 0 Logdump 98 >filter include filename SCOTT.DEPT;filter string "NJ";filter match all Logdump 99 >n

1 comment: