Ora-00031:session marked for kill handles a lock that cannot be killed in Oracle

Source: Internet
Author: User

Some Oracle processes have been 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 provides a way to solve this problem, that is, in Oracle can not kill, at the OS level to kill.

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 ' 24,111 '; (24,111 of which are the sid,serial# of the above query)
Note: The above two steps can be performed through the management console of Oracle.
3. If the process state is set to "killed" after killing a process with the above command, but the locked resource is not released for a long time, then the corresponding process (thread) can be killed at the OS level, first executing the following statement to get 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. Kill the process (thread) on the OS:
1)On Unix, execute the command as root:
#kill-9 12345 (that is, the SPID queried in step 3rd)
2) in Windows (also applicable to Unix) to kill threads with Orakill, Orakill is an executable command provided by Oracle with the following syntax:
Orakill SID Thread
which
Sid: Represents the instance name of the process to kill
Thread: Is the number of threads to be killed, that is, the SPID that is queried in step 3rd.
Example: C:>orakill ORCL 12345

Ora-00031:session marked for Kill

Cause:the session specified in an ALTER SYSTEM KILL session command cannot being killed immediately (because it is rolling b Ack or blocked on a network operation), but it had been marked for kill. This means it would be killed as soon as possible after its current uninterruptible operation was done.
Action:no action is required for the session to being killed, but further executions of the ALTER SYSTEM KILL session Comman D on this session could cause the session to be killed sooner.

Ora-00031:session marked for kill handles a lock that cannot be killed in Oracle

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.