Solved

locked package in pl/sql developer

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
create a nested synonym 4 28
Sybase and replication server 13 40
Read XML values 8 42
oracle sqlplus query delimiter 8 24
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

828 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