Solved

locked package in pl/sql developer

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

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

776 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