Deconfig Enterprise Manager
Deconfig Enterprise Manager
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 1/7
How To Drop, Create And Recreate the Database Control (DB Control)
Release 10g and 11g (Doc ID 278100.1)
Modified: 02-Feb-2014 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.
If you would like to discuss your issue with other Oracle Customers and Support Engineers, please feel free to join the
28/3/2014 Document Display
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 2/7
discussion thread in the EM MOS Community:
emca fails - cannot drop sysman account
i am trying to recreate the local DBConsole on rdbms 11gR2 running on WIN2k8 sp2
emca - config fails and when i try and drop the sysman account i get the following ora-0600
error
Problem Description
---------------------------------------------------
the following error occiurs when dropping user sysman -
drop user sysman cascade
Error at line 1
ORA-00600: internal error code, arguments: [kzdGenDropStmt], [24], [0], [], [], [], [], [], [], [],
[], []
Error Codes
---------------------------------------------------
ora-0600: arguments: [kzdGenDropStmt],
Problem Category/Subcategory
---------------------------------------------------
Other Database Admin (Config, Params, Memory, Dictionary, Scheduler, Processes,
user603091 Dec 12, 2013 11:34 PM
DETAILS
DB Control options:
A. Delete DB Control Objects:
Option A.1. Delete DB Control Configuration Files using EMCA
Option A.2. Delete DB Control Configuration Files Manually
Option A.3. Delete DB Control Repository Objects using RepManager
Option A.4. Delete DB Control Repository Objects Manually
Option A.5. Delete DB Control Configuration Files and Repository Objects using EMCA
Option A.1. Delete DB Control Configuration Files using EMCA (Enterprise Manager Configuration
Assistant):
DB Control 10.1.x
<ORACLE_HOME>/bin/emca -x <sid>
DB Control 10.2.x and 11.x
28/3/2014 Document Display
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 3/7
<ORACLE_HOME>bin/emca -deconfig dbcontrol db
Important note: the option -deconfig removes the EM jobs from Scheduling before the DB Control is
deconfigured. Otherwise the repository, which is not dropped, could be corrupted or inconsistent if EM jobs were
scheduled as the time the DB Control is dropped. It could also cause some errors during the DB Control 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 needs to 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
Warning: this command puts the database in Quiesce Mode for the DB Control Releases 10.x to 11.1.x. Starting
with DB Control Release 11.2.x, the database is no longer put in quiesce mode. The following note can be consulted
for further details:
Note 375946.1 Running EMCA Results in Database quiesce And No New Connections or Operations Can Be
Performed During the DB Control Repository Creation
28/3/2014 Document Display
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 4/7
IMPORTANT: When dropping the repository with EMCA or RepManager on an 11.2 database, this warning will 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 in quiesce
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> 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;
/
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 the respective
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 certain circumstances
(e.g. you want to recreate the repository later on) the following statements will be sufficient to remove the repository:
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> DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
28/3/2014 Document Display
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 5/7
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;
/
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 single
command. 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 to 11.1.x. Starting
with DB Control Release 11.2.x, the database is no longer put in quiesce mode. The following note can be consulted
for further details:
Note 375946.1 Running EMCA Results in Database quiesce And No New Connections or Operations Can Be
Performed During the DB Control Repository Creation
IMPORTANT: When dropping the repository with EMCA or RepManager on an 11.2 database, this warning will 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).
B. Create DB Control Objects
Option 1. Create the DB Control Configuration Files
Option 2. Create the DB Control Repository Objects and Configuration Files
Option B.1. Create the DB Control Configuration Files
To create only the DB Control configuration files, skipping the repository creation (this would be done for instance if you
28/3/2014 Document Display
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 6/7
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 was dropped 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 them first.
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:
<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
28/3/2014 Document Display
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=m7dqm0we7_9 7/7
Warning: this command puts the database in Quiesce Mode for the DB Control Releases 10.x to 11.1.x. Starting
with DB Control Release 11.2.x, the database is no longer put in quiesce mode. The following note can be consulted
for further details:
Note 375946.1 Running EMCA Results in Database quiesce And No New Connections or Operations Can Be
Performed During the DB Control Repository Creation
IMPORTANT: When dropping the repository with EMCA or RepManager on an 11.2 database, this warning will 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 2
Available at: http://www.oracle.com/pls/db112/homepage
Oracle Database Administrator's Guide
11g Release 2 (11.2) - Part Number E17120-06
Topic: Configuring Database Control During and After Installation
Oracle Database 11g Release 1
Available at http://www.oracle.com/pls/db111/homepage
Oracle Database Utilities
11g Release 1 (11.1) - Part Number B28319-02
Topic: Enterprise Manager Configuration Assistant (EMCA)
Oracle Database 10g Release 2
Available at http://download.oracle.com/docs/cd/B16240_01/welcome.html
Oracle Enterprise Manager Grid Control Installation and Configuration Guide
10g Release 5 (10.2.0.5.0) - Part Number E10953-14
Topic: Understanding the Enterprise Manager Directories Installed with Oracle Database 10g
Topic: Configuring Database Console During and After the Oracle Database 10g Installation
REFERENCES
NOTE:1217493.1 - ATTENTION - Enterprise Manager Database Control 10.2.0.4 Or 10.2.0.5 - Patch Required from 31-
Dec-2010 onwards
NOTE:1222603.1 - Enterprise Manager Database Control Configuration - Recovering From Errors Due to CA Expiry 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.1
NOTE:375946.1 - EMCA Release 10.1 to 11.1 Puts the Database in Quiesce And No New Connections or Operations Can
Be Performed During the DB Control Repository Creation
NOTE:395162.1 - How to manage DB Control 10.2 for RAC Database with emca
NOTE:456437.1 - Ora-24005 Error Trying To Drop User Sysman Cascade
NOTE:578011.1 - How to manage DB Control 11.x for RAC Database with emca