Get the App
SLTechnology News&Howtos  ›  Database  › 

OGG Operation and maintenance Optimization script (16)-Information synchronization Class-additional Log check

Shulou Source: shulou.com Published: 2022-06-01 13:01:24 10月01日 Update

File name checktrandata.sh

Path $HOME/ggscript/ggtrandata

The function of this script is to verify the additional log status of the tables configured in the EXTRACT process through the infotrandata instruction included in ogg, only for synchronizing the OGG of the oracle database.

In order to prevent a large number of queries from affecting database performance, if there is too much information about the configuration table in the process. The query speed will be slow, so it is recommended to automatically run in the early hours of the morning by scheduling tasks.

#! / bin/bashcd $HOME/ggscript/ggoperatdir=$PWDcd $HOMEif [- f. Profile]; then. Profilefiif [- f. Bash _ profile]; then. .bash _ profilefiecho "This sciprt is write by RenYi" mydate= `date + 20% ymuri% mmurd% H`hn = `echo $HSTNAME`usr = `echo $USER`echo $hn-$usrecho "HOSTNAME:" $hn "

"> $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho" user: "$usr"

"> > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho" date: "$mydate"

"> > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho "" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho "TABLE" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho "PROBLEM" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckecho "> > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheckcd $HOME/ggserver (echo info all) Echo exit) |. / ggsci | grep EXTRACT | awk 'BEGIN {FS= "+"} {print $3}' | grep ^ E > $HOME/ggscript/ggtablecheck/tmpi=1NUX= `sed-n'$='$HOME/ggscript/ggtablecheck/ tmp` # echo $NUXcd $PWDwhile ["$I"-le "$NUX"] do cat / dev/null > $HOME/ggscript/ggtablecheck/checktmp VAR= `sed-n $ifolp' $HOME/ggscript/ggtablecheck/ tmp`echo $VAR val= `echo $VAR.prm | tr "[: upper:]" [lower: :] "`cat $HOME/ggserver/dirprm/$val | awk'/ TABLE#/ / # TABLE/ {if (I > 1) print x Xerox 0 HOME/ggscript/ggtablecheck/temp +}'> $HOME/ggscript/ggtablecheck/temp awk-F'-'($1) {print $1}'$HOME/ggscript/ggtablecheck/temp > $HOME/ggscript/ggtablecheck/temp2 rm-rf $HOME/ggscript/ggtablecheck/temp sed-e'/ ^ $/ d'$HOME/ggscript/ggtablecheck/temp2 > $HOME/ggscript/ggtablecheck/temp3 rm-rf $HOME/ggscript/ggtablecheck/temp2 awk-F' '{print $1}' $HOME/ggscript/ggtablecheck/temp3 > $HOME/ggscript/ggtablecheck/temp4 rm-rf $HOME/ggscript/ggtablecheck/temp3 awk-F' '{print $1}' $HOME/ggscript/ggtablecheck/temp4 > $HOME/ggscript/ggtablecheck/temp5 rm-rf $HOME/ggscript/ggtablecheck/temp4 cat $HOME/ggscript/ggtablecheck/temp5 | awk-F 'TABLE' {print $2}'> $HOME/ggscript/ggtablecheck/Temp rm-rf $HOME/ggscript/ggtablecheck/temp5 sed'/ ^ $/ d' $HOME/ggscript/ggtablecheck/Temp > $HOME/ggscript/ggtablecheck/temp rm-rf $HOME/ggscript/ggtablecheck/Temp More 1 NUM= `sed-n'$='$HOME/ggscript/ggtablecheck/ temp` echo $NUM while ["$a"-le "$NUM"] do table= `sed-n $astatp' $HOME/ggscript/ggtablecheck/ temp` echo dblogin `more $HOME/ggserver/dirprm/$val | grep USERID` > $HOME/ggserver/dirdat/checktrandata echo "info trandata $table" > > $HOME/ggserver/dirdat/checktrandata (echo OBEY dirdat/checktrandata Echo exit) |. / ggsci > > $HOME/ggscript/ggtablecheck/checktmp sleep 1a = `expr $a + 1`expr $HOME/ggscript/ggtablecheck/checktmp | grep table > $HOME/ggscript/ggtablecheck/checkresult1 sed'/ supplementally/d' $HOME/ggscript/ggtablecheck/checkresult1 > $HOME/ggscript/ggtablecheck/resulttmp cat $HOME/ggscript/ggtablecheck/resulttmp > $HOME/ggscript/ggtablecheck/checkresult HOME/ggscript/ggtablecheck/resulttmp 1 NUN= `sed-n'$='$HOME/ggscript/ Ggtablecheck/ checkresult`cat / dev/null > $HOME/ggscript/ggtablecheck/table cat / dev/null > $HOME/ggscript/ggtablecheck/event while ["$c"-le "$NUN"] do tmp= `sed-n $ccheckp' $HOME/ggscript/ggtablecheck/ checkresult`tab= `sed-n $ccheckp' $HOME/ggscript/ggtablecheck/ temp` if ["`checkr $tmp | grep erro`"] Then echo "" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck echo "$tab" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck echo "$tmp" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck echo "> > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck fi If ["`echo $tmp | grep roomled`"] Then echo "" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck echo "$tab" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck echo "$tmp" > > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck echo "> > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck fi C = `expr $c + 1` done I = `expr $I + 1`expr echo "" > $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck/bin/bash $HOME/ggscript/ggupload/upload.sh chk149 $HOME/ggscript/ggtablecheck/$hn-$usr.tbcheck sysinfo

Tags: Configuration data databases processes queries information logs scripts synchronization attachments tasks roles bulk recommendations performance directives files file names status paths Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker MySQL Apple NVidia