ORA-04021: timeout occured while waiting to lock object

Posted on 2001-07-05
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?

Question by:basilisk14
  • 4
  • 2

Expert Comment

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).

Author Comment

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.

Author Comment

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.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Accepted Solution

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
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.


Author Comment

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

Author Comment

ID: 6275300
Sorry for the delay...thanks.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

856 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