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 源端启用应用,回切完成