Use Plsql to modify data, Quote ORA-00054: Resource is busy, but specify nowait to get resources, or timeout expires

Source: Internet
Author: User

Java small rookie one, remember the interviewer once asked me a question, is that you use SQL statements, in addition to write and delete changes, but also wrote what other orders did not, at that time really do not remember, so I intend to record, before the interview look, be prepared.

Previously used MySQL, not how to use Oracle, the company's project use of Oracle, think it is MySQL convenient ah, haha haha

Before the question, and now check the solution, presumably this is the

1. Wait for another resource to be released, add online in the Create statement, and the statement will execute automatically when the resource is freed. This method is used to plug the way, do not error.

This is not the right statement for me, my statement is

An UPDATE statement that cannot be used in this way.

2. Identify the resources that are occupied and delete them.

First find the Locked object and locate which one to use.

Select L.session_id,o.owner,o.object_name

From V$locked_object l,dba_objects o

where l.object_id=o.object_id

Locate which sessions need to be deleted by comparing the indexes you want to create

and find out all the indexes that caused the lock.

Finally kill all the resources that are in the reply.

Command form:

Alter system kill session ' sid,serial# ';

Alter system kill session ' 331,4900 ';

Restart the database.

If the data is not important, you can restart the database to roll back all uncommitted transactions and release the resources

The above is a reference to Baidu experience, and added some practice.

Use Plsql to modify data, Quote ORA-00054: Resource is busy, but specify nowait to get resources, or timeout expires

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.