Wednesday, August 5, 2009

Compile All Views

set lines 130 pages 9999
spool comp_all_views
select 'alter view 'owner'.'object_name' compile;' from dba_objects where owner = 'MBAPT' AND status like 'INVALID' and object_type like 'VIEW';
spool off

connecting to db using pl/sql

EXECUTE IMMEDIATE ('CONN SCHEMA/PASSWORD@INSTANCE');