标签:shell
#!/bin/ksh
su - oracle << !
echo "select ‘alter system kill session ‘‘‘||sid||‘‘||‘,‘||serial#||‘‘‘;‘ from v\\\$session where username=‘C##SCOTT‘;" > sel.sql
sqlplus / as sysdba <<EOF @sel.sql 1>result.log 2>&1
exit
EOF
cat result.log | grep "alter system kill session" 1>exc.sql 2>&1
sqlplus / as sysdba <<EOF @exc.sql 1>>result.log 2>&1
exit
EOF
!
标签:shell
原文地址:http://564943627.blog.51cto.com/12870056/1942724