lunes, 26 de agosto de 2013

How to recreate Oracle 11gR2 Repository

Oracle Database: 11.2.0.3
OS: Redhat 5.3

1) Recreate Oracle repository is an easy job, but sometimes is problematic. Try to resolve your OEM problem without recreate it unless you waste all the others options with no luck.

2) First of all, check that database is up and running, listener must be up and running too and register with database and ORACLE_SID is set.

3) You should drop SYSMAN user, and its roles and views to avoid "CONFIG: ORA-20001: SYSMAN already exists" error. To do it connect as sysdba user and run:

drop user sysman cascade;
drop public synonym setemviewusercontext;
drop role mgmt_user;
drop public synonym mgmt_target_blackouts;
drop user mgmt_view;

3) now we can drop the repository,exit of sqlplus and run:

$ emca -deconfig dbcontrol db -repos drop

*If you are in RAC, you should drop repository with this command in every node or
$ emca -deconfig dbcontrol db -repos drop -cluster (from primary node)
** You can check the logs under $ORACLE_HOME/cfgtoollogs/emca/


Be carefull, you will be question if you want to continue but with a Warning.
———————————————————————————————————————————
WARNING : While repository is dropped the database will be put in quiesce mode.
———————————————————————
————————————————————
Do you wish to continue? [yes(Y)/no(N)]: Y


That Warning means that only sys and syman users can connect and work (only for maintaince purpose)

SQL> select status,active_state from v$instance;
STATUS       ACTIVE_ST
————       ———
———
OPEN           QUIESCED
To avoid this situation, you can unquiesce database with:

SQL> alter system unquiesce; 

If you need to run again in quiescing mode, run again:

SQL> Alter system quiesce restricted;

In Example:
SQL> Alter system quiesce restricted;
Sistema modificado.

SQL> select status,active_state from v$instance;
STATUS       ACTIVE_ST
------------    ---------
OPEN            QUIESCED

SQL> alter system unquiesce;
Sistema modificado.

SQL> select status,active_state from v$instance;
STATUS       ACTIVE_ST
------------    ---------
OPEN            NORMAL

4) After drop repository finish, we can create the new one:

$ emca -config dbcontrol db -repos create

*In RAC will be:

$ emca -config dbcontrol db -repos create -cluster

5) Now you can start OEM executing "emctl start dbconsole"


No hay comentarios:

Publicar un comentario