Pages

Monday, November 24, 2014

Compile a Invalid Database Object

CREATE OR REPLACE PROCEDURE Dpr_Compile_Obj
IS

CURSOR obj_cur IS
SELECT object_type,object_name
FROM user_objects
WHERE status = 'INVALID'
AND object_type IN ('PROCEDURE','FUNCTION','PACKAGE','PACKAGE_BODY','VIEW','TRIGGER')
ORDER BY object_type,object_name;

BEGIN
FOR obj_rec IN obj_cur LOOP
DBMS_DDL.ALTER_COMPILE (obj_rec.object_type,user,obj_rec.object_name);
END LOOP;
END;
/

No comments:

Post a Comment