Thursday, January 10, 2008

Regenerate Database Console repository

Thursday, January 10, 2008 Posted by Andre Broers
After an installation of a new Oracle Home and complete restore of the database it is nescesary to regenerate the Database Console repository to use the Enterprise Manager.

[oracle@centos ~]$ . oraenv
ORACLE_SID = [orcl] ? orcl
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle

create a password file:

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=<password>

and check the parameter remote_login_password:

[oracle@centos db_1]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jan 10 19:15:47 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter password

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL>

if this is not exclusive, change it and restart the database. After this you can connect as sysdba over tns.

It is nescesary to recreate the repository because with the reintall of oracle we lost the repository key. which is located in the oracle_home. First thing to do is drop the repository:

[oracle@centos db_1]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jan 10, 2008 8:12:36 PM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Jan 10, 2008 8:12:46 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2008_01_10_20_12_36.log.
Jan 10, 2008 8:12:48 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jan 10, 2008 8:13:01 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jan 10, 2008 8:20:33 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jan 10, 2008 8:21:04 PM
[oracle@centos db_1]$

Now we can recreate the repository.

[oracle@centos db_1]$ emca -config dbcontrol db -repos create

STARTED EMCA at Jan 10, 2008 8:24:25 PM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional): <my mail>
Outgoing Mail (SMTP) server for notifications (optional): centos.bekijkhet.com
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.1.0/db_1

Local hostname ................ centos.bekijkhet.com
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ............... <my mail>
Outgoing Mail (SMTP) server for notifications ............... centos.bekijkhet.com

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jan 10, 2008 8:24:50 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2008_01_10_20_24_25.log.
Jan 10, 2008 8:24:54 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jan 10, 2008 8:38:28 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jan 10, 2008 8:38:57 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jan 10, 2008 8:42:16 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jan 10, 2008 8:42:25 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Jan 10, 2008 8:42:25 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Jan 10, 2008 8:42:49 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Jan 10, 2008 8:42:49 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jan 10, 2008 8:43:17 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jan 10, 2008 8:43:17 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jan 10, 2008 8:45:47 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jan 10, 2008 8:45:47 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://centos.bekijkhet.com:1158/em <<<<<<<<<<<
Jan 10, 2008 8:46:42 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.1.0/db_1/centos.bekijkhet.com_orcl/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jan 10, 2008 8:46:42 PM
[oracle@centos db_1]$

Be sure to backup your system including the emkey.ora file!