Monday, October 6, 2008

Kill all Oracle sessions

set pagesize 0
spool kill_all.sql
select 'alter system kill session '''||sess.sid||', '||sess.serial#||''';' from v$session sess where username = 'PL_SCHEMA';
spool off
spool kill_all.log
@kill_all.sql
spool off


ps -ef |grep oraclepl01cdy1 | grep NO | grep -v grep | awk '{print $2}' | xargs kill -9