Solved

ORA-04021: timeout occured while waiting to lock object

Posted on 2001-07-05
6
602 Views
Last Modified: 2007-11-27
I get the following error when trying to reload or drop a specific Java class <classname> from an Oracle 8.1.7 DB using the loadjava or dropjava utility...

ORA-04021: timeout occured while waiting to lock object <classname>

As far as I know, the class is not in use by anything else.  I still continue to get this message after about a day of waiting.  Why might this be happening and more importantly, how can I stop this error from occuring?

Thanks!
0
Comment
Question by:basilisk14
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:vanmeerendonk
ID: 6255812
I think a session is still having a lock on your object.
Try viewing v$lock if this is true.
Kill the session that is locking your object.

If the session doesn't disappear and is marked for being killed and the PMON hasn't enough resources to clear the session, you have to bring down the dbase. (or try using the ORAKILL utility, see metalink).
0
 

Author Comment

by:basilisk14
ID: 6255993
Could you please clarify about how I would go about doing these things?  I am not the DBA, but I could let him know the solution if it is more specific.  Thanks.
0
 

Author Comment

by:basilisk14
ID: 6256004
Could you please clarify about how I would go about doing these things?  I am not the DBA, but I could let him know the solution if it is more specific.  Thanks.
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 2

Accepted Solution

by:
vanmeerendonk earned 50 total points
ID: 6258508
sorry, it was midnight when You asked me.
Well, with
select s.sid
,substr (s.osuser, 1, 10) username, substr (o.object_name, 1, 20) object
,      l.lmode, s.process, substr(s.program, 1, 25) program
from   v$lock l, all_objects o, v$session s
where  o.object_id = l.id1
and    s.sid       = l.sid
and l.type = 'TM'
 
you can look at the locks. With
ALTER SYSTEM KILL SESSION '<SID>,<SERIAL#>'
you kill the session.

But with all of the above you have to have the appropriate grants! I think it's better for you to identify the lock and inform the DBA (he really should know what to do)

As a developer there's nothing more to do that identify and wait.

0
 

Author Comment

by:basilisk14
ID: 6260057
When I run the query I get "table or view does not exist".  Do you know why that might be?
0
 

Author Comment

by:basilisk14
ID: 6275300
Sorry for the delay...thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to take different types of Oracle backups using RMAN.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question