Generally, when a session is killed, run alter system kill session 'sid, serial # '; Administrator's Guide to say that when the session is active, alter system kill session only identifies the session as a killed or pseudo State and does not release the resources held by the session. Therefore, after executing the alter system kill session, we can see that the session still exists. In this case, you can use the immediate option to force the Kill session to be killed immediately, as shown in the following code: SQL> alter system kill session '100 52 'immediate;
SQL Language Reference www.2cto.com ( http://docs.oracle.com/cd/B28359_01/server.111/b28286/toc.htm#BEGIN Immediate Specify IMMEDIATE to instruct OracleDatabase to roll back ongoing transactions, release all session locks, recover the entire session state, and return control to you immediately. in addition, we can also use alter system disconnect sessionThe POST_TRANSACTION setting allows ongoing transactions to complete before the session is disconnected. if the session has no ongoing transactions, then th Is clause has the same effect described for as kill session. the IMMEDIATE setting disconnects the session and recovers the entire session state immediately, withoutwaiting for ongoing transactions to complete. if you also specify POST_TRANSACTION and the session has ongoing transactions, then the IMMEDIATE keyword is ignored. if you do not specify POST_TRANSACTION, or you specify POST_TRANSACTION bu T the session has no ongoing transactions, www.2cto.com then this clause has the same effect as described for kill session immediate. modify sqlnet. add expire_time = x (in minutes) to the ora file and run the alter profile default limit IDLE_TIME x command to modify the file. The file takes effect after restart. Terminate Session 1 SELECT spid, osuser, s. program, schemaname2 FROM gv $ process p, gv $ session s3 WHERE p. addr = s. paddr; 1. UNIXkill-9 5745 ps-ef | grep pmon _ $ ORACLE_SID | awk '{print $2}' | xargs kill-9 # kill a batch of sessions 2. WINDOWSorakill <instance_name> <spid> If the session is already killed in the DB, the preceding SQL statement cannot find the spid. You can use the following SQL statement to find the SPID 1 select addr and pid, spid2 FROM v $ process p 3 where addr in (select p. addr4 from v $ process p5 where pid <> 16 minus www.2cto.com 7 select s. paddr from v $ session s) Author DB & * NIX