您好,登錄后才能下訂單哦!
文件名: addtrandata.sh
所在路徑:$HOME/ggscript/gginsert
功能:用于批量增加表附加日志,屬于從加表腳本中獨立出來的功能,用于應對表附加日志丟失以及加表附加日志增加失敗的情況
#!/bin/bash echo "This script will add trandata( by RenYi)" ls -lrt $HOME/ggserver/dirprm/e*.prm echo "The EXTRACT process:" cd $HOME/ggserver (echo info all;echo exit)|./ggsci|grep "EXTRACT" |awk 'BEGIN {FS=" +"} {print $3}'|grep '^E' cd $HOME/ggscript/gginsert echo "Please press any key" read -n 1 read -p "Please enter the EXTRACT name:" val2 val=`echo $val2.PRM|tr A-Z a-z` cd $HOME/ggserver/dirprm if [ ! -e $val ]; then echo "the EXTRACT is not exist" echo "the EXTRACT is not exist" >> ''$HOME'/gglog/gginsert/InsertLog-'$backuptime'.log' exit 2 fi echo "Please Enter the table (Please enter any key)" read -n 1 cat /dev/null > trandaTmp vi trandaTmp sed 's/^/add trandata /' trandaTmp > addtrandata NUX=`sed -n '$=' addtrandata` echo $NUX i=1 echo $i cd $HOME/ggserver echo dblogin `more $HOME/ggserver/dirprm/$val|grep USERID` > dirdat/addtrandata echo $login while [ "$i" -le "$NUX" ] do sed -n "${i}p" $HOME/ggscript/gginsert/addtrandata >> dirdat/addtrandata i=`expr $i + 1` done echo OBEY dirdat/addtrandata |./ggsci
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。