Get the App
SLTechnology News&Howtos  ›  Database  › 

The processing method of Oracle error ORA-00031: session marked for kill

Shulou Source: shulou.com Published: 2022-05-31 14:17:04 10月03日 Update

This article introduces the processing method of Oracle error report ORA-00031: session marked for kill, the content is very detailed, interested friends can refer to, hope to be helpful to you.

After some processes in ORACLE are killed, the status is set to "killed", but the locked resources are not released for a long time, and sometimes there is no choice but to restart the database. Now provide a way to solve this problem, that is, can not kill in the ORACLE, kill 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

two。 The following statement is used to kill a process:

Alter system kill session '24111; (of which 24111 are the sid,serial# queried above)

[note] the above two steps can be performed through the Oracle management console.

3. If the process state is set to "killed" after killing a process using the above command, but the locked resource has not been released for a long time, then you can kill the corresponding process (thread) at the os level, and first execute the following statement to get the process (thread) number:

Select spid, osuser, s.program

From v$session spark vested process p

Where s.paddr=p.addr and s.sid=24 (24 is the sid above)

4. Kill the process (thread) on OS:

1) on unix, execute the command as root:

# kill-9 12345 (i.e. the spid queried in step 3)

2) in windows (unix is also applicable), kill the thread with orakill. Orakill is an executable command provided by oracle. The syntax is:

Orakill sid thread

Where:

Sid: indicates the instance name to which the process to be killed belongs

Thread: is the thread number to be killed, that is, the spid queried in step 3.

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.

Select t.objectroomnamerecovert.argumentroomnamerecovery.dataroomtyperet.indistinct out from all_arguments t where t.ownershipSATGE' and T.objectsand namebooks SPOBUBTABSTSYSSYSDROPATIOPARTRACTCFG'

Kill-9 12345

On the Oracle error ORA-00031: session marked for kill processing methods to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Processes threads faceted queries methods commands statements processing content more status resources long-term help good interest methods can pass instance object Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft MariaDB Shulou Information vpn Redmi