-- 编译所有oracle无效的对象 by yanleigis Email:landgis@126.com
procedure compleall is
cursor c1 is
SELECT decode(object_type,
'PACKAGE BODY',
'alter package ' || object_name || ' compile body',
'alter ' || object_type || ' ' || object_name ||
' compile;') op
FROM user_objects
WHERE status = 'INVALID';
sqlstr varchar2(1024);
begin
for rr in c1 LOOP
begin
sqlstr := rr.op;
execute immediate sqlstr;
dbms_output.put_line(sqlstr || '编译成功');
exception
when others then
dbms_output.put_line(sqlstr || sqlcode || ':' || sqlerrm);
end;
end loop;
end;
编译所有oracle无效的对象
最新推荐文章于 2021-04-13 14:22:34 发布