Standalone Enterprise Manager Administrative Notes
10.1.0.2 to 11.1.0.0
DB Control Options
DB Control Options:
Delete DB Control Objects:
Delete DB control configuration files with EMCA scripts
Delete DB control configuration files Manually
Delete DB control repository objects using RepManager
Delete DB control repository objects Manually
Delete DB control
DB Control Options:
Delete DB Control Objects:
1. Delete DB control configuration files with EMCA scripts
2. Delete DB control configuration files Manually
3. Delete DB control repository objects using RepManager
4. Delete DB control repository objects Manually
5. Delete DB control configuration files and repository objects using EMCA
Option 1 using EMCA scripts
10.1.x run $ORACLE_HOME/bin/emca -x
10.2.x run $ORACLE_HOME/bin/emca -deconfig dbcontrol db
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 2 manually remove configuration files
Remove the following directories from your filesystem:
$ORACLE_HOME/
$ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole__
Note: On Windows you also need to delete the DB Console service:
run regedit
navigate to HKEY_LOCAL_MACHINE/SYTEM/CurrentControlSet/Services
locate the OracleDBConsole entry and delete it
Alternatively on Windows XP and Windows Server 2003 you can run the following
from the command line:
sc delete
- where is the DB Control service name (typically: OracleDBConsole)
Also available from Microsoft is the delsrv.exe command.
Option 3 – delete DB control repository using RepManager
This option is not as complete as the other options. You may find that dropping the repository using the commandline options is a better solution. Also, note RepManager is not used to create a DB Control Repository.
10g R1 and R2 execute:
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop
Warning: this command puts the database in Quiesce Mode. Check note 375946.1
Option 4 – delete the DB Control Repository Objects Manually
step 1: drop AQ related objects in the SYSMAN schema, logon SQL*Plus as user
SYSMAN:
sql> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>’MGMT_NOTIFY_QTABLE’,force=>TRUE);
step 2: drop the DB control repository objects by logging on as SYS or SYSTEM, via SQL*Plus and drop the sysman account and management objects:
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: 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 may be sufficient to remove the repository:
Logon SQL*Plus as user SYS or SYSTEM, and drop the sysman account and management objects:
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;
Option 5 – delete the 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
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop
for DB Control 10.2.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
Create the DB Control Objects
Option 1. Create the DB Control Configuration Files
Option 2. Create the DB Control Repository Objects and Configuration Files
Option 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 dropped only the files and left the repository in place)
for 10.1.x, run $ORACLE_HOME/bin/emca -r
for 10.2.x, run $ORACLE_HOME/bin/emca -config dbcontrol db
Option 2. Create the DB Control Repository Objects and Configuration Files
for 10.1.x, run $ORACLE_HOME/bin/emca
for 10.2.x, run $ORACLE_HOME/bin/emca -config dbcontrol db -repos create
Recreate / ReConfig DB Control
Option 1. Recreate the DB Control Configuration Files only (leave Repository intact)
Option 2. Recreate the DB Control Configuration Files and Repository
Option 1 – recreate the DB Control Configuration Files and Repository
for 10.2, the EMCA commands can be used to reconfigure the existing installs
without removing them first.
$ORACLE_HOME/bin/emca -config dbcontrol db
Option 2 – recreate the DB Control Configuration Files and Repository
for DB Control 10.2.x, run the command:
$ORACLE_HOME/bin/emca -config dbcontrol db -repos recreate