Pavan DBA's Blog

The DBA Knowledge Store

Script to kill sniped sessions

Posted by Pavan DBA on October 29, 2009


#!/bin/sh
tmpfile=/tmp/tmp.$$
sqlplus system/manager <<EOF
spool $tmpfile
select p.spid from v\$process p,v\$session s
where s.paddr=p.addr
and s.status=’SNIPED’;
spool off
EOF
for x in `cat $tmpfile | grep “^[0123456789]”`
do
kill -9 $x
done
rm $tmpfile

One Response to “Script to kill sniped sessions”

  1. satellite TV info…

    […]Script to kill sniped sessions « Pavan DBA's Blog[…]…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: