Tuesday, December 26, 2017

How to find lag in golden gate Process

In golden gate we have usually face the problem for lag  could be generated based  from source side and network side and target side.

1.source side lag it's from extract lag
2.source side lag because of network issue/slow
3.target  side lag or replicat lag

Here is the method to find out the lag in golden gate from replicat side.

GGSCI (server_name) 1> send replicat REP3,getlag

Sending GETLAG request to REPLICAT LHGRP3 ...

At EOF, no more records to process.



GGSCI (server_name) 3> lag REPLICAT RP3

Sending GETLAG request to REPLICAT LHGRP3 ...


At EOF, no more records to process

How to check which Trail file Golden gate reading for replicat and RBA?

we can check the where the GG reads from the trail file using the below method.

step-1

using the info command find the current RBA where replicat its running
GGSCI (server_name) 1> info rep5

REPLICAT   LHGRP5    Last Started 2017-12-18 17:07   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:08 ago)
Log Read Checkpoint  File/dat/rt000043
                     2017-12-19 18:56:35.389347  RBA 6796391


GGSCI (server_name) 2> exit
step-2
open the logdump utility to check the latest trail file where GG writting and move the position to end using :POS EOF and not down the RBA,if both RBA matches then we can confirm that GG completed  the reading of trail file and it reached the end of the trail file with NO more records to process.
[ggsmgr@server_name]:/home8>logdump

Oracle GoldenGate Log File Dump Utility
Version 11.1.1.0.11 Build 001

Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.



Logdump 1 >/dat/rt000043
Current LogTrail is /dat/rt000043
Logdump 2 >pos eof
Reading forward from RBA 6796391

Wednesday, December 13, 2017

Error when adding the partition on oracle database table ORA-14074:

issue:
when adding the partition got the below error.

SQL> ALTER TABLE user1.test_table  ADD PARTITION "HMS_20180101" VALUES LESS THAN (TIMESTAMP '2018-01-01 00:00:00') TABLESPACE "user1";
ALTER TABLE user1.test_table  ADD PARTITION "HMS_20180101" VALUES LESS THAN (TIMESTAMP '2018-01-01 00:00:00') TABLESPACE "user1"
                                                           *
ERROR at line 1:
ORA-14074: partition bound must collate higher than that of the last partition

Root cause:
when we tried to add partition ,but the partition & partition range already exist on the same table,it will throw the error

Solution:
make sure to check the partition name & partition range and add the next partition appropriately

select partition_name from dba_tab_partitions where table_name='<> and table_owner="USR";