DBA Tips Archive for Oracle

  


[an error occurred while processing this directive]

No Title

[an error occurred while processing this directive]

by Michael New, MichaelNew@earthlink.net, Gradation LLC

Contents

Introduction

This article provides steps-by-step details on how to create, drop and recreate the Database Control Repository and configuration files in an Oracle 10g or Oracle 11g database.

Create Database Console

To create the configuration files and repository for Database Console, run:


$ emca -config dbcontrol db -repos create STARTED EMCA at Jul 24, 2006 9:59:39 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle. All rights reserved. Enter the following information: Database SID: TESTDB Listener port number: 1521 Password for SYS user: change_on_install Password for DBSNMP user: manager Password for SYSMAN user: manager Email address for notifications (optional): Outgoing Mail (SMTP) server for notifications (optional): ----------------------------------------------------------------- You have specified the following settings Database ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1 Database hostname ................ linux3 Listener port number ................ 1521 Database SID ................ TESTDB Email address for notifications ............... Outgoing Mail (SMTP) server for notifications ............... ----------------------------------------------------------------- Do you wish to continue? [yes(Y)/no(N)]: Y Jul 24, 2006 10:00:12 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/TESTDB/emca_2006-07-24_09-59-39-PM.log. Jul 24, 2006 10:00:15 PM oracle.sysman.emcp.EMReposConfig createRepository INFO: Creating the EM repository (this may take a while) ... Jul 24, 2006 10:05:51 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully created Jul 24, 2006 10:06:01 PM oracle.sysman.emcp.util.DBControlUtil startOMS INFO: Starting Database Control (this may take a while) ... Jul 24, 2006 10:07:49 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration INFO: Database Control started successfully Jul 24, 2006 10:07:49 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration INFO: >>>>>>>>>>> The Database Control URL is http://linux3:1158/em <<<<<<<<<<< Enterprise Manager configuration completed successfully FINISHED EMCA at Jul 24, 2006 10:07:49 PM

Drop Database Console

To drop (remove) the configuration files and repository for Database Console, run:


$ emca -deconfig dbcontrol db -repos drop STARTED EMCA at Jul 24, 2006 9:53:55 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle. All rights reserved. Enter the following information: Database SID: TESTDB Listener port number: 1521 Password for SYS user: change_on_install Password for SYSMAN user: manager Do you wish to continue? [yes(Y)/no(N)]: Y Jul 24, 2006 9:54:15 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/TESTDB/emca_2006-07-24_09-53-55-PM.log. Jul 24, 2006 9:54:16 PM oracle.sysman.emcp.util.DBControlUtil stopOMS INFO: Stopping Database Control (this may take a while) ... Jul 24, 2006 9:54:35 PM oracle.sysman.emcp.EMReposConfig dropRepository INFO: Dropping the EM repository (this may take a while) ... Jul 24, 2006 9:56:48 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully dropped Enterprise Manager configuration completed successfully FINISHED EMCA at Jul 24, 2006 9:56:48 PM

Recreate Database Console

To recreate the configuration files and repository for Database Console, run:


$ emca -config dbcontrol db -repos recreate STARTED EMCA at Jul 24, 2006 10:08:20 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle. All rights reserved. Enter the following information: Database SID: TESTDB Database Control is already configured for the database TESTDB You have chosen to configure Database Control for managing the database TESTDB This will remove the existing configuration and the default settings and perform a fresh configuration Do you wish to continue? [yes(Y)/no(N)]: Y Listener port number: 1521 Password for SYS user: change_on_install Password for DBSNMP user: manager Password for SYSMAN user: manager Email address for notifications (optional): Outgoing Mail (SMTP) server for notifications (optional): ----------------------------------------------------------------- You have specified the following settings Database ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1 Database hostname ................ linux3 Listener port number ................ 1521 Database SID ................ TESTDB Email address for notifications ............... Outgoing Mail (SMTP) server for notifications ............... ----------------------------------------------------------------- Do you wish to continue? [yes(Y)/no(N)]: Y Jul 24, 2006 10:08:50 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/TESTDB/emca_2006-07-24_10-08-20-PM.log. Jul 24, 2006 10:08:53 PM oracle.sysman.emcp.util.DBControlUtil stopOMS INFO: Stopping Database Control (this may take a while) ... Jul 24, 2006 10:09:29 PM oracle.sysman.emcp.EMReposConfig dropRepository INFO: Dropping the EM repository (this may take a while) ... Jul 24, 2006 10:11:23 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully dropped Jul 24, 2006 10:11:23 PM oracle.sysman.emcp.EMReposConfig createRepository INFO: Creating the EM repository (this may take a while) ... Jul 24, 2006 10:15:09 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully created Jul 24, 2006 10:15:18 PM oracle.sysman.emcp.util.DBControlUtil startOMS INFO: Starting Database Control (this may take a while) ... Jul 24, 2006 10:17:21 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration INFO: Database Control started successfully Jul 24, 2006 10:17:22 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration INFO: >>>>>>>>>>> The Database Control URL is http://linux3:1158/em <<<<<<<<<<< Enterprise Manager configuration completed successfully FINISHED EMCA at Jul 24, 2006 10:17:22 PM

Using EMCA with Real Application Clusters

In this section, I will be using two Database Control consoles running; one on linux1 and the other on linux2. From either of these consoles, you can manage and monitor all targets in the cluster.

Database will not Quiesce when Dropping Database Control

The Oracle database will be placed in quiesce mode when using emca to drop or recreate Database Console (dbconsole). For example, the following commands will quiesce database:


$ emca -deconfig dbcontrol db -repos drop $ emca -config dbcontrol db -repos recreate

Note that the Oracle database will not be placed in the quiesce state when creating database control.


$ emca -config dbcontrol db -repos create

When the Oracle database is put into a quiesced state, all user access will be temporarily halted. That being said, it is sometimes safer to manually drop the database control and then create it using emca which does not require downtime.

Perform the following steps to manually remove database control which does not place the database in a quiesced state.

  1. Remove any and all jobs for the SYSMAN user. For example:


    EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS();

  2. Log in as a DBA user and drop the following user accounts and roles.


    SQL> DROP USER sysman CASCADE; SQL> DROP ROLE mgmt_user; SQL> DROP USER mgmt_view CASCADE; SQL> DROP PUBLIC SYNONYM mgmt_target_blackouts; SQL> DROP PUBLIC SYNONYM setemviewusercontext;

  3. Drop public synonyms.

    Oracle Database 11g R1


    SQL> DROP PUBLIC SYNONYM mgmt_availability FOR mgmt_availability; SQL> DROP PUBLIC SYNONYM mgmt_availability;

    Oracle Database 11g R2


    DECLARE CURSOR c1 IS SELECT owner, synonym_name name FROM dba_synonyms WHERE table_owner = 'SYSMAN'; BEGIN FOR r1 IN c1 LOOP IF r1.owner = 'PUBLIC' THEN EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM ' || r1.name; ELSE EXECUTE IMMEDIATE 'DROP SYNONYM ' || r1.owner || '.' || r1.name; END IF; END LOOP; END; /

  4. Manually remove the following directories.


    ORACLE_HOME/host_sid/ ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_host_sid

    For example if ORACLE_HOME is /u01/app/oracle/product/11.2.0/dbhome_1, hostname is test1.idevelopment.info and ORACLE_SID is testdb1, then the above mentioned directories would be:


    /u01/app/oracle/product/11.2.0/dbhome_1/test1.idevelopment.info_testdb1 /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_test1.idevelopment.info_testdb1

  5. Verify that the ORACLE_HOME and ORACLE_SID are set and re-create database console.


    [oracle@test1 ~]$ echo $ORACLE_HOME /u01/app/oracle/product/11.2.0/dbhome_1 [oracle@test1 ~]$ $ORACLE_HOME/bin/emca -config dbcontrol db -repos create

Troubleshooting EMCA

If you have any problems when running emca, check the log file under:


ORACLE_HOME/cfgtoollogs/emca/<ORACLE_SID>/

Further Reading

Additional information on emca command-line options can be found in the Oracle Enterprise Manager 10g Advanced Configuration Guide. This guide is available from OTN at the following address http://download-east.oracle.com/docs/cd/B19306_01/em.102/b16242.pdf.

About the Author

Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.



Copyright (c) 1998-2017 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Wednesday, 05-Feb-2014 18:58:37 EST
Page Count: 128236