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