首页 > 代码库 > shell脚本实现killOracle指定用户进程

shell脚本实现killOracle指定用户进程

#!/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脚本实现killOracle指定用户进程