SQL> select owner, object_name,object_type from dba_objects where status ='INVALID';
OWNER
--------------------------------------------------------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_TYPE
-----------------------
SOE
ORDERENTRY
PACKAGE BODY
SQL> alter package SOE.ORDERENTRY compile body;
Warning: Package Body altered with compilation errors.
SQL> show errors;
Errors for PACKAGE BODY SOE.ORDERENTRY:
LINE/COL ERROR
-------- -----------------------------------------------------------------
89/11 PL/SQL: Statement ignored
89/11 PLS-00201: identifier 'DBMS_LOCK' must be declared
92/11 PL/SQL: Statement ignored
92/11 PLS-00201: identifier 'DBMS_LOCK' must be declared
SQL> grant execute on SYS.DBMS_LOCK to soe;
Grant succeeded.
SQL> alter package SOE.ORDERENTRY compile body;
Package body altered.
SQL> select owner, object_name,object_type from dba_objects where status ='INVALID';
no rows selected
Other related commad
Alter procedure . compile;
Alter function . compile;
Alter package . compile;
Alter package . compile body;
Alter package . compile body;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26611303/viewspace-1180784/
,如需转载,请注明出处,否则将追究法律责任。