根據v$session 之status及logon_time有選擇kill某些session會話

wisdomone1發表於2010-07-29
SQL> select username,
                        sid,
                        serial#,
                        status,
                        to_char(logon_time,'yyyy-mm-dd hh24:mi:ss')
             from v$session
            where status!='ACTIVE'
             order by to_char(logon_time,'yyyy-mm-dd hh24:mi:ss');
 
 
USERNAME          SID    SERIAL# STATUS   TO_CHAR(LOGON_TIME,
---------- ---------- ---------- -------- -------------------
PD                979          5 INACTIVE 2010-07-29 08:35:50
PD                975          6 INACTIVE 2010-07-29 08:35:57
PD                988          8 INACTIVE 2010-07-29 08:51:33
PD                978         15 INACTIVE 2010-07-29 09:12:40
PD                989        165 INACTIVE 2010-07-29 09:12:40
PD                974          8 INACTIVE 2010-07-29 09:12:40
PD                972          5 INACTIVE 2010-07-29 09:12:40
PD                976          2 INACTIVE 2010-07-29 09:12:40
 
alter system kill session 'sid,serial#';
 
再次執行以上sql

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-669745/,如需轉載,請註明出處,否則將追究法律責任。

相關文章