用户想要用OGG进行同步数据,原来用的是Shareplex,至于为啥要换OGG,BulaBula一堆原因。。。。。这不是我们要在意的事情,和客户装完配置好OGG之后,测试中,客户提出要有个简单的启动和关闭OGG脚本,晕,,,原来他们Shareplex的时候就有这样的一个脚本,总之客户说用起来比较简单容易,如果都像我给他们说的那样在GGSCI平台中操作,过于麻烦了,好啦,需求已经提出,下面的就是要我把问题解决就ok了。
经过“狂乱”的度娘后,找到了如下解决方法。easy....,先写出来共享之。。。。。。。
==================开始=============================
源端和目标端的启动脚本都是一样的,4个文件,2个一组;
启动脚本:startOgg, 启动批处理命令文件:startup.txt
关闭脚本:shutOgg, 关闭批处理命令文件:shutdown.txt
====环境==========
oracle : 10.2.0.5 64bit
linux: redhat 5.8 64bit
ogg: 11.2.1.0.1
====源端: 启动脚本====
==startOgg
-
#--------start Oracle GoldenGate------------
-
#! /bin/sh
-
echo \" ******************************************************************* \"
-
echo \" * $WHOAMI: Starting GoldenGate on `date` by USER: `whoami` \"
-
echo \" ******************************************************************* \"
-
-
export GG_HOME=/home/oracle/ogg
-
-
exec_file=/home/oracle/startup.txt
-
-
$GG_HOME/ggsci << EOF
-
OBEY $exec_file
-
EOF
-
exit
==startup.txt
-
START MGR
-
START EXTA
-
START DPEA
-
INFO ALL
====源端: 关闭脚本====
==shutOgg
-
#--------shutdown oracle GoldenGate------------
-
#! /bin/sh
-
#! /bin/sh
-
echo \" ******************************************************************* \"
-
echo \" * $WHOAMI: Stop GoldenGate on `date` by USER: `whoami` \"
-
echo \" ******************************************************************* \"
-
-
export GG_HOME=/home/oracle/ogg
-
-
exec_file=/home/oracle/shutdown.txt
-
-
$GG_HOME/ggsci << EOF
-
OBEY $exec_file
-
EOF
-
exit
==shutdown.txt
-
stop exta
-
stop dpea
-
stop mgr !
-
info all
-
info exta
-
info dpea
注意:关闭manager的时候如果不带!会出现让用户提示输入“Y”or"N"的情况,这个情况需要在stop mgr !即可。
目标端的相关脚本和源端是一样的。此处不再赘述。
测试:
1. 启动===

2. 关闭===

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3090/viewspace-1417107/
,如需转载,请注明出处,否则将追究法律责任。