天天看點

OGG DDL 操作詳解

DLL說明

從OGG 12c 開始,提供了2種DDL方式:

(1)trigger-based DDL capture:通過資料庫級别的觸發器來捕獲。

(2)native DDL capture:也叫:triggerless DDLcapture模式,在

Source 端進行logmining。

具體的規則如下:

(1)Extract 使用的是integrated 模式,但是資料庫是11.2.0.4 之前的,

那麼必須使用trigger-based DDL capture。

(2)Extract 使用的是classic capture 模式,不管資料庫是什麼版本,都 

必須使用trigger-based DDL capture。因為Native DDL capture不

支援classic capture 模式。

(3)Extract是integrated模式,資料庫版本大于等于11.2.0.4,那麼必須

使用native DDL capture。 這種模式也叫triggerless DDL capture。

DLL語句長度限制

OGG使用byte為機關來計算DDL語句的長度,在12c中,最大支援4MB的DDL語句。如果DDL的長度超過4MB,那麼Extract會發出警告并且忽略這個DDL操作。

檢視異常資訊

一般使用VIEW REPORTGROUPNAME

檢視Replicat的DDL報告

Replicat 報告包含如下資訊:

(1)Source 端每個DDL 操作的文法和SCN 值。

(2)DDL 條目的MAPPED, UNMAPPED 等資訊。

(3)其他記錄處理過程的條目。

(4)附加的條目,記錄操作是成功還是失敗。

2013-01-20 15:11:45 GGS INFO 2104 DDL found, operation [drop table myTableTemp ], Source SCN [1186713.0].                

2013-01-20 15:11:45 GGS INFO 2100 DDL is of mapped scope, after mapping new operation [drop table "QATEST2"."MYTABLETEMP" ].                

2013-01-20 15:11:45 GGS INFO 2100 DDL operation included [include objname myTable*], optype [DROP], objtype [TABLE], objname                 

[QATEST2.MYTABLETEMP].                

2013-01-20 15:11:45 GGS INFO 2100 Executing DDL operation.                

2013-01-20 15:11:48 GGS INFO 2105 DDL error ignored for next retry: error code [942], filter [include objname myTableTemp],                 

error text [ORA-00942: table or view does not exist], retry [1].                

2013-01-20 15:11:48 GGS INFO 2100 Executing DDL operation , trying again due to RETRYOP parameter.                

2013-01-20 15:11:51 GGS INFO 2105 DDL error ignored for next retry: error code [942], filter [include objname myTableTemp],                 

error text [ORA-00942: table or view does not exist], retry [2].                

2013-01-20 15:11:51 GGS INFO 2100 Executing DDL operation, trying again due to RETRYOP parameter.                

2013-01-20 15:11:54 GGS INFO 2105 DDL error ignored for next retry: error code [942], filter [include objname myTableTemp],                 

error text [ORA-00942: table or view does not exist], retry [3].                

2013-01-20 15:11:54 GGS INFO 2100 Executing DDL operation, trying again due to RETRYOP parameter.                

2013-01-20 15:11:54 GGS INFO 2105 DDL error ignored: error code [942], filter [include objname myTableTemp], error                 

text [ORA-00942:table or view does not exist].                

檢視Extract的DDL報告

Extract report 包含如下資訊:

 (1) Capture DDL 操作的條目文法,開始和結束的SCN值, oracle 執行個體,DDL sequence number(從 

history table的SEQNO 列查詢)和 操作的大小(機關byte)。

 (2) 記錄應用操作的子條目,如INCLUDE 和 EXCLUDE filtering。

 (3) 其他的條目,記錄操作是否寫入trail 。

2013-01-20 15:11:41 GGS INFO 2100 DDL found, operation [create table myTable                 

(                

myId number (10) not null,                

myNumber number,                

myString varchar2(100),                

myDate date,                

primary key (myId)                

) ], start SCN [1186754], commit SCN [1186772] instance [test11g (1)], DDL seqno [4134].                

2013-01-20 15:11:41 GGS INFO 2100 DDL operation included [INCLUDE OBJNAME myTable*], optype [CREATE], objtype [TABLE], objname                

 [QATEST1.MYTABLE].                

2013-01-20 15:11:41 GGS INFO 2100 DDL operation written to extract trail file.                

2013-01-20 15:11:42 GGS INFO 2100 Successfully added TRAN DATA for table with the key, table [QATEST1.MYTABLE], operation [ALTER TABLE                

 "QATEST1"."MYTABLE" ADD SUPPLEMENTAL LOG GROUP "GGS_MYTABLE_53475" (MYID) ALWAYS ].                

2013-01-20 15:11:43 GGS INFO 2100 DDL found, operation [create table myTableTemp (vid varchar2(100),someDate date,primary key (vid)                

) ], start SCN [1186777], commit SCN [1186795] instance [test11g (1)], DDL seqno [4137].                

2013-01- 20 15:11:43 GGS INFO 2100 DDL operation excluded [EXCLUDE OBJNAME myTableTemp OPTYPE CREATE], optype [CREATE], objtype                 

[TABLE],objname [QATEST1.MYTABLETEMP].                

檢視處理報告的統計資訊

  可以使用如下指令來檢視DDL 處理過程的統計資訊,該指令可以檢視Extract和Replicat的報告:

SEND {EXTRACT | REPLICAT} group REPORT