1) Below is the Code to compile Invalids in the System
DECLARE
CURSOR c1
IS
SELECT object_name, object_type, status
FROM all_objects
WHERE status = 'INVALID'
AND owner = 'APPS'
AND object_type NOT IN ('MATERIALIZED VIEW');
-- AND object_type IN ('PACKAGE');
BEGIN
FOR i IN c1
LOOP
IF i.object_type IN ('PACKAGE', 'PACKAGE BODY')
THEN
BEGIN
EXECUTE IMMEDIATE 'alter Package ' || i.object_name || ' compile';
EXECUTE IMMEDIATE 'alter Package '
|| i.object_name
|| ' compile body';
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (i.object_name || ' - ' || SQLERRM);
END;
ELSE
BEGIN
EXECUTE IMMEDIATE 'alter '
|| i.object_type
|| ' '
|| i.object_name
|| ' compile';
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (i.object_name || ' - ' || SQLERRM);
END;
END IF;
COMMIT;
DBMS_OUTPUT.put_line (i.object_name || ' has been compiled !!!!');
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLERRM);
END;
2) Compile with utlrp.sql Script
Login to Putty
Host Name: <erpdbtst> --> Database Layer
Putty Credentials
User Name: <>
Password: <>
Login to SQLPLUS
User Name: <>
Password: <>
SQL> @?/rdbms/admin/utlrp.sql OR @$ORACLE_HOME/rdbms/admin/utlrp.sql
Screen for your reference
No comments:
Post a Comment