在OGG中跳过Oracle DB 长事务的命令
GGSCI (hostdb2) 2> SEND EXTRACT extxxx , SKIPTRANS 10.40.1122351 THREAD 1 Sending SKIPTRANS request to EXTRACT EXTXXX ... Are you sure you sure you want to skip transaction [XID 10.40.1122351, Redo Thread 1, Start Time 2015-06-05:13:03:48, SCN 3035.1404832899 (13036630576259)]? (y/n)y Sending SKIPTRANS request to EXTRACT EXTXXX ... Transaction [XID 10.40.1122351, Redo Thread 1, Start Time 2015-06-05:13:03:48, SCN 3035.1404832899 (13036630576259)] skipped. GGSCI (hostdb2) 4>
10.40.1122351这个长事务的来源:
GGSCI (hostdb2) 1> send extxxx, showtrans Sending SHOWTRANS request to EXTRACT EXTXXX ... Oldest redo log files necessary to restart Extract are: Redo Thread 1, Redo Log Sequence Number 14727, SCN 3388.1470752302 (14552819951150), RBA 429154320 Redo Thread 2, Redo Log Sequence Number 10195, SCN 3388.1471271618 (14552820470466), RBA 327736336 ------------------------------------------------------------ XID: 7.8.447821 ------>这就是事务的id。 Items: 268257 ------->注意这个数字,当send extxxx, showtrans再次执行一遍时,该值在不断减小,这说明extxxx进程在干活。 Extract: EXTXXX Redo Thread: 1 Start Time: 2015-11-24:02:00:13 SCN: 3388.1470752302 (14552819951150) Redo Seq: 14727 Redo RBA: 429154320 Status: Running --->>>>>>额外注意:Select * from gv$transaction where xidusn=7 and XIDSLOT =8 and XIDSQN =447821;居然查不到记录。 --->>>>>>额外注意:死事务查询(如下)也查询不到死事务: --->>>>>> select ktuxeusn USN, ktuxeslt Slot, ktuxesqn Seq, ktuxesta State, ktuxesiz Undo --->>>>>> from x$ktuxe --->>>>>> where ktuxesta <> 'INACTIVE' and ktuxecfl like '%DEAD%' order by ktuxesiz asc; ------------------------------------------------------------ XID: 23.11.535573 Items: 0 Extract: EXTXXX Redo Thread: 2 Start Time: 2015-11-24:08:37:32 SCN: 3388.1475780146 (14552824978994) Redo Seq: 10215 Redo RBA: 189050896 Status: Running
最后,有人会问,你这样跳过事务,那复制就不完整了啊。其实,针对这一点,我认为复制还是完整的(即:数据复制是完整的)
1. Select * from gv$transaction where xidusn=7 and XIDSLOT =8 and XIDSQN =447821;居然查不到记录。
从这一点来说,2个db实例中均没有此事务的记录。
---引出了另外一点,db实例中都没有该事务,你用ogg命令的查询为啥能查到?---我猜测是ogg的命令可能借助了OGG的BR。
2.如下命令的结果 GGSCI (hostdb2) 1> send extxxx, status Sending STATUS request to EXTRACT EXTXXX ... EXTRACT EXTXXX (PID 23683) Current status: Recovery complete: Processing data with empty data queue--->注意此处的空队列。 Current read positions: Redo thread #: 1 Sequence #: 14736 RBA: 119375680 Timestamp: 2015-11-24 04:34:52.000000 SCN: 3388.1471781460 Redo thread #: 2 Sequence #: 10214 RBA: 381925240 Timestamp: 2015-11-24 05:00:17.000000 SCN: 3388.1471790456 Current write position: Sequence #: 268963 RBA: 5568905 Timestamp: 2015-11-26 09:20:12.756297 Extract Trail: /u02/ggs/dirdat/aa