天天看点

Oracle 无效对象查询,编译无效对象

查看当前无效对象

select *
from  dba_objects t
where t.status = 'INVALID' order by 1;      

编译无效对象:

有两种方式:

1、执行sql查询结果:

select  'alter  '||object_type||'   '||owner||'.'||object_name||'   compile;'
from  dba_objects t
where t.status = 'INVALID' order by 1;      

2、脚本编译:

sqlplus / as sysdba @?/rdbms/admin/utlrp.sql      

本次分享到此结束啦~