Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OGG operation and maintenance optimization script (18)-process operation class-whole process start and stop

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

File: allstop.sh allstart.sh

Path $HOME/ggscript/ggoperat

l During OGG operation and maintenance, we encountered situations where non-data synchronization operation and maintenance colleagues needed to cooperate with database DBAs to maintain and start and stop all data synchronization links.

Therefore, two sets of full process start/stop scripts were specially written, one for full process stop, which calls long transaction skip scripts, long transaction skip scripts, and stop process and MGR monitor process. One set for all OGG process start-ups.

allstop.sh

#!/ bin/bashecho $dircd $HOME/ggscript/ggoperatdir=$PWDcd $HOMEif [ -f .profile ];then . .profilefiif [ -f .bash_profile ];then . .bash_profileficd $direcho "All process will be stop! Are you sure will do this job? (press any key to continue)" select ch in "yes" "no"docase $ch in"yes") echo "execute the process stop operation" break; ;;"no") echo "process break" exit 2; ;;*) echo "Please select your choice :1.yes.2.no";; esacdone;cd $HOME/ggserver(echo info all;echo exit)|./ ggsci|grep "EXTRACT" |awk 'BEGIN {FS=" +"} {print $3}'|grep '^E' > $dir/extract(echo info all;echo exit)|./ ggsci|grep -E "EXTRACT|REPLICAT" |awk 'BEGIN {FS=" +"} {print $3}' > $dir/processcd $diri=1NUX=`sed -n '$=' extract`#if [ "$i" -le "$NUX" ];then while(($i $HOME/ggserver/dirdat/stopwhile(($i> $HOME/ggserver/dirdat/stop ((i++));donerm -f extractrm -f processcd $HOME/ggserver(echo obey dirdat/stop; echo exit)|./ ggsci(echo stop mgr;echo y;echo exit)|./ ggsci

allstart.sh

#!/ bin/bashecho $dircd $HOME/ggscript/ggoperatdir=$PWDcd $HOMEif [ -f .profile ];then . .profilefiif [ -f .bash_profile ];then . .bash_profileficd $dircd $HOME/ggserver(echo START mgr;echo exit)|./ ggsci(echo info all;echo exit)|./ ggsci|grep "EXTRACT" |awk 'BEGIN {FS=" +"} {print $3}' > $dir/process(echo info all;echo exit)|./ ggsci|grep "REPLICAT" |awk 'BEGIN {FS=" +"} {print $3}' >> $dir/processcd $diri=1NUX=`sed -n '$=' process`while(($i

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report