OGG operation and maintenance optimization script (20)-process operation class-forced time point adjustment
File name: fullrestart.sh
Path $HOME/ggscript/ggoperat
This script is specially written to deal with the frequent delay of a very troublesome business database server, OGG.
Because this database invokes a large number of job and concurrent operations every night, it causes frequent delays in the OGG data extraction process
The long transaction must be forcibly killed in order to recover normally.
Otherwise, the delay will be delayed until the archive is automatically backed up. Until the process is interrupted abnormally.
Tuning with the business communication database, and contacting the original oracle factory for many times, after no solution, we have to adjust the script at this mandatory time point at 5: 00 a.m. every day to automatically run the scheduled tasks to ensure the normal operation of the overall line.
I hope you don't have this kind of headache.
This script is violent. Please use it with caution. 100% recovery is not guaranteed
#! / bin/bashif [$#-eq 0]; then echo "INFO EXTRACT" exit 2ficd # HOMEif [- f. Profile]; then. Profilefiif [- f. Bash _ profile]; then. .bash _ profilefibackuptime= `date +% Y% m% dmurf% H% M% S`val = $1vale = `echo $val | tr alyz A-Z`if [`echo $val | grep ^ E`]; then IType=EXTRACTelif [`echo $val | grep ^ P`]; then IType=POSTelif [`echo $val | grep ^ R`]; then IType=REPLICAT else echo "only can operate the EXTRACT REPLICAT and the POST process" exit 2fipro= `echo $val.PRM | tr Amurz-z`cd $HOME/ggserver/dirprmif [!-e $pro] Then echo "the PROCESS is not exist" exit 2fi#cd $HOME/ggscript/ggoperatcd $HOME/ggserver (echo KILL $val;echo exit) |. / ggscicd $HOME/ggserver (echo INFO $val) Echo exit) |. / ggsci | grep Thread > $HOME/ggscript/ggoperat/threadcd $HOME/ggscript/ggoperatcat thread | awk'{print $1}'> $HOME/ggscript/ggoperat/tmp1cat thread | awk'{print $2}'> $HOME/ggscript/ggoperat/tmp2paste-d' 'tmp1 tmp2 > tmpjoin tmp1 tmp2rm-f tmp1rm-f tmp2rm-f threadsort-n tmp > temprm-f tmptime= `sed-n 1p temp`rm-f tempcd $HOME/ggserverecho "alter $val begin $time" > dirdat/altertimeecho "start $val" > dirdat/altertime (echo OBEY dirdat/altertime;echo exit) |. / ggsci