Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Package hangs while compiling (2) (Oracle Packages)
Oracle Package hangs while compiling (2) [message #425242] Thu, 08 October 2009 04:08 Go to next message
Ankita06666
Messages: 2
Registered: October 2009
Location: New Delhi
Junior Member
Hi,
I have a package,I was able to compile the package recently..but from yesterday while compiling the session hangs.I have checked the package is not locked.
What could be the probable problem?
Re: Oracle Package hangs while compiling. [message #425244 is a reply to message #425242] Thu, 08 October 2009 04:12 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
How did you check for a lock on the package?

The most likely cause is that a session is using the package at the time you want to compile it.
Re: Oracle Package hangs while compiling (2) [message #425251 is a reply to message #425242] Thu, 08 October 2009 04:36 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It mostly happens when the object needs to compile or to reference itself to compile or the like.
You have to show what you show us the code and your session.

Regards
Michel
Re: Oracle Package hangs while compiling (2) [message #425275 is a reply to message #425251] Thu, 08 October 2009 06:51 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
That shouldn't be a problem for a package - compile the package and then the package body and you'll be fine - if you've got the dependencies in the body the wrong way round you'll get an error, not a hang.

Thinking about it, I reckon it's more likely that someone has got an object that depends on this package locked - to recompile the package you need to invalidate all the dependant objects, and if they're locked then you'll just have to wait.

Have you looked in v$session_wait to see what the hung session is waiting on?
Re: Oracle Package hangs while compiling (2) [message #425290 is a reply to message #425275] Thu, 08 October 2009 07:12 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
if you've got the dependencies in the body the wrong way round you'll get an error, not a hang.

It depends on the version, some hang.

Regards
Michel
Re: Oracle Package hangs while compiling (2) [message #425306 is a reply to message #425242] Thu, 08 October 2009 09:42 Go to previous messageGo to next message
BlackSwan
Messages: 24908
Registered: January 2009
Senior Member
One possible cause is when code does DML without any COMMIT or ROLLBACK.

Oracle refuses to allow code to change (recompile) when outstanding DML exists.
Re: Oracle Package hangs while compiling (2) [message #425330 is a reply to message #425242] Thu, 08 October 2009 11:30 Go to previous message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
the only time I have seen packages hang on compile is when the package is in use (as was stated above).

My best guess is you have another session using the package and that session has in waiting on something. Most likely it is one of your own old sessions.

Try getting rid of sessions by closing open tools. If all else fails, you can reboot your oracle instance to make sure there are no sessions that could have your package in use, then recompile.

Good luck, Kevin
Previous Topic: ora 22275
Next Topic: need in oracle
Goto Forum:
  


Current Time: Tue Sep 27 17:56:02 CDT 2016

Total time taken to generate the page: 0.12792 seconds