Who has locked my package?

This question I have frequently faced while developing packages/procedures in PL/SQL in Oracle. 


Question: How will I identify who has locked a procedure or a package. I need to identify this because it should not hang after the compilation is issued?


Answer: You may see the details from v$sql with the search text (Your package name). If the query fetches results then join it with v$session to get the session information.


select * 
from v$sql, v$session
where sql_address=address
and upper(sql_text) like '%PACKAGE_NAME%';


Hope this simple tip saves you some time.

No comments :

Post a Comment