为了测试一对多的复制,想把源端的一个用户的数据复制到同一个数据库下的不同用户下,这涉及
到一下几个知识点:
*一对多的复制
*named post queue
*通过exp/imp做初始同步
1 停止访问源数据
2 备份t数据
备份
expdp system/oracle Tables=demo.hwz,demo.t1 DIRECTORY=DATA_PUMP_DIR file=demo.dmp
3 源端启动sp_cop and sp_ctrl
4 源端Activate the configuration
sp_ctrl (ndb1:2100)> view config rep1
datasource:o.XE
expand demo.% demo.% ndb3:Q01@o.DEMO
expand demo.% demo2.% ndb3:Q02@o.DEMO
sp_ctrl (ndb1:2100)> activate config rep1
sp_ctrl (ndb1:2100)> show
Process Source Target State PID
---------- ------------------------ ------------ -------------------- ------
Capture o.XE Running 28435
Read o.XE Running 28436
Export ndb1 ndb3 Running 28456
5 目的端启动sp_cop and sp_ctrl
6 目的端, Stop Post
7 允许用户范围数据库
8 目的端, 导入数据
分别导入2个schema
impdp system/oracle DIRECTORY=DATA_PUMP_DIR file=demo.dmp
impdp system/oracle DIRECTORY=DATA_PUMP_DIR REMAP_SCHEMA=demo:demo2 file=demo.dmp
9 目的端
禁止trigger, check constraints, cascading deletes等
10 目的端,启动post
sp_ctrl (ndb3:2100)> show
Process Source Target State PID
---------- ------------------------ ------------ -------------------- ------
Import ndb1 ndb3 Running 7710
MTPost o.XE-Q01 o.DEMO Stopped by user
MTPost o.XE-Q02 o.DEMO Stopped by user
sp_ctrl (ndb3:2100)> start post
sp_ctrl (ndb3:2100)> qstatus
Queues Statistics for ndb3
Name: Q01 (o.XE-o.DEMO) (MTPost queue)
Number of messages: 0 (Age 0 min; Size 1 mb)
Backlog (messages): 0 (Age 0 min)
Name: Q02 (o.XE-o.DEMO) (MTPost queue)
Number of messages: 0 (Age 0 min; Size 1 mb)
Backlog (messages): 0 (Age 0 min)
11 验证新的数据都到2个schema了
阅读(2584) | 评论(0) | 转发(0) |