Goldengate DDL复制相关注意事项
Goldengate DDL復制相關注意事項
1.Goldengate DDL復制概述
a.Goldengate開啟DDL復制后,不需要對原有的表和以后新加的表執行add trandata操作
這一點根據經驗得出。
b.目標端默認支持DDL復制,故目標端Replicat進程參數文件中不需要添加DDL語句,當然源端Data Pump進程參數文件中也不需要加DDL相關的參數
這一點來源于《GGS_Fund_10.4_WinUX.ppt》
Source: DDL disabled by default; Extract must be configured to enable.
Target: DDL enabled by default to maintain data integrity
c.開啟DDL復制后,目標端Replicat進程參數文件中必須配置忽略或者過濾DDLERROR的參數
rep_ta.prm
ddlerror default ignore retryop
這一點來源于《GGS_Fund_10.4_WinUX.ppt》
Replicat must be configured to ignore or filter DDL
并剽竊Gavin Soorma's blog中的一篇文章,摘錄部分
So if we issue this DROP USER statement on the source, we will see that the replicat process on the target has abended and this is the error we will see in the report
SQL> drop user abc;
User dropped.
2010-07-10 17:20:13 GGS ERROR 2001 Fatal error executing DDL replication: error [Error code [1031], ORA-01031: insufficient privileges, SQL drop user abc /* GOLDENGATE_DDL_REPLICATION */], no error handler present.
The following DDL statements were issued on source
原文地址:http://gavinsoorma.com/2010/07/goldengate-ddl-synchronization-some-more-examples/
d.Goldengate數據庫(dblogin userid xxx)用戶和Oracle數據庫自帶的用戶的DDL操作將不會被復制
關于Goldengate DDL復制支持的用戶及對象,將在隨后討論,因為也不是一句兩句能說清除的。
e.當開啟Full DDL(可能是ALL Scope)支持時,不要在參數文件中使用GETTRUNCATES參數
這一點不是很理解,知情的朋友可以留言告知。
f.默認情況下ALTER DATABASE、ALTER SYSTEM不會被復制
這一點還是參考《GGS_Fund_10.4_WinUX.ppt》DDL部分
2.Goldengate支持DDL復制的Oracle數據庫對象
clusters、functions、indexes、packages、procedures、roles、sequences、synonyms、tables、tablespaces、triggers、types、views、materialized views、users
上面列出的對象在復制時,是有限的支持,詳細情況會在隨后的博文中探討。
3.DDL語句包含的主要內容及語法
●?scope
● object type
● operation type
● object name
● strings in the DDL command syntax or comments, or both
這里重點是scope和object name這兩項內容,后面會詳細講這兩個參數。
Syntax
DDL [
{INCLUDE | EXCLUDE}
[, MAPPED | UNMAPPED | OTHER | ALL]
[, OPTYPE <type>]
[, OBJTYPE ‘<type>’]
[, OBJNAME “<name>”]
[, INSTR ‘<string>’]
[, INSTRCOMMENTS ‘<comment_string>’]
]
[...]
4.DDL語句的4個Scope
對應上面DDL語法總的[, MAPPED | UNMAPPED | OTHER | ALL]
這是DDL同步中非常重要的一點,剛開始開啟DDL復制的人在沒看文檔時,只使用MAPPED Scope或者只在主抽取進程中加那么一句ddl include all,實屬不太科學的做法,下面就把官方文檔中的關于這4個Scope的解釋撿重點的列舉出來。
MAPPED Scope支持同步的DDL操作和數據庫對象
對TABLE、MAP語句指定的內容有效
DDL Operations CREATE, ALTER, DROP, RENAME, GRANT*, REVOKE*
Oracle DataBase Objects TABLE*, INDEX, TRIGGER, SEQUENCE*,? MATERIALIZED VIEW*
UNMAPPED
與上面相反,對TABLE、MAP語句指定的內容無效
OTHER
TABLE or MAP statements do not apply
DDL operations other than those listed above
Examples are CREATE USER, CREATE ROLE, ALTER TABLESPACE
這個沒試過,應該沒有ALL Scope的范圍大
ALL
文檔中沒有該Scope解釋的內容,Reference中只有一句對該Scope的解釋
ALL applies INCLUDE or EXCLUDE to DDL operations of all scopes
不過從字面意思看來,ALL Scope要比上面3個所包含的范圍廣。
5.DDL語句格式及注意事項
當你需要同步除Goldengate和Oracle數據庫自帶的用戶外所有用戶的DDL操作時,可在源端主抽取進程中加入下面的內容
ddl include all
然后再在目標端Replicat進程參數文件中加入DDL錯誤的處理語句即可。
一個參數文件中只能包含一條DDL開頭的語句,當你需要指定幾個Oracle數據庫用戶時(還不能包括Goldengate和Oracle數據庫自帶的用戶),或者多個INCLUDE、EXCLUDE語句時,可在使用組合的方式來書寫
Only one DDL parameter can be used in a parameter file, but you can combine multiple
inclusion and exclusion options to filter the DDL to the required level.
● When combined, multiple option specifications are linked logically as AND statements.
● All criteria specified with multiple options must be satisfied for a DDL statement to be
replicated.
● When using complex DDL filtering criteria, it is recommended that you test your
configuration in a test environment before using it in production.
第一點中提到了,使用"&"符號來組合這些語句,如下示例:
ddl &
include all objname "oggsa.*" &
include all objname "oggsb.*" &
exclude "oggsc.*"
還可以使用下面的這種加","的書寫方式
ddl include all objname "oggsa.*", include all objname "oggsc.*"
Reference中還有一種只用空格隔開的,應該跟"&"差不多,看著不太清爽,想用的朋友自己用吧。
ddl include objname “fin.*” exclude “fin.ss”
歡迎大家繼續補充。
原創文章,轉載請注明:?轉載自tdy218's blog
總結
以上是生活随笔為你收集整理的Goldengate DDL复制相关注意事项的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ORA-00060 Deadlock d
- 下一篇: remote_os_authent参数测