Compilar objetos invalidos no Oracle

Um select pode garar o script para compilar objetos inválidos.

-- Objetos Invalidos
SELECT * FROM all_objects WHERE status <> 'VALID';
SELECT 'ALTER ' || object_type || ' ' || owner || '.' || object_name || ' compile;'  FROM all_objects WHERE status <> 'VALID' and object_type <> 'PACKAGE BOY';
SELECT 'ALTER ' || object_type || ' ' || owner || '.' || object_name || ' compile body;'  FROM all_objects WHERE status <> 'VALID' and object_type = 'PACKAGE BOY';

Anúncios