Oracle goldengate 11g (二)【DML and DDL單向複製】
Oracle goldengate 11g (二)【DML and DDL單向複製】
實驗環境,oracle goldengate 安裝,僅開啟DML:請看
Oracle goldengate 11g (一)【DML單向複製】
http://space.itpub.net/26442936/viewspace-764272
實驗整體思路
一、 停止所有extract、replicat程式
二、 Oracle 資料庫準備
三、 新增DDL所需引數
四、 Oracle goldengate DDL 測試
一、停止所有extract、replicat程式
Source database
GGSCI (doudou-NAS) 4> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED EXT1 00:00:00 00:00:15
EXTRACT STOPPED PUMP1 00:00:00 00:00:14
Target database
GGSCI (localhost.localdomain) 4> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
REPLICAT STOPPED REP1 00:00:00 00:00:15
二、Oracle 資料庫準備
SQL> conn /as sysdba
Connected.
SQL> @marker_setup.sql
Marker setup script
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name:ogg
Marker setup table script. complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to OGG
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
Script. complete.
SQL> @ddl_setup.sql
Oracle GoldenGate DDL Replication setup script
Verifying that current user has privileges to install DDL Replication...
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name:ogg
Working, please wait ...
Spooling to file ddl_setup_spool.txt
Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...
Check complete.
Using OGG as a Oracle GoldenGate schema name.
Working, please wait ...
DDL replication setup script. complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to OGG
CLEAR_TRACE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
CREATE_TRACE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
TRACE_PUT_LINE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
INITIAL_SETUP STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDLVERSIONSPECIFIC PACKAGE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDLREPLICATION PACKAGE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDLREPLICATION PACKAGE BODY STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDL IGNORE TABLE
-----------------------------------
OK
DDL IGNORE LOG TABLE
-----------------------------------
OK
DDLAUX PACKAGE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDLAUX PACKAGE BODY STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
SYS.DDLCTXINFO PACKAGE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
SYS.DDLCTXINFO PACKAGE BODY STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDL HISTORY TABLE
-----------------------------------
OK
DDL HISTORY TABLE(1)
-----------------------------------
OK
DDL DUMP TABLES
-----------------------------------
OK
DDL DUMP COLUMNS
-----------------------------------
OK
DDL DUMP LOG GROUPS
-----------------------------------
OK
DDL DUMP PARTITIONS
-----------------------------------
OK
DDL DUMP PRIMARY KEYS
-----------------------------------
OK
DDL SEQUENCE
-----------------------------------
OK
GGS_TEMP_COLS
-----------------------------------
OK
GGS_TEMP_UK
-----------------------------------
OK
DDL TRIGGER CODE STATUS:
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
No errors No errors
DDL TRIGGER INSTALL STATUS
-----------------------------------
OK
DDL TRIGGER RUNNING STATUS
------------------------------------------------------------------------------------------------------------------------
ENABLED
STAYMETADATA IN TRIGGER
------------------------------------------------------------------------------------------------------------------------
OFF
DDL TRIGGER SQL TRACING
------------------------------------------------------------------------------------------------------------------------
0
DDL TRIGGER TRACE LEVEL
------------------------------------------------------------------------------------------------------------------------
0
LOCATION OF DDL TRACE FILE
------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/doudou/doudou/trace/ggs_ddl_trace.log
Analyzing installation status...
STATUS OF DDL REPLICATION
------------------------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components
Script. complete.
SQL> @role_setup.sql
GGS Role setup script
This script. will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script. and then edit the params.sql script. to change the gg_role parameter to the preferred name. (Do not run the script.)
You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter GoldenGate schema name:ogg
Wrote file role_setup_set.txt
PL/SQL procedure successfully completed.
Role setup script. complete
Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:
GRANT
GGS_GGSUSER_ROLE TO
where
SQL> GRANT GGS_GGSUSER_ROLE TO ogg;
Grant succeeded.
SQL> @ddl_enable --開啟DDL功能
Trigger altered.
SQL> @marker_status.sql --校驗DDL狀態
Please enter the name of a schema for the GoldenGate database objects:
ogg
Setting schema name to OGG
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
三、新增DDL所需引數
3-1、Add ddl support to the extract process
GGSCI (doudou-NAS) 8> view params ext1
extract ext1
userid ogg,password oracle
exttrail /opt/ogg/dirdat/tt
TRANLOGOPTIONS asmuser sys@asm,asmpassword oracle
DDL INCLUDE ALL
DDLOPTIONS ADDTRANDATA
table doudou.*;
3-2、Add ddl support to the replicat process
GGSCI (localhost.localdomain) 17> edit params rep1
replicat rep1
userid ogg ,password oracle
assumetargetdefs
dynamicresolution
DISCARDFILE ./dirrpt/rhr.dsc, append, megabytes 100
DDLERROR DEFAULT IGNORE
map doudou.*,target doudou.*;
GGSCI (doudou-NAS) 18> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:00:00 00:00:04
EXTRACT RUNNING PUMP1 00:00:00 00:00:01
GGSCI (localhost.localdomain) 19> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:02
到此Oracle goldengate DDL安裝結束
四、Oracle goldengate DDL 測試
Source database
SQL> select * from test;
NAME
------------------------------------------------------------------------------------------------------------------------
ID
----------
兜兜
1
Target database
SQL> select * from test;
NAME
------------------------------------------------------------------------------------------------------------------------
ID
----------
兜兜
1
Source database
SQL> truncate table test;
Table truncated.
SQL> commit;
Commit complete.
SQL> select * from test;
no rows selected
Target database
SQL> select * from test;
no rows selected
--DDL truncate操作,已經同步到了目標庫上
源庫:建立一個使用者xiaoqiang並建立表xiaoqiang和資料
目標庫:使用者被建立xiaoqiang和表xiaoqiang被建立,但是資料未同步
Source database
SQL> conn /as sysdba
Connected.
SQL> create user xiaoqiang identified by oracle;
User created.
SQL> grant connect,resource to xiaoqiang;
Grant succeeded.
SQL> conn xiaoqiang/oracle
Connected.
SQL> create table xiaoqiang (name varchar(200),id number);
Table created.
SQL> insert into xiaoqiang values ('小強',1);
1 row created.
SQL> commit;
Commit complete.
Target database
SQL> conn xiaoqiang/oracle
Connected.
SQL> select * from xiaoqiang;
no rows selected
--DDL create user操作已經同步到了目標庫,但是insert操作並沒有同步,因為我們並沒有配置xiaoqiang使用者的DML,這裡xiaoqiang使用者的DDL操作之所以能同步到目標庫因為我們配置了DDL INCLUDE ALL
想一想?
如果我們刪除的使用者是doudou,建立新使用者doudou並插入資料,目標庫就會使用者建立,表建立,資料填入
到此證明oracle goldengate的 DDL已經成功
總結:
Oracle goldengate DDL 成功
參考文件
https://blogs.oracle.com/imc/entry/oracle_goldengate_configuring_ddl_replication
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-764335/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11g GoldenGate單向複製配置(DML)OracleGo
- GoldenGate單向複製配置(支援DDL複製)Go
- Oracle GoldenGate10g→11g單向DDL部署OracleGo
- goldengate 單向DDLGo
- goldengate 單向複製配置Go
- goldengate配置DDL複製Go
- 通過goldengate從ORACLE向mysql的單向複製GoOracleMySql
- OGG單向DDL複製操作
- goldengate單向複製的配置Go
- oracle goldengate 雙向複製配置OracleGo
- oracle goldengate 配置DML&DDL實驗OracleGo
- 實戰goldengate:安裝配置+資料初始化+單向DML複製Go
- GoldenGate單向表DML同步Go
- 1.--Goldgate單向複製(支援DDL)Go
- 【GoldenGate】Oracle GoldenGate(一) 安裝與DML單向同步配置GoOracle
- 【OGG】Oracle GoldenGate 11g (二) GoldenGate 11g 單向同步配置 上OracleGo
- 【OGG】Oracle GoldenGate 11g (二) GoldenGate 11g 單向同步配置 下OracleGo
- oracle---oracle的單向ogg搭建流程(DML+DDL)Oracle
- Oracle使用goldengate分別向Oracle和mysql雙路的單向複製OracleGoMySql
- ogg12 oracle to oracle 雙向DDL複製Oracle
- GoldenGate配置(二)之雙向複製配置Go
- GoldenGate配置(一)之單向複製配置Go
- GoldenGate DML複製增刪改表Go
- GoldenGate配置(三)之DDL複製配置Go
- 搭建一個Oracle到Oracle的GoldenGate單向複製測試環境OracleGo
- 使用goldengate的資料泵進行Oracle-Oracle的單向複製GoOracle
- OGG雙向DML複製操作
- oracle goldengate ddl 操作導致複製程式abended處理案例OracleGo
- 實戰goldengate之ora-To-ora單向複製Go
- 為Oracle配置DDL複製Oracle
- 配置支援DML和DDL操作同步的GoldenGateGo
- Goldengate複製程式錯誤Fatal error executing DDLGoError
- GoldenGate學習筆記(5)_配置例程之單向複製Go筆記
- ORACLE 11g新特性-允許DDL鎖等待DML鎖Oracle
- 【GoldenGate】Oracle GoldenGate(二) 雙向同步配置GoOracle
- 使用GoldenGate 實現Oracle for Oracle 單向資料同步(實現表的DML操作同步)GoOracle
- goldengate不使用資料泵完成Oracle-Oracle的雙向複製GoOracle
- (一)OGG的安裝與配置,並實現單向DML複製操作