GoldenGate 反向切换步骤

Posted 长城之上是千亿的星空,星空之上是不灭的守望。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 源端启用应用,回切完成

 

以上是关于GoldenGate 反向切换步骤的主要内容,如果未能解决你的问题,请参考以下文章

GoldenGate 异常处理预案

Oracle 环境下 GoldenGate 集成抽取(Integrated Capture)模式与传统抽取模式(Classic Capture)间的切换

GoldenGate 应用系统升级

goldengate合并应用进程

OGG安装配置详细步骤--介绍

goldengate使用定义文件注意问题