Home » SQL & PL/SQL » SQL & PL/SQL » Reason for ORA-00054: resource busy and acquire with NOWAIT specified
Reason for ORA-00054: resource busy and acquire with NOWAIT specified [message #146033] |
Tue, 08 November 2005 04:55  |
sreek_s
Messages: 45 Registered: May 2005 Location: Andaman Nikobar
|
Member |
|
|
Hi,
I have a scenario where i need to execute some SQL queries in parallell. Infact the SQL query calls a PL/SQL procedure. Inside that procedure i have a "Truncate Table" command.
Problem is when i am trying to execute such SQL queries in parrallel it is throwing "ORA-00054: resource busy and acquire with NOWAIT specified" Error at the line where i am 'Truncating' the table.
How could i solve this problem when i am executing queries in parallel?
Regds,
Srikanth
|
|
|
|
|
|
|
Re: Reason for ORA-00054: resource busy and acquire with NOWAIT specified [message #146055 is a reply to message #146051] |
Tue, 08 November 2005 06:22   |
dmitry.nikiforov
Messages: 723 Registered: March 2005
|
Senior Member |
|
|
>>In this case will all the rows inserted by Session-2 also gets
>>deleted ?
The answer depends on does Session-2 commit before Session-1
deletes rows or not.
If yes - Session-1 sees changes made by Session-2 and rows,
inserted by Session-2 will be deleted. If not - Session-1
doesn't see these changes.
Compare 2 cases:
1-th
SQL> insert into t values(1,2);
1 row created.
2-th
SQL> delete from t;
0 rows deleted.
No commit, no deletion.
With commit:
1-th
SQL> insert into t values(1,2);
1 row created.
SQL> commit;
Commit complete.
2-th
SQL> delete from t;
1 row deleted.
2-th see rows which have been inserted before if commit has been done.
Rgds.
Oops, sorry, Maarten, I made some echo...
[Updated on: Tue, 08 November 2005 06:23] Report message to a moderator
|
|
|
|
Re: Reason for ORA-00054: resource busy and acquire with NOWAIT specified [message #146060 is a reply to message #146058] |
Tue, 08 November 2005 06:43   |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Please don't tell me you're creating and dropping objects on the fly! That's a very bad idea, IMO. You create the temporary table ONCE like you would create a normal table. You just don't have to clean up explicitly, you don't have to worry about users interfering with each other's data,....
If you want a table to exist only within your procedure, I'd consider a user defined SQL type or a PL/SQL table.
again, from these Fine Manuals | It is also possible to create a temporary table. The definition of a temporary table is visible to all sessions, but the data in a temporary table is visible only to the session that inserts the data into the table. You use the CREATE GLOBAL TEMPORARY TABLE statement to create a temporary table. The ON COMMIT keywords indicate if the data in the table is transaction-specific (the default) or session-specific:
- ON COMMIT DELETE ROWS specifies that the temporary table is transaction specific and Oracle truncates the table (delete all rows) after each commit.
- ON COMMIT PRESERVE ROWS specifies that the temporary table is session specific and Oracle truncates the table when you terminate the session.
This example creates a temporary table that is transaction specific:
CREATE GLOBAL TEMPORARY TABLE admin_work_area
(startdate DATE,
enddate DATE,
class CHAR(20))
ON COMMIT DELETE ROWS;
|
MHE
[edit: nasty typo]
[Updated on: Tue, 08 November 2005 06:43] Report message to a moderator
|
|
|
|
|
Re: Reason for ORA-00054: resource busy and acquire with NOWAIT specified [message #146557 is a reply to message #146401] |
Fri, 11 November 2005 01:07  |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Again, from the docs (note that this is the third time that I'm quoting from the documentation in the same thread):
Oracle9i SQL Reference Release 2 (9.2)Part Number A96540-02, Chapter 15: SQL Statements: CREATE SYNONYM to CREATE TRIGGER | Restrictions on Temporary Tables
- Temporary tables cannot be partitioned, clustered, or index organized.
- You cannot specify any foreign key constraints on temporary tables.
- Temporary tables cannot contain columns of nested table or varray type.
- You cannot specify the following clauses of the LOB_storage_clause: TABLESPACE, storage_clause, logging_clause, MONITORING or NOMONITORING, or LOB_index_clause.
- Parallel DML and parallel queries are not supported for temporary tables. (Parallel hints are ignored. Specification of the parallel_clause returns an error.)
- You cannot specify the segment_attributes_clause, nested_table_col_properties, or parallel_clause.
- Distributed transactions are not supported for temporary tables.
|
A link to the documentation is in the sticky on top of the newbie,SQL Experts and PL/SQL experts forums.
MHE
[Updated on: Fri, 11 November 2005 01:08] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Mar 14 09:21:30 CDT 2025
|