How to Drop and Recreate the DB Control Repository

Information in this article applies to:
Oracle Enterprise Manager 10g Release 1 (10.1)
Oracle Enterprise Manager 10g Release 1 (10.2)
So:

Goal:
Provide detailed instructions on how to remove and recreate the DB Control Repository in a 10g Database

1. Stop the DB Console if not already stoped: $ORACLE_HOME/bin/emctl stop dbconsole

On Unix Systems:
1.  Run 10g DB $OH/sysman/admin/emdrep/bin/RepManager
NOTE: Type RepManager by itself and you will get a list of options available for the tool

2.  After you delete the Repository, you will need to remove the configuration files.  To do this, run emca -x

3.  Finally, to created both the schema objects and configuration files run emca and answer the prompts

On Windows Systems:
NOTE: The RepManager script in 10.1.0.2.0 does not work correctly on Windows.  For this reason, you will have to manually drop the sysman schema and management objects.  The RepManager script should be fully functional in the 10.1.0.3.0 release.

1.  Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and mangement objects:

•    SHUTDOWN IMMEDIATE;

•    STARTUP RESTRICT;

•    EXEC sysman.emd_maintenance.remove_em_dbms_jobs;

•    EXEC sysman.setEMUserContext(”,5);

•    REVOKE dba FROM sysman;

•    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;

•    DROP USER mgmt_view CASCADE;

•    DROP ROLE mgmt_user;

•    DROP USER sysman CASCADE;

•    ALTER SYSTEM DISABLE RESTRICTED SESSION;

2.  At a command Prompt, run emca -x sid to remove the existing configuration files and then recreate the schema and configuration files with just emca.  For example:
emca -x <SID>
emca

For additional information on emca commandline options, please see the Oracle Enterprise Manager 10g Advanced Configuration Guide.  The Guide is available from OTN.  http://download-west.oracle.com/docs/pdf/B12013_01.pdf

1.    Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and mangement objects:

SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
A. Drop the repository manually using following procedure.

Stop the DB Console if not already stoped: $ORACLE_HOME/bin/emctl stop dbconsole
Log on in sqlplus as sys user and run the following commands:

a. drop user sysman cascade;
b. drop role MGMT_USER;
c. drop user MGMT_VIEW cascade;
d. drop public synonym MGMT_TARGET_BLACKOUTS;
e. drop public synonym SETEMVIEWUSERCONTEXT;
(Note If any of the above statement failed and saying object doesn’t exist just skip that
statement)

B. Drop the DB Control configuration files.

Remove the following directories:
$rm -rf $ORACLE_HOME/<HOSTNAME_SID>
$rm -rf $ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_<HOSTNAME_SID>

On Windows systems just delete the folders above from the Explorer.

Remove the entries for the old dbconsole information from the $ORACLE_HOME/install/portlist.ini file

On Windows, use delsrv.exe (available for free download from Microsoft) or the ’sc’ command to remove the ORACLEDBCONSOLE<SID> service if it still remains.

1.    Remove the current Database Control configuration files and repository

1.1 set ORACLE_HOME and ORACLE_SID environment variable
1.2 <ORACLE_HOME>/bin/emca -x <SID>
1.3 <ORACLE_HOME>/sysman/admin/emdrep/bin/RepManager <hostname> <actual_listener_port> <sid> -action drop
1.4 Manually delete any <hostname>_<sid> directories in <ORACLE_HOME> and <ORACLE_HOME>/oc4j/j2ee
1.5 On Windows, use delsrv.exe (available for free download from Microsoft) or the ’sc’ command to remove the ORACLEDBCONSOLE<SID> service if it still remains.

2. Recreate the Database Control configuration files and repository

2.1 <ORACLE_HOME>/bin/emca


Sursa
2009-01-30 12:09:59



Comenteaza





Ultimele 25 posturi adăugate

09:04:42Ialoveni Armonios 1994, revelația mondială la 10 euro pe raft —» Fine Wine
11:46:06Sistemul care vrea să răstoarne PAS-ul. Chirtoacă despre mafie, hoție, scandalul din familie și fotbal 🔥💥🔝 —» Sandu GRECU
10:15:29ÎN PRAG DE CARTE NOUĂ —» Leo Butnaru
21:32:05World Cup —» APort | "Pentru un român care știe citi, cel mai greu lucru e să nu scrie." I.L. Carag
09:11:12Franța, după ziua națională —» APort | "Pentru un român care știe citi, cel mai greu lucru e să nu scrie." I.L. Carag
08:16:37DIN ANII 90... —» Leo Butnaru
18:13:09Parteneriatul pentru Europa: primele discuții privind agenda comună de acțiuni 🔝 —» Sandu GRECU
05:35:14DINSPRE MITURI SPRE NOI —» Leo Butnaru
05:27:03POETUL ȘI POEZIA SALVÂNDU-SE DIN GULAG —» Leo Butnaru
13:15:37Moldoveanca Romina Hîncu a cucerit primul său titlu ITF 💥 —» Sandu GRECU
05:59:25PUȚINĂ PEDAGOGIE —» Leo Butnaru
15:55:16🔥🔥🔥 SCANDAL la Comitetul Olimpic! 💥💥💥 CNOS vrea să elimine Federația de lupte din membrii săi! —» Sandu GRECU
19:18:28Vasile Tarlev: Nu eu am distrus Stadionul Republican. Atacant la echipa Bucuria. Despre Voronin și circ —» Sandu GRECU
19:13:06Tehnologie, energie verde și investiții în tineri: Istoria de succesului a Agro-Firmei „Plaiul Bîrlădean” 🌞 —» Sandu GRECU
19:07:23„Rolul meu ca primar nu este să fac promisiuni, ci să livrez rezultate” – Leonid Boaghi, primarul satului Sireți 💫 —» Sandu GRECU
17:04:57Fosta ambasadoare în India se judecă cu Ministerul de Externe —» Curaj.TV | Media alternativă
15:25:42Despre scandalul de la Dumbrava, BH (Live) —» Curaj.TV | Media alternativă
09:29:40DIN REVISTA DE TRADUCERI LITERARE —» Leo Butnaru
20:44:08De la pasiunea pentru arta culinară, la o carieră de succes în managementul ospitalității: Povestea Ninei Stratu 💫 —» Sandu GRECU
07:13:21Copyright: Deciziile vicedirectorului AGEPI, au costat autorii peste 7 milioane de lei 🤬🤬🤬 —» Sandu GRECU
04:40:33LACONICE —» Leo Butnaru
18:31:28Muzica unește generații. Gheorghe Mustea, sărbătorit la 75 de ani printr-un concert aniversar la Chișinău —» Curaj.TV | Media alternativă
18:31:28Muzica unește generații. Gheorghe Mustea, sărbătorit la 75 de ani printr-un concert aniversar la Chișinău —» Curaj.TV | Media alternativă
13:22:13Cu hijab-ul la defilare —» APort | "Pentru un român care știe citi, cel mai greu lucru e să nu scrie." I.L. Carag
18:56:52Păcălit de avocați și de magistrați (ru) —» Curaj.TV | Media alternativă