Solved

locked package in pl/sql developer

Posted on 2001-08-27
4
1,177 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
Comment Utility
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
Comment Utility
I tried to run the select but getting
v$locked_object   does not exist
???
0
 
LVL 4

Expert Comment

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

Accepted Solution

by:
Wadhwa earned 75 total points
Comment Utility
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.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

763 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

6 Experts available now in Live!

Get 1:1 Help Now