Problem: MGMT_USER

Problem: MGMT_USER

How do I recreate the MGMT_USER package?  I ran catproc.sql and it didn’t work.  I’m on Oracle 10.2.0


Solution: MGMT_USER

I came up with this thread from a user blog.  MGMT_USER is needed for Enterprise Manager, so if you are not using EM, my opinion is that it may be dropped (along with the user and role).

Problem Description After upgrading the database containing dbconsole’s repository whenever you try to logon to Enterprise Manager or DBCONSOLE it succeed but return with error,

Authentication failed!null

In the trace file I saw the following entry,
ERROR = ORA-04063: package body “SYSMAN.MGMT_USER” has errors
ORA-06508: PL/SQL: could not find program unit being called: “SYSMAN.MGMT_USER”
ORA-06512: at “SYSMAN.SETEMUSERCONTEXT”, line 5
ORA-06512: at line 1

Cause of The Problem
This error occured due to following reasons,

The package MGMT_USER is invalid in the database.

Other Invalid objects under SYSMAN schema remain after the upgrade of the database.

Missing privileges for SYSMAN user which prevents the compilation of MGMT_USER
package, and other packages aswell.

Solution of The Problem
Grant the required privilege to the SYSMAN user,
GRANT EXECUTE ON SYS.DBMS_AQ TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_JOB TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_LOB TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_LOCK TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_REDEFINITION TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_RLS TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_SHARED_POOL TO SYSMAN;
GRANT SELECT ON SYS.USER_TAB_COLUMNS TO SYSMAN;
And try to reconnect to dbconsole.