Forum OpenACS Q&A: Trezzo's recompile_all_objects for Oracle

Posted by Andrew Piskorski on
That is very cool about PG 7.2 having "create or replace". Just one note though, I don't know how smart PG is, but when you "create or replace" a function or view or whatever in Oracle, it will invalidate all other objects that depend on the thing you just replaced!

If you're lucky, you will never notice, because Oracle will attempt to recompile the invalidated objects in place the next time they are used. But if, say, you changed the interface to the function you just replaced, anything calling it will now break, and if replacing the function is all you do, you will probably not find out things are broken until runtime!

The solution to this (for Oracle) is Trezzo's super-useful recompile_all_objects PL/SQL procedure. After you make you changes, just do "exec recompile_all_objects" in sqlplus.