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

How to delete a locked table in Oracle

WBOY
Release: 2022-05-25 17:23:33
Original
4673 people have browsed it

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;
Copy after login

View the sid and serial of the locked table

#
select...from v$locked_object ,v$session
Copy after login

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#';
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template