Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 616
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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