- 论坛徽章:
- 0
|
- if [ $# != 2 ]
- then
- echo Usage: $0 dbname tbname
- exit
- fi
- TMPFILE=$$.fifo
- dbaccess $1 <<! 1>null
- unload to "$TMPFILE"
- Select hex(partnum) from systables where tabname = "$2";
- !
- str=`cat $TMPFILE|awk -F "|" '{print $1}'|sed -e 's/0x//g'`
- #echo $str
- onstat -g opn|grep -i "$str"|head -1
- str=`onstat -g opn|grep -i "$str"|head -1|awk '{print $2}'|sed -e 's/^0x//g'|sed
- -e 's/^0//g'`
- #echo $str
- ses=`onstat -u |grep "$str"|awk '{print $3}'`
- onstat -g ses $ses>$TMPFILE
- pid=`cat $TMPFILE|sed -n '6,6p'|awk '{print $5}'`
- echo "查表信息:"
- cat $TMPFILE
- echo "进程信息:"
- ps -ef|grep $pid
- echo "\n\n锁表进程PID:$pid 数据库sid: $ses"
- echo "可使用onstat -g ses <sid> 或 kill <pid> 终止进程\n"
- rm -rf $TMPFILE
复制代码 |
|