OGG运维优化脚本-查询维护类--批量查询
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OGG运维优化脚本-查询维护类--批量查询相关的知识,希望对你有一定的参考价值。
文件名:search.sh
路径:$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
本文出自 “netsman” 博客,请务必保留此出处http://netsman.blog.51cto.com/5750076/1939638
以上是关于OGG运维优化脚本-查询维护类--批量查询的主要内容,如果未能解决你的问题,请参考以下文章