Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-04021: timeout occurred while waiting to lock object

784227Dec 8 2011 — edited Dec 8 2011
Hi,

DB 10.2.0.4

while trying to compile a package getting below error on every time,Ther are no locking.

ORA-04021: timeout occurred while waiting to lock object

Thanks
This post has been answered by Mark D Powell on Dec 8 2011
Jump to Answer

Comments

Mark D Powell
Answer
The package was in use. There are a couple of ways to find who is using a package at any given moment.

You can join v$session to dba_ddl_locks or you can use v$acess but you can see who is executing the package. The code cannot be recompiled while the code is in use.

HTH -- Mark D Powell --
Marked as Answer by 784227 · Sep 27 2020
Helios-GunesEROL
Hi;

For can root cause please see:
How to analyze ORA-04021 or ORA-4020 errors? [ID 169139.1]

Hope it helps

Regard
Helios
784227
Hi,

Thanks for reply.

There are two session id which are access same package in dba_ddl_locks, do i need to kill that session id?

Thanks
oradba
do i need to kill that session id?
I would first try to find out, WHO is behind this id.
Mark D Powell
It would have been nice if you had posted your query and results so we could make suggestions on how to improve the query or what you should check next.

Generally speaking if you submit a create or replace on a package and it takes longer than expected you can open a second session and query for usage. Depending on what you find determines your action.

If may be you just need to re-submit immediately or wait till a batch job completes. There could be a daemon (continuously running batch) job that you have stopped and re-started right after you make the change. It depends on your environment.

HTH -- Mark D Powell --
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 5 2012
Added on Dec 8 2011
5 comments
156,685 views