Jump to Navigation

171 - Recreate Oracle Enterprise Manager Repository

Sometimes you need to recreate Oracle Enterprise Manager repository and you got an error what you do not expect.

1. Check the version & drop the repository.

Login to the OS as the oracle dba user

#emca -version

emca -deconfig dbcontrol db -repos drop

If you got an ORA-01031 : insufficient privileges :

# cd $ORACLE_HOME/dbs

# orapwd file=orapw<sid> password=<password> entries=<specifiy a number of possible entries for the password file>

Ensure the database parameter remote_login_passwordfile is set to 'EXCLUSIVE'.

* Check enough space for SYSAUX tablespace.

If you do not have any errors :

SQL> alter tablespace SYSAUX add datafile '/oracle_path/SYSAUXxx.dbf' size 1024M;
# emca -deconfig dbcontrol db -repos drop

If you can not drop the repository with some error & hangup
or a create repos process stops with an error :

drop user sysman cascade;
drop role MGMT_USER;
drop user MGMT_VIEW cascade;

set heading off;
set feedback off;
set echo off;
eet lines 999;

spool run_invalid.sql

SELECT 'drop public synonym ' || a.object_name || ';' FROM all_objects a WHERE a.object_type='SYNONYM' AND a.owner = 'PUBLIC' AND a.STATUS = 'INVALID';

spool off;

set heading on;
set feedback on;
set echo on;

@run_invalid.sql

2. Create OEM repository.

#emca -config dbcontrol db -repos create

STARTED EMCA at Fri Mar 18 2011 1:52:05 PM
Enter the following information :

Database SID: PROD
Listener port number: 1521
Password for DBSNMP: xxxxxxx (dbsnmp/dbsnmp in Oracle apps)
Password for SYSMAN: xxxxxxx
Password for SYS: xxxxxxx
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):

3. Check invalid objects

SQL>SELECT a.object_name FROM all_objects a WHERE a.object_type='SYNONYM' AND a.owner = 'PUBLIC' AND a.STATUS = 'INVALID';

 

Oracle:


Main menu 2

Story | by Dr. Radut