Ora-00054: Resource busy and acquire with Nowait specified Solution

Source: Internet
Author: User

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 );

5,If prompted: ORA-00030: user session ID does not exist

Alter session set events 'immediate trace name flush_cache level 1 ';

Unknown consequences

ORA-00031: session marked for kill

After some Oracle processes are killed, the state is set to "killed", but the locked resources are not released for a long time. Sometimes there is no way to restart the database. Now we provide a way to solve this problem, that is, it cannot be killed in Oracle, and it can be killed again at the OS level.

ora-00054: Resource busy and acquire with Nowait specified solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.