GoldenGate单向DDL同步(四)

2014-11-24 15:23:24 · 作者: · 浏览: 1
SQL> @ddl_pin.sql ogguser
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
4. 清除上一次实验环境
源库:
GGSCI (dd1) 38> delete extract einikk
GGSCI (dd1) 38> delete extract eorakk
2013-04-16 17:30:46 WARNING OGG-01753 Cannot unregister EXTRACT EORAKK from database because no database login was provided. You can manually unregister this group later with the UNREGISTER EXTRACT LOGRETENTION command. Issue DBLOGIN first.
Deleted EXTRACT EORAKK.
GGSCI (dd1) 2> stop manager
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n) y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
目标库:
GGSCI (kf2.calvin) 10> delete replicat rinikk
Deleted REPLICAT RINIKK.
GGSCI (kf2.calvin) 17> dblogin userid system ,password calvin
Successfully logged into database.
GGSCI (kf2.calvin) 18> delete CHECKPOINTTABLE SYSTEM.GGCHKPTABLE
This checkpoint table may be required for other installations. Are you sure you want to delete this checkpoint table y
Successfully deleted checkpoint table SYSTEM.GGCHKPTABLE.
GGSCI (kf2.calvin) 19> delete replicat rorakk
Deleted REPLICAT RORAKK.
GGSCI (kf2.calvin) 1> stop manager
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n) y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.、
5. 源库和目标库建立测试用户,并授予权限
SQL> create user stat identified by stat default tablespace testdata quota unlimited on testdata;
User created.
SQL>
grant connect,resource,dba to stat;
Grant succeeded.
6. 对源库和目标库进行配置
源库和目标库配置管理进程:
GGSCI (dd1) 3> info all
Program Status Group Lag Time Since Chkpt
MANAGER STOPPED
GGSCI (dd1) 5> view params mgr
-- this is configuration of this manager process
PORT 7809
GGSCI (dd1) 6> start manager
Manager started.
源库设置:
GGSCI (dd1) 2> dblogin userid ogguser@test1,password ogguser
Successfully logged into database.
GGSCI (dd1) 3> add extract test1,tranlog,begin now ##添加extract进程
EXTRACT added.
GGSCI (dd1) 4> add exttrail /data/oracle/ogg11/dirdat/lt,extract test1 ##添加extrail
EXTTRAIL added.
GGSCI (dd1) 5> edit params test1 ##编辑参数
extract test1
userid ogguser@test1, password ogguser
rmthost 192.168.130.171, mgrport 7809
rmttrail /data/oracle/ogg11/dirdat/lt
ddl include mapped objname stat.*;
table stat.*;
GGSCI (dd1) 6> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED TEST1 00:00:00 00:03:56
目标库设置:
GGSCI (kf2.calvin) 5> edit params ./GLOBALS ##编辑全局参数文件
GGSCHEMA ogguser
CHECKPOINTTABLE ogguser.checkpoint
GGSCI (kf2.calvin) 1> dblogin userid ogguser@test2,password ogguser
Successfully logged into database.
GGSCI (kf2.calvin) 3> add checkpointtable ogguser.checkpoint ##添加checkpoint表
Successfully created checkpoint table OGGU