如何清除session 状态为sniped的会话

Problem Description
——————-
If “init.ora” resource_limit = true, and idle_time set in profile.

When idle_time exceeds, the session status becomes ’sniped’ in v$session,
but sniped sessions never get cleaned up.

Using ‘alter system kill session’ to kill the session, session status becomes
‘killed’ in v$session, but still is never cleaned up.

Solution Description
——————–

On Unix, and if using a dedicated server, use the following shell script to
kill the shadow process (script has been tested on Solaris, AIX, Tru64 and
HPUX):

#!/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
 
NOTE: Please beware that if you are running in a shared server environment
you do not accidently kill your dispatchers and/or shared servers.
See
Note 120135.1.Explanation
———–

According to several bugs as shown in references, it’s still expected behaviour
that sniped session may never clean up. The only workaround is to kill the
shadow process.

References



评论暂缺

(Required)
(Required, will not be published)