Oracle killed session not released

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.