OEM 13c: emctl status failing with ORA-04063: package body "SYSMAN.MGMT_FAILOVER" has errors

 $OMS_HOME/bin/emctl status oms -details failled, below details from logfile

logfile:   gc_inst/em/EMGC_OMS1/sysman/log/emctl.log


Database 19c with PDB:


 ERROR oms.PrintOMSSetupInfo main.324 - Failed to find OMS details: ORA-04063: package body "SYSMAN.MGMT_FAILOVER" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYSMAN.MGMT_FAILOVER"
ORA-06512: at "SYSMAN.EM_OMS_PROPERTIES", line 37
ORA-06512: at line 1
java.sql.SQLException: ORA-04063: package body "SYSMAN.MGMT_FAILOVER" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYSMAN.MGMT_FAILOVER"
ORA-06512: at "SYSMAN.EM_OMS_PROPERTIES", line 37
ORA-06512: at line 1



Cause:

 SYSMAN.MGMT_FAILOVER object invalid and unable to compile due to dependent objects also invalid. One of the dependent object missing privileges. 

Solution: 

1) Check SYSMAN.MGMT_FAILOVER and other INVALID objects under SYSMAN user
        select object_name,owner from dba_objects where status='INVALID'
2) Grant missing privileges.
3) Compile dependent object and the finally SYSMAN.MGMT_FAILOVER object


SQL> alter package SYSMAN.MGMT_FAILOVER compile body;

Warning: Package Body altered with compilation errors.
SQL> show error
Errors for PACKAGE BODY SYSMAN.MGMT_FAILOVER:
LINE/COL ERROR
-------- -----------------------------------------------------------------
34/5     PL/SQL: Statement ignored
34/22    PLS-00905: object SYSMAN.MGMT_LOCK_UTIL is invalid -->dependent object invalid, try to compile
67/4     PL/SQL: Statement ignored
67/21    PLS-00905: object SYSMAN.MGMT_LOCK_UTIL is invalid
134/5    PL/SQL: Statement ignored
134/22   PLS-00905: object SYSMAN.MGMT_LOCK_UTIL is invalid
374/3    PL/SQL: Statement ignored
374/21   PLS-00905: object SYSMAN.MGMT_LOCK_UTIL is invalid
623/5    PL/SQL: Statement ignored
623/22   PLS-00905: object SYSMAN.MGMT_LOCK_UTIL is invalid
SQL> 
SQL> 
SQL> alter package SYSMAN.MGMT_LOCK_UTIL compile;

Warning: Package altered with compilation errors.

SQL> show error
Errors for PACKAGE SYSMAN.MGMT_LOCK_UTIL:

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      PL/SQL: Compilation unit analysis terminated
4/49     PLS-00201: identifier 'DBMS_LOCK' must be declared --> Grant missing for this object 


Login as sys user (PDB if its enabled) and grant privileges:

SQL> grant execute on dbms_lock to SYSMAN;

Grant succeeded.

SQL> 

SQL> alter package SYSMAN.MGMT_LOCK_UTIL compile body;

Package body altered.

SQL>  alter package MGMT_FAILOVER compile body;

Package body altered.

SQL>


Happy Troubleshooting 👊 

Post a Comment

0 Comments