?
Solved

locked package in pl/sql developer

Posted on 2001-08-27
4
Medium Priority
?
1,317 Views
Last Modified: 2013-12-12
I am compiling a package xxxx using pl/sql developer and getting the error

"ORA-04021 Timeout occurred while waiting to lock object xxxx"

I just can?t pass that message and get to compile it ..

any idea?
1-It happened to me several days ago and despaired by itself ...
Thanks
Orna
0
Comment
Question by:ofarzalla
[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 Comments
 

Expert Comment

by:gvalencia
ID: 6429985
Probably, While you are trying to compile your package, it is being used by another session.

Execute this select statement to determine wheter the package is locked or not. If so you'll see it in column object_name.

select
     vs.SID           ,
     vs.SERIAL#       ,
     uo.OBJECT_NAME   ,
     uo.OBJECT_TYPE   ,        
     uo.OBJECT_ID     ,      
     substr( vs.USERNAME, 1, 20 )  USERNAME    ,
     vs.STATUS        ,
     vs.SCHEMANAME    ,
     substr( vs.OSUSER, 1, 20 )   OSUSER      ,
     vs.MACHINE       ,
     vs.TERMINAL      ,
     vs.PROGRAM       ,
     vs.TYPE                
from
     v$session         vs,
     v$locked_object   vlo,
     all_objects       uo
where
     vlo.object_id  =   uo.object_id
and     vs.process     =   vlo.process;
0
 

Author Comment

by:ofarzalla
ID: 6430437
I tried to run the select but getting
v$locked_object   does not exist
???
0
 
LVL 4

Expert Comment

by:dda
ID: 6430648
This select is intended to be run under 'sys' user.
0
 
LVL 3

Accepted Solution

by:
Wadhwa earned 300 total points
ID: 6430818
Hi,
This error is mostly comes when some other user or session is executing the package.

At the time when you get this error , open the session with sys user and try to execute the following sql.

select sid,owner,object,type from v$access
WHERE object = '<package>';

if it returns someting , it means the packages is executed by that session.

You will able to compile the package successfully by either killing that session or waiting the session to finish execution.

Hope this helps
Sam..
   
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…
Suggested Courses

752 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