ORA-00054: the resource is busy, but specify NOWAIT to get the resource, or timeout failure solution

Phenomenon: use sql statement to truncate the table, the prompt information is as follows: insert image description here
query the locked object:

 select session_id from v$locked_object;

insert image description here

Query the process that the database is waiting for the lock:

SELECT sid, serial#, username, osuser FROM v$session where sid = 7482;

insert image description here
Terminate the waiting process:

ALTER SYSTEM KILL SESSION '7482,3842';

insert image description here

Try the previous sql statement again:
insert image description here

Attachment:
Query the lock in the database

select * from v$lock;

Query the process that the database is waiting for the lock

select * from v$session where lockwait is not null;

Query lock wait event

select * from v$session_wait where event='enqueue';

Guess you like

Origin blog.csdn.net/qq_44624722/article/details/112462903