OGG运维优化脚本(八)- 查询维护类--批量查询-创新互联

文件名:search.sh

成都创新互联10多年成都企业网站建设服务;为您提供网站建设,网站制作,网页设计及高端网站定制服务,成都企业网站建设及推广,对活动板房等多个领域拥有丰富建站经验的网站建设公司。

路径:$HOME/ggscript/ggsearch

功能:该脚本用于满足检查goldengate进程具体配置情况的需求而设计

通过edit脚本选择调用

#!/bin/bash echo "This script is used to search the specified table!(created by renyi)" echo $dir dir=$PWD  cd $HOME/ggserver #确定搜索对象类型 echo "Please select the search type" echo  select ch in "ALLFILE" "EXTRACT" "REPLICAT" "PUMP" do case $ch in "ALLFILE") ls -lrt $HOME/ggserver/dirprm/*.prm #获取进程清单 cd $HOME/ggserver (echo info all;echo exit)|./ggsci cd $dir val=1     break; ;; #针对对应类型 进行搜索操作 #输入需搜索的进程文件名 "EXTRACT") ls -lrt $HOME/ggserver/dirprm/e*.prm cd $HOME/ggserver (echo info all;echo exit)|./ggsci cd $dir read -p "Please enter the prm file name:"  val break; ;; "REPLICAT") ls -lrt $HOME/ggserver/dirprm/r*.prm cd $HOME/ggserver (echo info all;echo exit)|./ggsci cd $dir read -p "Please enter the prm file name:"  val     break; ;; "PUMP") ls -lrt $HOME/ggserver/dirprm/p*.prm cd $HOME/ggserver (echo info all;echo exit)|./ggsci cd $dir read -p "Please enter the prm file name:"  val  break; ;;     *)  echo "Please select your choice : 1.ALLFILE  2.EXTRACT   3.REPLICAT  4.PUMP"  ;; esac done; echo "Please Enter the table you want to search!" read -n 1 vi SearchTemp i=1 num=`sed -n '$=' SearchTemp` if [ "$val" == 1 ]  then while [ "$i" -le "$num" ] do TAL=`sed -n $i'p' SearchTemp` grep -ni $TAL $HOME/ggserver/dirprm/* 1>> exist || echo $TAL >> notexist  ((i++)); done else  while [ "$i" -le "$num" ] do TAL=`sed -n $i'p' SearchTemp` grep -ni $TAL $HOME/ggserver/dirprm/$val 1>> exist || echo $TAL >> notexist  ((i++)); done fi #输出搜索结果 echo "---------------------------------------" echo "The search result is" cat exist echo "---------------------------------------" echo "The not exist table is" cat notexist echo "---------------------------------------" cat SearchTemp | sort -n > SearchTempu  cat notexist | sort -n > notexistu  comm -23  SearchTempu  notexistu  > existable cat /dev/null > exist cat /dev/null > SearchTemp  cat /dev/null > notexist  echo "The  exist table is" cat existable exit

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

分享标题:OGG运维优化脚本(八)- 查询维护类--批量查询-创新互联
文章来源:https://www.cdcxhl.com/article32/eposc.html

成都网站建设公司_创新互联,为您提供网站制作网站内链网站导航云服务器全网营销推广品牌网站设计

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

小程序开发