I am curious to know what does Oracle do internally when we issue for ex. alter procedure xyz compile;
Will it just check for the syntax, depending objects availability, and required privileges?
What happens if one of the depending objects (table) is locked by other session? It compile with errors or waits till the lock released or it won't care about the locked objects?
I haven't find any useful information in google as well as in Metalink so posting here for experts comments.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
I think it's like compiling a program unit for lexical, syntax and semantics analysis.
it goes beyond that... checks referenced objects are there, remote connectivity over eventual dblink is available, number and type of input parameters is correct, etc.
Only possible locking situation would be a library cache lock when the object being compiled is in use.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Thanks Malay, I do have the same understanding but the other DBA in my team had the problem with compiling a procedure and he said he found some other session locking one of the referencing tables and when he killed that session he is able to compile. He is not clear what type of lock it is. As PAVB said it might be library cache lock.
I will wait for the same situation and check what type of lock is stopping compilation.
Thanks all for your inputs.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
... other DBA in my team had the problem with compiling a procedure and he said he found some other session locking one of the referencing tables and when he killed that session he is able to compile. He is not clear what type of lock it is. As PAVB said it might be library cache lock.
this only makes sense if offending session was executing the very same procedure your fellow DBA was attempting to compile. It wasn't a table lock, it was library cache lock.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks