Created
November 11, 2011 17:14
-
-
Save felclef/1358582 to your computer and use it in GitHub Desktop.
Compilar todos os objetos no Oracle...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
for cur_rec in | |
( | |
select | |
object_name, | |
object_type | |
from | |
user_objects | |
where | |
status <> 'VALID' | |
order by | |
case | |
when object_type = 'PACKAGE' then 0 | |
else 1 | |
end | |
) | |
loop | |
begin | |
if cur_rec.object_type = 'PACKAGE BODY' then | |
execute immediate 'ALTER PACKAGE "' || cur_rec.object_name || '" COMPILE BODY'; | |
else | |
execute immediate 'ALTER ' || cur_rec.object_type || '"' || cur_rec.object_name || '" COMPILE'; | |
end if; | |
exception | |
when others then | |
dbms_output.put_line('Não foi possível compilar: ' || cur_rec.object_type || ' : ' || cur_rec.object_name); | |
dbms_output.put_line(' >>> ' || sqlerrm); | |
dbms_output.put_line('- - - - -'); | |
end; | |
end loop; | |
end; | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment