Getting ORA-00054 error in SQL Developer

血红的双手。 提交于 2019-12-25 16:55:05

问题


I'm getting this error when trying to DROP a table.

I've googled and googled and tried all possible solutions to the best of my abilities but none of them have worked for me so far.

This is the error I'm getting:

Error starting at line : 1 in command -
DROP TABLE INTEREST
Error report -
SQL Error: ORA-00054: resource busy and acquire with NOWAIT specified
00054. 00000 -  "resource busy and acquire with NOWAIT specified"
*Cause:    Resource interested is busy.
*Action:   Retry if necessary.

Keep in mind I'm not that knowledgable about SQLDeveloper or SQL itself so please try and be as elaborate as possible.

Thank you!


回答1:


ORA-00054: resource busy and acquire with NOWAIT specified

The error is clear that there is a session which manipulated the table, i.e. a DML statement was executed, however, there was no COMMIT or ROLLBACK issued. And, you are trying to DROP the table from another session.

Note that, when you open multiple tabs, i.e. when you Open multiple SQL worksheets, there are different sessions.

A small demo to reproduce and fix your issue:

SESSION# 1

SQL> create table t(a number);

Table created.

SQL> insert into t select 1 from dual;

1 row created.

SQL>

So, I did an INSERT in SESSION# 1 and have not commit it yet.

SESSION# 2

SQL> drop table t purge;
drop table t purge
           *
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired


SQL>

So, when I tried to drop the table in session 2, I get the error.

To fix it, either COMMIT or ROLLBACK session# 1.

SESSION# 1

SQL> commit;

Commit complete.

SQL>

SESSION# 2

SQL> drop table t purge;

Table dropped.

SQL>


来源:https://stackoverflow.com/questions/29603267/getting-ora-00054-error-in-sql-developer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!