您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
文件名: 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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。