db console reconfig

8
How To Drop, Create And Recreate the Database Control (DB Control) Release 10g and 11g (Doc ID 278100.1) Modified: 14-Nov-2012 Type: BULLETIN In this Document Purpose Scope Details DB Control options: A. Delete DB Control Objects: B. Create DB Control Objects C. Recreate/ReConfigure DB Control Documentation References APPLIES TO: Enterprise Manager for Oracle Database - Version 10.1.0.5 to 11.2.0.3 [Release 10.1 to 11.2] Information in this document applies to any platform. PURPOSE This article provides detailed instructions on how to A) create, B) drop and C)recreate the repository and configuration files for the DB Control application used to manage a single instance 10g or 11g Database. ATTENTION! After 31-Dec-2010, creating/recreating/securing 10.2.0.4/10.2.0.5 EM DB Control will fail due to the expiration of the Certificate Authority. More informations in: NOTE 1217493.1 ATTENTION: Patch Required If You Plan To Configure Enterprise Manager Database Control With Oracle Database 10.2.0.4 Or 10.2.0.5 On Or After 31-Dec-2010 NOTE 1222603.1 Recovering From Database Control Configuration Errors Due to CA Expiry on Oracle Database 10.2.0.4 or 10.2.0.5 SCOPE The steps in this article are written for a DBA or System Administrator who needs to create, drop or reconfigure the DB Control application. The format of the document will include steps for both 10.1, 10.2 and 11.x databases because the commands changed between these releases. For detailed instructions on DB Control on RAC, please consult also: Note 395162.1 - How to manage DB Control 10.2 for RAC Database with emca Note 578011.1 - How to manage DB Control 11.x for RAC Database with emca For examples of when to use the commands given in this note, see Note 1377211.1 - When to Use the Create/Drop Dbconsole Commands which are Given in Note:278100.1. Page 1 of 8 Document Display 12/30/2013 https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

Upload: sarfraz-khan

Post on 21-Oct-2015

22 views

Category:

Documents


0 download

DESCRIPTION

Db Console Reconfig

TRANSCRIPT

How To Drop, Create And Recreate the Database Control (DB Control) Release 10g and11g (Doc ID 278100.1)

Modified: 14-Nov-2012 Type: BULLETIN

In this Document

Purpose

Scope

Details

  DB Control options:

  A. Delete DB Control Objects:

  B. Create DB Control Objects

  C. Recreate/ReConfigure DB Control

  Documentation

References

APPLIES TO:

Enterprise Manager for Oracle Database - Version 10.1.0.5 to 11.2.0.3 [Release 10.1 to 11.2]Information in this document applies to any platform.

PURPOSE

This article provides detailed instructions on how to A) create, B) drop and C)recreate the repository andconfiguration files for the DB Control application used to manage a single instance 10g or 11g Database.

ATTENTION! After 31-Dec-2010, creating/recreating/securing 10.2.0.4/10.2.0.5 EM DB Control will fail dueto the expiration of the Certificate Authority. More informations in:NOTE 1217493.1 ATTENTION: Patch Required If You Plan To Configure Enterprise Manager DatabaseControl With Oracle Database 10.2.0.4 Or 10.2.0.5 On Or After 31-Dec-2010NOTE 1222603.1 Recovering From Database Control Configuration Errors Due to CA Expiry on OracleDatabase 10.2.0.4 or 10.2.0.5

SCOPE

The steps in this article are written for a DBA or System Administrator who needs to create, drop or reconfigurethe DB Control application. 

The format of the document will include steps for both 10.1, 10.2 and 11.x databases because the commandschanged between these releases.

For detailed instructions on DB Control on RAC, please consult also:Note 395162.1 - How to manage DB Control 10.2 for RAC Database with emcaNote 578011.1 - How to manage DB Control 11.x for RAC Database with emca

For examples of when to use the commands given in this note, seeNote 1377211.1 - When to Use the Create/Drop Dbconsole Commands which are Given in Note:278100.1.

Page 1 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

If you would like to discuss your issue with other Oracle Customers and Support Engineers, please feel free tojoin the discussion thread in the EM MOS Community:

DETAILS

DB Control options:

A. Delete DB Control Objects:

Option A.1.  Delete DB Control Configuration Files using EMCAOption A.2.  Delete DB Control Configuration Files ManuallyOption A.3.  Delete DB Control Repository Objects using RepManagerOption A.4.  Delete DB Control Repository Objects ManuallyOption A.5.  Delete DB Control Configuration Files and Repository Objects using EMCA

Option A.1. Delete DB Control Configuration Files using EMCA (Enterprise Manager ConfigurationAssistant):

DB Control 10.1.x

<ORACLE_HOME>/bin/emca -x <sid>

Page 2 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

DB Control 10.2.x and 11.x

<ORACLE_HOME>bin/emca -deconfig dbcontrol db

 

Important note: the option -deconfig removes the EM jobs from Scheduling before the DB Control isdeconfigured. Otherwise the repository, which is not dropped, could be corrupted or inconsistent if EM jobswere scheduled as the time the DB Control is dropped. It could also cause some errors during the DBControl deletion.

Option A.2. Delete DB Control Configuration Files Manually:

Remove the following directories from your filesystem:<ORACLE_HOME>/<hostname_sid><ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid>

If the database was upgraded, (for example from 10.2.0.3 to 10.2.0.4) then the following directory also needsto be removed from the file system:<ORACLE_HOME>/<hostname_sid>.upgrade<ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid>.upgrade

Never delete <ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole, just the specific directories above(based on hostname and SID).

NOTE: On Windows, the DB Console service needs to be removed as well:- run regedit- navigate to HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services- locate the OracleDBConsole<sid> entry and delete it

Alternatively on Windows XP and Windows Server 2003 you can run the following from the command line:'sc delete <service_name>'- where <service_name> is the DB Control service name (typically: OracleDBConsole<sid>)

OR use the command,

'nmesrvops delete <servicename>'- where <service_name> is the DB Control service name (typically: OracleDBConsole<sid>)

Also available from Microsoft is the delsrv.exe command. (Free download from Microsoft)

Option A.3. Delete DB Control Repository using RepManager:Use this option to automatically drop the DB Control repository on all database versions (10g/11g):

<ORACLE_HOME>/sysman/admin/emdrep/bin/RepManager <hostname> <listener_port> <sid> -action drop

 

Page 3 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

Warning: this command puts the database in Quiesce Mode for the DB Control Releases 10.x to11.1.x. Starting with DB Control Release 11.2.x, the database is no longer put in quiesce mode. Thefollowing note can be consulted for further details: 

Note 375946.1 Running EMCA Results in Database quiesce And No New Connections or Operations Can BePerformed During the DB Control Repository Creation

IMPORTANT: When dropping the repository with EMCA or RepManager on an 11.2 database, this warningwill be displayed:

WARNING : While repository is dropped the database will be put in quiesce mode.

This warning can be safely ignored (only on 11.2 databases).

Option A.4. Delete DB Control Repository Objects Manually

Method 1: Drop AQ related objects and DB Console repository object from the SYSMAN schema inquiesce mode:

- Run from SQLPLUS as user SYS (as SYSDBA):

SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE);SQL> SHUTDOWN IMMEDIATE;SQL> STARTUP RESTRICT;SQL> EXEC sysman.emd_maintenance.remove_em_dbms_jobs;SQL> EXEC sysman.setEMUserContext('',5);SQL> REVOKE dba FROM sysman;SQL> DECLARECURSOR c1 ISSELECT owner, synonym_name nameFROM dba_synonymsWHERE table_owner = 'SYSMAN';BEGINFOR r1 IN c1 LOOPIF r1.owner = 'PUBLIC' THENEXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;ELSEEXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;END IF;END LOOP;END;/SQL> DROP USER mgmt_view CASCADE;SQL> DROP ROLE mgmt_user;SQL> DROP USER sysman CASCADE;SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;

Note 1: On some versions (11.1 +), the SYSDBA role is no longer granted to SYSMAN account, so therespective statement may fail. This is not an issue and can be ignored.

Note 2: The above will completely delete the DB Control repository from the database; under certaincircumstances (e.g. you want to recreate the repository later on) the following statements will be sufficient toremove the repository:

Page 4 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

Method 2: Drop the repository schema and object (no quiesce):

Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects:

SQL> DECLARECURSOR c1 ISSELECT owner, synonym_name nameFROM dba_synonymsWHERE table_owner = 'SYSMAN';BEGINFOR r1 IN c1 LOOPIF r1.owner = 'PUBLIC' THENEXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;ELSEEXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;END IF;END LOOP;END;/SQL> DROP USER mgmt_view CASCADE;SQL> DROP ROLE mgmt_user;SQL> DROP USER sysman CASCADE;

Option A.5. Delete DB Control Configuration Files and Repository Objects using EMCA

For DB Control 10.1.x, dropping both the configuration files and the repository objects is a two step process. Run the following two commands:

<ORACLE_HOME>/bin/emca -x <sid><ORACLE_HOME>/sysman/admin/emdrep/bin/RepManager <hostname> <listener_port> <sid> -action drop

For DB Control 10.2.x and 11.x, both configuration files and repository objects can be deleted with a singlecommand.  Run the command:

<ORACLE_HOME>/bin/emca -deconfig dbcontrol db -repos drop

NOTE: If this option fails for some reason, options A.2 and A.4 should be used instead.

Warning: this command puts the database in Quiesce Mode for the DB Control Releases 10.x to11.1.x. Starting with DB Control Release 11.2.x, the database is no longer put in quiesce mode. Thefollowing note can be consulted for further details: 

Note 375946.1 Running EMCA Results in Database quiesce And No New Connections or Operations Can BePerformed During the DB Control Repository Creation

IMPORTANT: When dropping the repository with EMCA or RepManager on an 11.2 database, this warningwill be displayed:

WARNING : While repository is dropped the database will be put in quiesce mode.

This warning can be safely ignored (only on 11.2 databases).

Page 5 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

B. Create DB Control Objects

Option 1.  Create the DB Control Configuration FilesOption 2.  Create the DB Control Repository Objects and Configuration Files

Option B.1.  Create the DB Control Configuration FilesTo create only the DB Control configuration files, skipping the repository creation (this would be done forinstance if you dropped only the files and left the repository in place):

For DB Control 10.1.x

<ORACLE_HOME>/bin/emca -r

For DB Control 10.2.x and 11.x:

<ORACLE_HOME>/bin/emca -config dbcontrol db

Option B.2. Create the DB Control Repository Objects and Configuration Files

For DB Control 10.1.x

<ORACLE_HOME>/bin/emca

For DB Control 10.2.x and 11.x:

<ORACLE_HOME>bin/emca -config dbcontrol db -repos create

 

IMPORTANT: Before creating the DB Console Repository objects, make sure that the repository wasdropped using the steps in chapter A above..

 

C. Recreate/ReConfigure DB Control

Option 1.  Recreate the DB Control Configuration Files only (leave Repository intact)

Option 2.  Recreate the DB Control Configuration Files and Repository

In 10.2 and 11.x, the EMCA commands can be used to reconfigure the existing installs without removing themfirst.

Option C.1. Recreate the DB Control Configuration Files only (leave Repository intact):

For DB Control 10.2.x and 11.x, run the command:

Page 6 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

<ORACLE_HOME>/bin/emca -config dbcontrol db

Option 2. Recreate the DB Control Configuration Files and Repository

For DB Control 10.2.x and 11.x, run the command:

<ORACLE_HOME>/bin/emca -config dbcontrol db -repos recreate

 

Warning: this command puts the database in Quiesce Mode for the DB Control Releases 10.x to11.1.x. Starting with DB Control Release 11.2.x, the database is no longer put in quiesce mode. Thefollowing note can be consulted for further details: 

Note 375946.1 Running EMCA Results in Database quiesce And No New Connections or Operations Can BePerformed During the DB Control Repository Creation

IMPORTANT: When dropping the repository with EMCA or RepManager on an 11.2 database, this warningwill be displayed:

WARNING : While repository is dropped the database will be put in quiesce mode.

This warning can be safely ignored (only on 11.2 databases).

 

Documentation

Oracle Database 11g Release 2Available at: http://www.oracle.com/pls/db112/homepageOracle Database Administrator's Guide11g Release 2 (11.2) - Part Number E17120-06Topic: Configuring Database Control During and After Installation

Oracle Database 11g Release 1Available at http://www.oracle.com/pls/db111/homepageOracle Database Utilities11g Release 1 (11.1) - Part Number B28319-02Topic: Enterprise Manager Configuration Assistant (EMCA)

Oracle Database 10g Release 2Available at http://download.oracle.com/docs/cd/B16240_01/welcome.htmlOracle Enterprise Manager Grid Control Installation and Configuration Guide10g Release 5 (10.2.0.5.0) - Part Number E10953-14Topic: Understanding the Enterprise Manager Directories Installed with Oracle Database 10gTopic: Configuring Database Console During and After the Oracle Database 10g Installation

Page 7 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14

REFERENCES

NOTE:1217493.1 - ATTENTION - Enterprise Manager Database Control 10.2.0.4 Or 10.2.0.5 - Patch Requiredfrom 31-Dec-2010 onwardsNOTE:1222603.1 - Enterprise Manager Database Control Configuration - Recovering From Errors Due to CAExpiry on Oracle Database 10.2.0.4 or 10.2.0.5 [Video]NOTE:1377211.1 - When to Use the Create/Drop Dbconsole Commands which are Given in Note:278100.1NOTE:375946.1 - EMCA Release 10.1 to 11.1 Puts the Database in Quiesce And No New Connections orOperations Can Be Performed During the DB Control Repository CreationNOTE:395162.1 - How to manage DB Control 10.2 for RAC Database with emcaNOTE:456437.1 - Ora-24005 Error Trying To Drop User Sysman CascadeNOTE:578011.1 - How to manage DB Control 11.x for RAC Database with emca

Page 8 of 8Document Display

12/30/2013https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=11fsd5tld1_14