检查失效对象:
select owner,object_name,object_type from dba_objects where status = 'INVALID';
根据对象类型生成编译脚本
select 'alter '||object_type|| ' '||object_name||' compile;' from dba_objects where status = 'INVALID';
select 'alter '||object_type|| ' '||owner||'.'||object_name||' compile;' from dba_objects where status = 'INVALID';
复制查询结果 到command窗口批量执行。