您好,登錄后才能下訂單哦!
文件名: addtrandata.sh
所在路徑:$HOME/ggscript/gginsert
功能:用于批量增加表附加日志,屬于從加表腳本中獨立出來的功能,用于應(yīng)對表附加日志丟失以及加表附加日志增加失敗的情況
#!/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
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。