• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 618
  • Last Modified:

ORA-04021: timeout occured while waiting to lock object

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
basilisk14
Asked:
basilisk14
  • 4
  • 2
1 Solution
 
vanmeerendonkCommented:
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
 
basilisk14Author Commented:
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
 
basilisk14Author Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
vanmeerendonkCommented:
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
 
basilisk14Author Commented:
When I run the query I get "table or view does not exist".  Do you know why that might be?
0
 
basilisk14Author Commented:
Sorry for the delay...thanks.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now