Home >Database >Oracle >How to delete a locked table in Oracle

How to delete a locked table in Oracle

WBOY
WBOYOriginal
2022-05-25 17:23:334648browse

Method: 1. Use "select...from v$locked_object,v$session..." to view the sid and "serial#" of the locked table; 2. Use "alter system kill session 'sid" ,serial#" delete the locked table.

How to delete a locked table in Oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to delete a locked table in Oracle

1. Check the sid and serial# of the locked table:

Check which table is locked Lock:

The example is as follows

select b.owner,b.object_name,l.session_id,l.locked_mode
from v$locked_object l, dba_objects b
where b.object_id=l.object_id;

View the sid and serial of the locked table

#
select...from v$locked_object ,v$session

As shown in the figure:

How to delete a locked table in Oracle

2. Execute the following statement to delete the locked table

alter system kill session 'sid,serial#';

How to delete a locked table in Oracle

## Recommended tutorial: "

Oracle Video Tutorial

The above is the detailed content of How to delete a locked table in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn