Solved

locked package in pl/sql developer

Posted on 2001-08-27
4
1,189 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
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 75 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

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.

Question has a verified solution.

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

Suggested Solutions

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 …
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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…
Via a live example, show how to take different types of Oracle backups using RMAN.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now