ORA-00031: session marked for kill handles the locks that cannot be killed in Oracle

Source: Internet
Author: User
ORA-00031: session marked for kill handles the locks that cannot be killed in Oracle

Author: moonsoft (http://moonsoft.itpub.net)
Posted at: 2006.09.06
Category: Oracle basic/Data Warehouse/Bi
Source: http://moonsoft.itpub.net/post/15182/203828
---------------------------------------------------------------

After some Oracle processes are killed, the state is set to "killed", but the locked resources are not released for a long time. Sometimes there is no way to restart the database. Now we provide a way to solve this problem, that is, it cannot be killed in Oracle, and it can be killed again at the OS level.

1. The following statement is used to query which objects are locked:

Select object_name, machine, S. Sid, S. Serial #
From v $ locked_object L, dba_objects o, V $ session s
Where l. object_id = O. object_id and L. session_id = S. Sid;

2. The following statement is used to kill a process:
Alter system kill session '123456'; (24,111 is the Sid found above, serial #)

[Note] the preceding two steps can be performed on the Oracle console.

3. if the process state is set to "killed" after a process is killed by using the preceding command, but the locked resources are not released for a long time, then, the corresponding process (thread) can be killed at the OS level. First, execute the following statement to obtain the process (thread) Number:
Select spid, osuser, S. Program
From v $ session S, V $ PROCESS p
Where S. paddr = P. ADDR and S. Sid = 24 (24 is the SID above)

4. Killing the process (thread) on the OS ):
1) Run commands as root on UNIX :
# Kill-9 12345 (that is, the spid obtained in step 1)
2) In Windows (UNIX also applies), use orakill to kill the thread. orakill is an executable Command provided by Oracle. The syntax is as follows:
Orakill Sid thread
Where:
Sid: indicates the Instance name of the process to be killed.
Thread: the ID of the thread to be killed, that is, the spid obtained in step 1.
Example: C:> orakill orcl 12345

ORA-00031: session marked for kill

Cause: the session specified in an alter system kill session command cannot be killed immediately (because it is rolling back or blocked on a network operation), but it has been marked for kill. this means it will be killed as soon as possible after its current uninterruptible operation is done.

Action: no action is required for the session to be killed, but further executions of the alter system kill session command on this session may cause the session to be killed sooner.

Related Article

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.