GoldenGate 反向切换步骤

1 事先配置好反向复制链路;

 

2 停止源端的应用程序;

 

3 确认源端Capture已捕获所有的Redo信息;

GGSCI>info all

GGSCI>info ext_app

 

4 确认源端所有queue中无积压数据

GGSCI>info all

GGSCI>info ext_app

GGSCI>info pmp_app

 

5 把源端的压缩表和要复制的接口表等复制到目标端;

 

6 确认目标端的sequence的next_value大于等于源端的值,如不满足要求需要对目标端的

sequence进行调整;

 

7 比对源端和目标端表的数据是否一致;[minus或者count(*)或者hash value对比];或用

vardata工具抽样进行全表对比;

 

8 启用目标端的约束和外键以及job;

select 'alter table '||owner||'.'||table_name||' enable constraint '||constraint_name||';'

from dba_constraints

where constraint_type in ('R') and

owner in('APPUSR')

order by status,owner;

select 'alter trigger '||owner||'.'||trigger_name||' enable;'

from dba_triggers

where owner in('APPUSR')

order by status,owner;

SQL>alter system set job_processes=10 scope=both sid=’*’;

 

9 停止源端的约束和外键以及job;

select 'alter table '||owner||'.'||table_name||' disable constraint '||constraint_name||';'

from dba_constraints

where constraint_type in ('R') and

owner in('APPUSR')

order by status,owner;

select 'alter trigger '||owner||'.'||trigger_name||' disable;'

from dba_triggers

where owner in('APPUSR')

order by status,owner;

SQL>alter system set job_processes=0 scope=both sid=’*’;

 

10 启动反向复制的Capture进程,如有可能启动DataPump进程;

 

11 把应用程序切换到目标端;

 

12 确认目标端Capture进程状态正常;

 

13 源端数据库修复后,需要进行反向回切,在此过程中可能需要将数据库从目标端初始化到源端,视具体情况而定;

 

14 启动反向复制DataPump进程和Replicat进程,将数据从目标端Apply到源端;

 

15 停止目标端的应用

 

16 确认源端的Replicat队列没有数据了;

 

17 把目标端的压缩表和要复制的接口表等复制到源端

 

18 比对源端和目标端表的数据是否一致;[minus或者count(*)或者hash value对比]

Internal Partner Win Story

19 确认源端的sequence的next_value大于等于目标端的值,如果不是,则需要调整源端的Sequence;

 

20 启用源端的trigger和约束,以及job

select 'alter table '||owner||'.'||table_name||' enable constraint '||constraint_name||';'

from dba_constraints

where constraint_type in ('R') and

owner in('APPUSR')

order by status,owner;

select 'alter trigger '||owner||'.'||trigger_name||' enable;'

from dba_triggers

where owner in('APPUSR')

order by status,owner;

SQL>alter system set job_processes=10 scope=both sid=’*’;

 

21 停止目标端的约束和外键以及job

select 'alter table '||owner||'.'||table_name||' disable constraint '||constraint_name||';'

from dba_constraints

where constraint_type in ('R') and

owner in('APPUSR')

order by status,owner;

select 'alter trigger '||owner||'.'||trigger_name||' disable;'

from dba_triggers

where owner in('APPUSR')

order by status,owner;

SQL>alter system set job_processes=0 scope=both sid=’*’;

 

22 启动目标端的Replicat

 

23 源端启用应用,回切完成

 

转载于:https://www.cnblogs.com/liang545621/p/7529148.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值