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 (10)-query maintenance class-process details query

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

File: processinfo.sh

Path: $HOME/ggscript/ggupload

Function: this script is designed to check the detailed source, destination, definition files and other information of all goldengate processes when maintaining the configuration.

If content comments are not prepared for deployment according to the script, the output will be empty

If there is other comment information, the output will be interfered.

#! / bin/bashexport PATH= "/ usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" echo "This sciprt is write by RenYi" hn= `echo $HOSTNAME`usr = `echo $USER`echo $hn-$usrcd $HOME/ggserver (echo info all Echo exit) |. / ggsci | grep-E "EXTRACT | REPLICAT" | awk 'BEGIN {FS= "+} {print $3}' > $HOME/ggscript/ggupload/tempcd $HOME/ggscript/gguploadcat temp | tr Amurz > temp2sed's Randle. PRM 'temp2 > temp3rm-f temp2i=1num= `sed-n'$= 'temp3`echo-n" + -+\ n "printf"%-1s%-15s%-1s%-15s%-1s%-16s%-1s%-12s%-1s%-16s%- 1s%-15s%-1s%-16s%-1s\ n "\ | process\ | source\ | sourceip\ | targetip\ | defsfile\ | defprm\ | cd $HOME/ggserver/dirprmwhile [" $I "- le" $num "] do fname= `sed-n $HOME/ggscript/ggupload/ temp3`pname= `sed-n $ifolp' $HOME/ggscript/ggupload/ temp`cat $fname | grep-w" source "| cut-d':'- f 2` While [${# source}-le 2] do source=none done sourceip= `cat $fname | grep-w "sourceIP" | cut-d':'- f 2`while [${# sourceip}-le 2] do sourceip=none done target= `cat $fname | grep-w "target" | cut-d':'- f 2` While [${# target}-le 2] do target=none done targetip= `cat $fname | grep-w "targetIP" | cut-d':'- f 2`while [${# targetip}-le 2] do targetip=none done defsfile= `cat $fname | grep-w "defsfile" | cut-d':'- f 2`cat [${# cat}-le " 2] do defsfile=none done defprm= `cat $fname | grep-w "defprm" | cut-d':'- f 2`while [${# cat}-le 2] do defprm=none done echo-n-e "+- -+\ n "printf"%-1s%-15s%-1s%-15s%-1s%-16s%-1s%- 12s%-1s%-16s%-1s%-15s%-1s%-16s%-1s\ n "\ | $pname\ | $source\ | $sourceip\ | $target\ | $targetip\ | $defsfile\ | $defprm\ | (iTunes +)) Donecd $HOME/ggscript/gguploadecho-n-e "+- -+\ n "

Query result

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: 286

*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