OGG operation and maintenance optimization script (8) & # 160; query maintenance class-batch query
File name: search.sh
Path: $HOME/ggscript/ggsearch
Function: this script is designed to meet the need to check the specific configuration of the goldengate process
Select the call through the edit script
#! / bin/bashecho "This script is used to search the specified table! (created by renyi)" echo $dirdir=$PWD cd $HOME/ggserver# determine the search object type echo "Please select the search type" echo select ch in "ALLFILE"EXTRACT"REPLICAT"PUMP" docase $ch in "ALLFILE") ls-lrt $HOME/ggserver/dirprm/*.prm# get process list cd $HOME/ggserver (echo info all;echo exit) |. / ggscicd $dirval=1 break # search for the corresponding type # enter the process file name to be searched: "EXTRACT") ls-lrt $HOME/ggserver/dirprm/e*.prmcd $HOME/ggserver (echo info all;echo exit) |. / ggscicd $dirread-p "Please enter the prm file name:" valbreak;;; "REPLICAT") ls-lrt $HOME/ggserver/dirprm/r*.prmcd $HOME/ggserver (echo info all;echo exit) |. / ggscicd $dirread-p "Please enter the prm file name:" valbreak "PUMP") ls-lrt $HOME/ggserver/dirprm/p*.prmcd $HOME/ggserver (echo info all;echo exit) |. / ggscicd $dirread-p "Please enter the prm file name:" val break;;; *) echo "Please select your choice: 1.ALLFILE 2.EXTRACT 3.REPLICAT 4.PUMP";; esacdone Echo "Please Enter the table you want to search!" read-n 1vi SearchTempi=1num= `sed-n'$= 'SearchTemp`if ["$val" = = 1] then while ["$I"-le "$num"] do TAL= `sed-n $ifolp' SearchTemp` grep-ni $TAL $HOME/ggserver/dirprm/* 1 > > exist | | echo $TAL > > notexist ((items+)) Doneelse while ["$I"-le "$num"] do TAL= `sed-n $ifolp`SearchTemp` grep-ni $TAL $HOME/ggserver/dirprm/$val 1 > > exist | | echo $TAL > > notexist ((iTunes +)) Donefi# outputs search results echo "- -" echo "The search result is" cat existecho "- -" echo "The notexist table is" cat notexistecho "- -- "cat SearchTemp | sort-n > SearchTempu cat notexist | sort-n > notexistu comm-23 SearchTempu notexistu > existablecat / dev/null > existcat / dev/null > SearchTemp cat / dev/null > notexist echo" The exist table is "cat existableexit