ORA-39082: Object type ALTER_PROCEDURE:“”.“” created with compilation warnings
sys用户查看无效对象:
select owner,object_name,object_type,status
from dba_objects
where status !='VALID'
and owner not in ('SYS','SYSTEM')
编译无效对象:
view: alter view view_name compile;
function: alter function function_name compile;
procedure: alter procedure procedure_name compile;
如果很多,查询出来复制到sql文件中执行
select 'alter '||object_type||' '||owner||'.'||object_name||' compile;'
from dba_objects
where status !='VALID'
and owner not in ('SYS','SYSTEM')
SQL> @C:/alter.sql
show error 的用法:
编译view出现问题:
alter view view_name compile;
Warning:view view_name with compilation errors.
SQL>show errors view view_name
Errors for view view_name: