Sunday, 26 May 2013

Re-Extract scenario in golden gate

Re-Extracting Scenario in Golden gate



Scenario.
1) One extract process which extract the details for 2 tables.
2) One Pump process been configured in the source.
3) Two replicat process on the target.

-- The pump process in the source has been configured to pump for only one table, and that table
is in sync now..
Test case--> The second table which is in the extract process but not added in the pump process
hence we need to reextract data and pump the details of the second table as well.

   --> Stop the pump process on the source.
GGSCI (rhel11gr2rac1.manzoor.com) 3> stop pgrp1
Sending STOP request to EXTRACT PGRP1 ...
Request processed.

   --> Stop all the replicat process on the target --( Since we have the same pump for all the replicat process so we need to stop the replicate to avoid the data corruption issue)
  

-- Check the currnet rba for all the other replicates, beacuse up to this rba this replicate has been processed the
transactions, hence we need to start the replicat after this.
GGSCI (rhel11gr2rac2.manzoor.com) 2> send rgrp1 status
Sending STATUS request to REPLICAT RGRP1 ...
  Current status: At EOF
  Sequence #: 9
  RBA: 16760430
  0 records in current transaction

GGSCI (rhel11gr2rac2.manzoor.com) 3> send rgrp1 logend
Sending LOGEND request to REPLICAT RGRP1 ...
YES.

GGSCI (rhel11gr2rac2.manzoor.com) 13> stop replicat RGRP1
Sending STOP request to REPLICAT RGRP1 ...
Request processed.

GGSCI (rhel11gr2rac2.manzoor.com) 4> stop replicat RGRP2
Sending STOP request to REPLICAT RGRP2 ...
Request processed.


--> We need to identify from where to re extract and pump
    -- in target we will open the trail file and find from where to re extract

Logdump 225 >open ./dirdat/fg000009
Current LogTrail is /golden_gate/dirdat/fg000009
Logdump 226 >ghdr on
Logdump 227 >detail on
Logdump 228 >detail data
Logdump 229 >pos 0
Reading forward from RBA 0
Logdump 233 >n
___________________________________________________________________
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)
RecLength  :    54  (x0036)   IO Time    : 2013/05/25 18:59:37.062.868
IOType     :     5  (x05)     OrigNode   :   255  (xff)
TransInd   :     .  (x03)     FormatType :     R  (x52)
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)
AuditRBA   :        113       AuditPos   : 224964
Continued  :     N  (x00)     RecCount   :     1  (x01)
2013/05/25 18:59:37.062.868 Insert               Len    54 RBA 1314
Name: MANZOOR.EMP
After  Image:                                             Partition 4   G  s
 0000 000a 0000 0006 3130 3030 3031 0001 0008 0000 | ........100001......
 0004 5465 7374 0002 000a 0000 0006 3130 3030 3031 | ..Test........100001
 0003 000a 0000 0006 3130 3030 3031                | ........100001
Column     0 (x0000), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001
Column     1 (x0001), Len     8 (x0008)
 0000 0004 5465 7374                               | ....Test
Column     2 (x0002), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001
Column     3 (x0003), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001


---> Since its a test case we can identify that above is the first record
not dows then auditpos -- 224964

-- Now go to source and find the rba for this auditpos 224964
-- We need to find out in which trail the auditpos start, lets start with the last two.
Logdump 125 >open ./dirdat/fg000065
Current LogTrail is /golden_gate/dirdat/fg000065
Logdump 116 >ghdr on
Logdump 117 >detail on
Logdump 118 >detail data
Logdump 119 >fileheader on
Logdump 120 >filter include auditrba 224964
Logdump 121 >show filter
Data filters are ENABLED
Include  Match ANY
 AuditRba   : =  224964 (x0000000000036ec4)
Exclude  Match ANY
Logdump 126 >n
___________________________________________________________________
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)
RecLength  :    54  (x0036)   IO Time    : 2013/05/25 18:59:37.000.000
IOType     :     5  (x05)     OrigNode   :   255  (xff)
TransInd   :     .  (x00)     FormatType :     R  (x52)
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)
AuditRBA   :        113       AuditPos   : 224964
Continued  :     N  (x00)     RecCount   :     1  (x01)
2013/05/25 18:59:37.000.000 Insert               Len    54 RBA 1106
Name: MANZOOR.EMP
After  Image:                                             Partition 4   G  b
 0000 000a 0000 0006 3130 3030 3031 0001 0008 0000 | ........100001......
 0004 5465 7374 0002 000a 0000 0006 3130 3030 3031 | ..Test........100001
 0003 000a 0000 0006 3130 3030 3031                | ........100001
Column     0 (x0000), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001
Column     1 (x0001), Len     8 (x0008)
 0000 0004 5465 7374                               | ....Test
Column     2 (x0002), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001
Column     3 (x0003), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001

Filtering suppressed      2 records

--> We have found the record --- node down the rba -- 1106 , we need re extract pump from this rba.

--> Now inlcude the table in the pump process
extract pgrp1
userid ggate@source, password ggate
rmthost 192.168.0.21, mgrport 7809
rmttrail ./dirdat/fg
passthru
table manzoor.emp;
table manzoor.emp1;


--ALTER EXTRACT PGRP1, EXTSEQNO 65, EXTRBA 1106
--ALTER EXTRACT PGRP1, ETROLLOVER

GGSCI (rhel11gr2rac1.manzoor.com) 7> ALTER EXTRACT PGRP1, ETROLLOVER
2013-05-25 20:37:43  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract,
issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.
EXTRACT altered.

GGSCI (rhel11gr2rac1.manzoor.com) 8> ALTER EXTRACT PGRP1, EXTSEQNO 65, EXTRBA 1106
EXTRACT altered.

GGSCI (rhel11gr2rac1.manzoor.com) 2> start extract p*
Sending START request to MANAGER ...
EXTRACT PGRP1 starting

GGSCI (rhel11gr2rac1.manzoor.com) 3> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING
EXTRACT     RUNNING     PGRP1       00:00:00      00:04:08
EXTRACT     RUNNING     XGRP1       00:00:00      00:00:08



Target

Now in target check whether the 2nd table data are reflected in the trail.

Logdump 365 >open ./dirdat/fg000012
Current LogTrail is /golden_gate/dirdat/fg000012
Logdump 366 >ghdr on
Logdump 367 >detail on
Logdump 368 >detail data
Logdump 369 >pos 0
Logdump 370 > n

Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)
RecLength  :    54  (x0036)   IO Time    : 2013/05/25 18:59:36.997.462
IOType     :     5  (x05)     OrigNode   :   255  (xff)
TransInd   :     .  (x02)     FormatType :     R  (x52)
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)
AuditRBA   :        113       AuditPos   : 227352
Continued  :     N  (x00)     RecCount   :     1  (x01)
2013/05/25 18:59:36.997.462 Insert               Len    54 RBA 1265
Name: MANZOOR.EMP1
After  Image:                                             Partition 4   G  e
 0000 000a 0000 0006 3130 3030 3031 0001 0008 0000 | ........100001......
 0004 5465 7374 0002 000a 0000 0006 3130 3030 3031 | ..Test........100001
 0003 000a 0000 0006 3130 3030 3031                | ........100001
Column     0 (x0000), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001
Column     1 (x0001), Len     8 (x0008)
 0000 0004 5465 7374                               | ....Test
Column     2 (x0002), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001
Column     3 (x0003), Len    10 (x000a)
 0000 0006 3130 3030 3031                          | ....100001

--- Yes now the second table data is reflected in the trail file

GGSCI (rhel11gr2rac2.manzoor.com) 1> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING
REPLICAT    STOPPED     RGRP1       00:00:00      01:10:19
REPLICAT    STOPPED     RGRP2       00:00:00      01:45:25


-- Now alter the first replict to start from when its completed earlier.
16760262

GGSCI (rhel11gr2rac2.manzoor.com) 2> send rgrp1 status
Sending STATUS request to REPLICAT RGRP1 ...
  Current status: At EOF
  Sequence #: 9
  RBA: 16760430
  0 records in current transaction

---
Below is the report file of the RGRP1 group.
Last record for the last committed transaction is the following:
___________________________________________________________________
Trail name :  ./dirdat/fg000009
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)
RecLength  :    54 (x0036)    IO Time    : 2013-05-25 18:59:56.995530
IOType     :     5  (x05)     OrigNode   :   255  (xff)
TransInd   :     .  (x03)     FormatType :     R  (x52)
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)
AuditRBA   :        115       AuditPos   : 48669052
Continued  :     N  (x00)     RecCount   :     1  (x01)
2013-05-25 18:59:56.995530 Insert             Len    54 RBA 16760262
Name: MANZOOR.EMP
___________________________________________________________________
Reading ./dirdat/fg000009, current RBA 16760430, 200000 records
Report at 2013-05-25 19:57:24 (activity since 2013-05-25 18:49:12)

===== Need to know the scn for the last transaction up to which we have already completed for the 1st transaction.

Logdump 777 >open ./dirdat/fg000009
Current LogTrail is /golden_gate/dirdat/fg000009
Logdump 778 >ghdr on
Logdump 779 >detail on
Logdump 780 >detail data
Logdump 781 >pos 16760262
Reading forward from RBA 16760262
Logdump 782 >ggstoken on
Logdump 783 >ggstoken detail
Logdump 784 >n
___________________________________________________________________
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)
RecLength  :    54  (x0036)   IO Time    : 2013/05/25 18:59:56.995.530
IOType     :     5  (x05)     OrigNode   :   255  (xff)
TransInd   :     .  (x03)     FormatType :     R  (x52)
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)
AuditRBA   :        115       AuditPos   : 48669052
Continued  :     N  (x00)     RecCount   :     1  (x01)
2013/05/25 18:59:56.995.530 Insert               Len    54 RBA 16760262
Name: MANZOOR.EMP
After  Image:                                             Partition 4   G  s
 0000 000a 0000 0006 3230 3030 3030 0001 0008 0000 | ........200000......
 0004 5465 7374 0002 000a 0000 0006 3230 3030 3030 | ..Test........200000
 0003 000a 0000 0006 3230 3030 3030                | ........200000
Column     0 (x0000), Len    10 (x000a)
 0000 0006 3230 3030 3030                          | ....200000
Column     1 (x0001), Len     8 (x0008)
 0000 0004 5465 7374                               | ....Test
Column     2 (x0002), Len    10 (x000a)
 0000 0006 3230 3030 3030                          | ....200000
Column     3 (x0003), Len    10 (x000a)
 0000 0006 3230 3030 3030                          | ....200000
GGS tokens:
TokenID x52 'R' ORAROWID         Info x00  Length   20
 4141 4153 6859 4141 4641 4141 416e 6441 4271 0001 | AAAShYAAFAAAAndABq..
TokenID x4c 'L' LOGCSN           Info x00  Length    7
 3139 3637 3336 36                                 | 1967366
TokenID x36 '6' TRANID           Info x00  Length    9
 362e 3232 2e31 3532 38                            | 6.22.1528


== The scn no is 1967366 , hence we need to start the
alter replicat RGRP1, extseqno 09 extrba 0
start replicat RGRP1 aftercsn 1967366

== Now we need to start the 2 nd replicat.
alter replicat RGRP2 EXTSEQNO 12 EXTRBA 0
start replicat rgrp2

=======================


No comments:

Post a Comment