首页 > 数据库 > Oracle > oracle编译无效对象
select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type
from dba_objects
where status='INVALID' order by owner,object_type;
1. Oracle SQL *Plus 中 —— 用 spool 生成脚本文件,然后 @ 调入执行,代码如下:
spool ExecCompProc.sql
select 'alter procedure '||object_name||' compile;' from all_objects
where status = 'INVALID' and object_type = 'PROCEDURE' AND owner='UNMI';
spool off
@ExecCompProc.sql;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22036495/viewspace-1058869/ ,如需转载,请注明出处,否则将追究法律责任。