-
I have a cronjob that exports data from the DB and then truncates the tables. This job has worked fine for the past 6 months, but now I am getting the following errors. The export works good, and then BOOM. What exactly is a "nowait" and how can I fix it?
thanks,
Magnus
truncate table ACTIONS;
truncate table APP_TICKER;
truncate table CUST_DATA;
truncate table INVESTMENT_PLANNER;
truncate table ACTIONS
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
truncate table CUST_DATA
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
shamrock% oerr ORA 00054
00054, 00000, "resource busy and acquire with NOWAIT specified"
// *Cause: Resource interested is busy
// *Action: Retry if necessary
-
That means that someone has snuck in and started modifying data in your table. Whenever somebody has any type of write lock, you can't truncate.
Jeff Hunter
-
The way to fix it is to check for users with a lock on these tables and kill the sessions. This may or may not be appropriate for your environment, however!
D.
-
so ...
So the tables are being written to as my cronjob attempts to truncate the tables?
-
yes, jeff has correctly determined the source of your trouble; there is a write lock of some sort on the table. It could be DDL but more than likely is DML (e.g. update, insert, delete, or select for update).
D.
-
ok, but how?
what query do I need to run to see what session has locks on those tables?
do I just query the v$session table?
-
ah hah!
TOAD helped me out and I found the Locked sessions.
How can I research why it was locked tho?
- Magnus
-
I think you have to query v$lock, v$locked_object
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|