ogg在dataguard下切换的处理(正常关闭ogg,然后拷贝ogg目录到切换后的主库)

环境:
OS:Centos 7
db:11.2.0.4
拓扑结构:
以A标识                   以B标识                                  以C标识
12C-RAC(主ogg)->11G(从ogg,dataguard 主库)-->11G(dataguard,从库)

 

1.dg切换后在B上部署的ogg的情况

GGSCI (ora11g) 5> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    ABENDED     REPEP       00:00:00      00:07:18 

view report repep
看到的错误如下:
2024-06-25 15:26:48  ERROR   OGG-05302  An error occurred while doing commit handling.

 

2.A上的ogg上的情况

GGSCI (rac01) 8> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     DPEP        00:00:00      00:00:05    
EXTRACT     RUNNING     EXTEP       00:00:02      00:00:01 

 

3.停掉A和B上的ogg
A上操作:
GGSCI (rac01) 9> stop mgr
GGSCI (rac01) 10> stop *

B上操作:
GGSCI (ora11g) 9> stop mgr
GGSCI (ora11g) 10> stop *

 

4.把B上的ogg拷贝到C
保持目录一致
[root@ora11g /]# scp -r goldengate12c_bak root@192.168.56.103:/

拷贝过去后注意要修改权限
[root@ora11gbak /]# chown -R oracle:oinstall ./goldengate12c_bak/

 

5.启动C上的ogg

[oracle@ora11gbak goldengate12c_bak]$ ./ggsci
GGSCI (ora11gbak) 2> start mgr
GGSCI (ora11gbak) 4> start repep
GGSCI (ora11gbak) 6> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    RUNNING     REPEP       00:00:00      00:00:01    

 

6.修改A上的参数指向C并启动

GGSCI (rac01) 15> view params dpep

extract dpep
userid goldengate, password AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC ,ENCRYPTKEY DEFAULT
RmtHost 192.168.56.103, MgrPort 7819, Compress
RmtTrail ./dirdat/ep
gettruncates
Passthru
table hxl.*;

 

 

启动

GGSCI (rac01) 18> start mgr
GGSCI (rac01) 20> start *
GGSCI (rac01) 23> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     DPEP        00:00:00      00:00:05    
EXTRACT     RUNNING     EXTEP       00:00:00      00:00:06  

 

说明:

1.在dataguard环境下,主从切换后,可以把ogg的整个目录拷贝到新主库,ogg可正常使用(源端需要修改新的ip指向);

2.rac环境下,ogg的节点坏掉了,可以将ogg整个目录拷贝到正常的节点上(抽取进程注意修改参数 SETENV (ORACLE_SID="slnngk2"))

 

posted @ 2024-06-25 16:15  slnngk  阅读(22)  评论(0编辑  收藏  举报