Oracle OEM 重建(三)

2014-11-24 18:29:26 · 作者: · 浏览: 5
s 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. (Free download from Microsoft)




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.


In both10gR1 and R2 run:


/sysman/admin/emdrep/bin/RepManager -action drop


Warning: this command puts the database in Quiesce Mode.


Please consult thehttps://metalink2.oracle.com/metalink/plsql/showdoc db=NOT&id=375946.1&blackframe=1Running EMCA Results in Database quiesce And No


New Connections or Operations Can Be Performed During the DB Control Repository Creation



Option 4. Delete DB Control Repository Objects ManuallyStep 1: Drop AQ related objects in the SYSMAN schema


Logon SQLPLUS 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


Logon SQLPLUS as user SYS or SYSTEM, 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 INc1 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 SQLPLUS 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;


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:


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




/bin/emca -x


/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:


/bin/[B]emca -deconfig dbcontrol db -repos drop



Warning: this command puts the database in Quiesce Mode.


Please consult thehttps://metalink2.oracle.com/metalink/plsql/showdoc db=NOT&id=375946.1&blackframe=1Running EMCA Results in Database quiesce And No


New Connections or Operations Can Be Performed During the DB Control Repository Creation



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 1. Create the DB Control Configuration Files


To create only the DB Control configuration files,