Ora-00054: resource busy and acquire with nowait specified solution, ora-00054nowait
When a database user inserts, updates, or deletes data from a table in a database, or adds a table's primary key, or the table's index, a ora-00054 often occurs: resource busy and acquire with nowait specified errors.
It is mainly because a transaction is being executed (or the transaction has been locked), which leads to execution failure.
1. Users with dba permissions can view database locks
Select t2.username, t2.sid, t2.serial #, t2.logon _ time
From v $ locked_object t1, v $ session t2
Where t1.session _ id = t2.sid order by t2.logon _ time;
Example: testuser 339 13545 17:40:05
Testuser, whose sid is 339 and serial # Is 13545
2. view the specificSQLStatement. If SQL is not important, kill it.
Select SQL _text from v $ session a, v $ sqltext_with_newlines B
Where DECODE (a. SQL _hash_value, 0, prev_hash_value, SQL _hash_value) = B. hash_value
And a. sid = & sid order by piece;
The SQL statement, for example, begin: id: = sys. dbms_transaction.local_transaction_id; end;
3. kill the transaction
Alter system kill session '00000045 ';
4. You can execute other transaction SQL statements.
For example, add the table's primary key:
Alter table test
Add constraint PK_test primary key (test_NO );