1.--Goldgate单向复制(支持DDL)
OGG单向复制(支持DDL)
版本说明:./ggsci -v
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
1. 配置环境变量(源端、目标端)> grant execute on utl_file to goldengate;
SQL> @marker_setup.sql
SQL> @ddl_setup.sql
SQL> @role_setup.sql
SQL> GRANT GGS_GGSUSER_ROLE TO goldengate;> @?/rdbms/admin/dbmspool
SQL >@ddl_pin goldengate;
1.@ddl_setup.sql
5.4源端配置抽取进程
Data Pump进程
GGSCI (test01) 1> edit param PTEST01
extract PTEST01
setenv (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
setenv (ORACLE_HOME = /oracle/app/oracle/product/11.2.4/db_1)
setenv (ORACLE_SID = testdb)
userid goldengate, password goldengate
PASSTHRU
REPORT AT 01:59
REPORTROLLOVER at 02:00
RMTHOST 10.18.4.41, MGRPORT 7809, COMPRESS
RMTTRAIL ./dirdat/rep
DYNAMICRESOLUTION
NUMFILES 2000
gettruncates
------lizhen-------
TABLE DEMO.TEST_TABLE_FOR_OGG;
GGSCI > ADD EXTRACT PTEST01, EXTTRAILSOURCE ./dirdat/exp
GGSCI > ADD RMTTRAIL ./dirdat/rep, EXTRACT PTEST01, MEGABYTES 200
6. 配置目标端
6.1配置全局变量
同源端
6.2创建检查点表
同源端
6.3 配置mgr
同源端
6.4 配置目标端复制进程
GGSCI (test01) 23> view param RTEST01
replicat RTEST01
setenv (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
userid goldengate, password goldengate
REPORTCOUNT EVERY 30 MINUTES,RATE
REPORT AT 01:59
REPORTROLLOVER at 02:00
DISCARDROLLOVER on friday
HANDLECOLLISIONS
REPERROR DEFAULT,ABEND
DISCARDFILE ./DIRRPT/RTEST01.DSC,APPEND, MEGABYTES 1000
ASSUMETARGETDEFS
CHECKSEQUENCEVALUE
ALLOWNOOPUPDATES
DYNAMICRESOLUTION
NUMFILES 2000
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
GROUPTRANSOPS 500
MAXTRANSOPS 500
------lizhen--------
MAP DEMO.TEST_TABLE_FOR_OGG,TARGET TEST.TEST_TABLE_FOR_OGG;
ggsci >add replicat RTEST01 ,exttrail ./dirdat/rep
7. 启动源端和目标端的ogg进程
---源端
GGSCI (test01) 50> start ETEST01
GGSCI (test01) 51> start PTEST01
GGSCI (test01) 53> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING ETEST01 00:00:00 00:00:01
EXTRACT RUNNING PTEST01 00:00:00 00:00:03
---目标端
GGSCI (test02) 24> start RTEST01
GGSCI (test02) 24> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING RTEST01 00:00:00 00:00:05