当前位置: > 数据库 > Oracle >

Oracle OEM 重建 及 案例 说明

时间:2015-09-20 22:15来源:linux.it.net.cn 作者:IT

一.手工重建EM

 

Oracle 的gridcontrol 由两部分组成:dbcontrol 和repository。 我们可以对某一部分进行操作,也可以同时进行操作。 这块的内容详细参考2.5 节的实例。

 

 

关于EM和 GridControl 的关系有blog单独说明,参考:

    企业管理器(OEM)介绍: Grid Control 和Database Control

   http://blog.csdn.net/tianlesoftware/article/details/5704374


 

这里先看一个因为修改hostname,导致EM 不能正常使用的例子。

 

1.1 其中的错误信息如下:

2009-4-10 3:38:49oracle.sysman.emcp.EMReposConfigcreateRepository ­

配置:ORA-01920:用户名'MGMT_VIEW'与另外一个用户名或角色名发生冲突 ­

ORA-06512:在line40 ­

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException:ORA-01920:用户名'MGMT_VIEW'与另外一个用户名或角色名发生冲突 ­

ORA-06512:在line40 ­

2009-4-10 3:03:10oracle.sysman.emcp.EMReposConfigunlockAccounts ­

配置:ORA-06550:第1行,第62列: ­

PLS-00201:必须声明标识符'SYSMAN.MGMT_VIEW_PRIV' ­

ORA-06550:第1行,第62列: ­

PL/SQL: Statement ignored ­

 

1.2 OEM常用的命令

(1)创建一个EM资料库 ­

emca -reposcreate ­

(2)重建一个EM资料库 ­

emca -reposrecreate ­

(3)删除一个EM资料库 ­

emca -reposdrop ­

(4)配置数据库的DatabaseControl ­

emca -configdbcontrol db ­

(5)删除数据库的DatabaseControl配置 ­

emca -deconfigdbcontrol db ­

(6)重新配置db control的端口,默认端口在1158 ­

emca -reconfigports ­

emca -reconfigports -dbcontrol_http_port 1160 ­

emca -reconfigports -agent_port 3940 ­

(7)先设置ORACLE_SID环境变量后,启动EM console服务 ­

emctl startdbconsole ­

(8)先设置ORACLE_SID环境变量后,停止EM console服务 ­

emctl stopdbconsole ­

(9)先设置ORACLE_SID环境变量后,查看EM console服务的状态 ­

emctl statusdbconsole ­

(10)配置dbconsole的步骤 ­

emca -reposcreate ­

emca -configdbcontrol db ­

emctl startdbconsole ­

(11)重新配置dbconsole的步骤 ­

emca -reposdrop ­

emca -reposcreate ­

emca -configdbcontrol db ­

emctl startdbconsole ­

 

1.3 手工重建OEM

       这里的重建包括2部分: dbcontrol 和repository。具体参考2.5小结。

 

 我们的db是11.2.0.3的。

 

(1)删除dbcontrol 和repository:

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

 

(2)重新创建dbcontrol 和repository:

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

 

 

二.MOS 上的一些案例

2.1 案例一

EMCA FailsWithError "ORA-00955: name is already used by an existing object"ForSYNONYM MGMT_AVAILABILITY [ID 470246.1]

 

2.1.1 Applies to:

Enterprise Manager Grid Control - Version:11.1.0.6 andlater   [Release: 11.1 and later ]
Information in this document applies to any platform.

 

2.1.2 Symptoms

While recreating the database control in11g database, it fails asbelow errors in emca_repos_create_timestamp.logfile 

 

Dec 9, 2007 10:41:26 AMoracle.sysman.emcp.EMReposConfigcreateRepository
CONFIG: ORA-00955: name is already used by an existingobject

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-00955:nameis already used by an existing object

atoracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1500)
atoracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:874)
atoracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:270)
atoracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:311)
at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:492)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:218)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:221)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:534)
atoracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1214)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:518)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:467)
Dec 9, 2007 10:41:26 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository

 

CREATE PUBLIC SYNONYM MGMT_AVAILABILITY FORMGMT_AVAILABILITY
*
ERROR at line 1:
ORA-00955: name is already used by an existing object

 

2.1.3 Cause

Related Bug6111734 EMCA THROWS CONFIG: ORA-00955 CREATE PUBLIC SYNONYMMGMT_AVAILABILITY FORMGMT_A 

 

2.1.4 Solution

As a workaround,

Drop the Repository using RepManager:

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

 

Note : This will not remove theconfiguration files, but only therepository related objects from the database.Also, the database will be put inQuiescing mode when RepManager is ran. 
Refer Note375946.1 RunningEMCA Results in Database quiesce And No New Connectionsor Operations Can BePerformed During the DB Control Repository Creation


If above RepManager fails with conflicts for any other SYNONYM thenmanuallydrop the DBConsole repository and objects referring to Note278100.1 HowTo Drop, Create And Recreate DB Control In A 10g Database

 

2.1.5 示例:

[oracle@dave bin]$ ./RepManager dave 1521anqing -action drop

Enter SYS user's password :

Enter repository user name : sysman

Getting temporary tablespace fromdatabase...

Found temporary tablespace: TEMP

Checking SYS Credentials ... rem errorswitch

OK.

rem error switch

Dropping the repository..

Checking for Repos User ... Exists.

Repos User exists..

Clearing EM Contexts ... OK.

Dropping EM users ...

Done.

Dropping Repos User ...

Done.

Dropping Roles/Synonymns/Tablespaces ...Done.

Dropped Repository Successfully.

 

 

2.2 案例二

EMCA FailsWith Error "ORA-12514"and "SEVERE: Listener is not up. Start theListener and run EMConfiguration Assistant again." [ID 368591.1]

 

2.2.1Appliesto:

Enterprise Manager for RDBMS - Version:10.2.0.1 andlater   [Release: 10.2 and later ]
Information in this document applies to any platform.

 

2.2.2Symptoms

EMCA command to configure DBConsole failswith below error inemca_timestamp.log file 

 

Aug 22, 2008 6:41:23 AMoracle.sysman.emcp.util.GeneralUtilinitSQLEngine
CONFIG: SQLEngine created successfully and connected
Aug 22, 2008 6:41:23 AMoracle.sysman.emcp.ParamsManagercheckListenerStatusForDBControl
CONFIG: ORA-12514: TNS:listener does not currently knowof service requested inconnect descriptor
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException:ORA-12514:TNS:listener does notcurrently know of service requested in connectdescriptor

atoracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1530)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeSql(SQLEngine.java:1771)
atoracle.sysman.emcp.ParamsManager.checkListenerStatusForDBControl(ParamsManager.java:2707)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:368)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:221)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:534)
atoracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1214)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:518)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:467)
Aug 22, 2008 6:41:23 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Listener is not up. Start the Listener and run EMConfigurationAssistant again .
Refer to the log fileat/apps/ora11g/cfgtoollogs/emca/ORADB11G/emca_2008_08_22_06_40_44.log for
more details.
Aug 22, 2008 6:41:23 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Listener is not up. StarttheListener and run EM Configuration Assistant again .
at oracle.sysman.emcp.ParamsManager.checkListenerStatusFor


OR running EMCA to drop a repository in a cloneddatabase, fails with the error:

Could not connect to
SYS/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTO =TCP)(HOST
=hrmsdev1)(PORT=9404)))(CONNECT_DATA=(SERVICE_NAME=hostname..domain))):
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor (DBD ERROR: OCIServerAttach)

 

2.2.3 Cause:

The error indicates that the SERVICE_NAMEtried to access by clientis not found with the targeted listener.There areseveral cause for the errormessage ORA-12514, like Listener is running on annon default port.
SID is not registered to the listener
The SERVICE_NAME listed in the connect descriptor is incorrect

 

2.2.4 Solution

1. Check whether the hostname and portspecified in the connectdescriptor are correct for the database service.

2. Check listener.ora file so that it will match the settings in thedatabaseparameters like db_domain, service_names, db_unique_name.

3. Try to connect to the database from sqlplus using the listener
Example
sqlplus sys/<password>@<TNS Connect Descriptor> as SYSDBA

If above command fails with ORA-12514 then refer Note444705.1 TroubleShootingGuide For ORA-12514 TNS:listener could notresolve SERVICE_NAME given in connectdescriptor

4. Check the service SERVICE_NAME listed in the connect descriptor and makesureits correct as per the listener status output. In this case it hastwoconnecting dots between the hostname and the domainname

5. If the listener is not running on the default port 1521 thensetlocal_listener parameter on database side.

 

SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string

SQL> alter system set local_listener='<Listener_name>';
System altered.


OR

SQL> alter systemsetlocal_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=hostname.com)(PORT=1522))';
System altered.


+ Make sure the connection to the database is working from sqlplus usingthelistener.Once the connection is working fine re run the failed EMCA command.

 

 

2.3 案例三

EMCA FailsWith Error "SEVERE: Errorcreating the repository" and"ORA-20001: SYSMAN already exists"While Creating DBConsole [ID549896.1]

 

2.3.1 Applies to:

Enterprise Manager Grid Control - Version:10.2.0.1 to 11.2.0.1 -Release: 10.2 to 11.2
Information in this document applies to any platform.

 

2.3.2 Symptoms

While executing the Enterprise ManagerConfiguration Assistant(EMCA) command (emca -config dbcontrol db -reposcreate) to create the DBConsolerepository, the following error is reported tothe screen:-

Do you wish to continue? [yes(Y)/no(N)]:yes
<timestamp> oracle.sysman.emcp.EMConfig perform
INFO: This operation is being loggedat<ORACLE_HOME>\cfgtoollogs\emca\<sid>\emca_<timestamp>.log.
<timestamp> oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
<timestamp> oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
<timestamp> oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at<ORACLE_HOME>\cfgtoollogs\emca\<sid>\emca_repos_create_<date>.logformore details.
<timestamp> oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log fileat<ORACLE_HOME>\cfgtoollogs\emca\<sid>\emca_<timestamp>.logformore details.
Could not complete the configuration. Refer to the log fileat<ORACLE_HOME>\cfgtoollogs\emca\<sid>\emca\
emca_<timiestamp>.log for more details

 

in$ORACLE_HOME/cfgtoollogs/emca/<sid>/emca_<timestamp>.log(10.2.X)or $ORACLE_BASE/cfgtoollogs/emca/<sid>/emca_<timestamp>.log(11.x),the following can be seen:

 

INFO: Creating the EM repository (this maytake a while) ...
May 25, 2010 2:21:30 PM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException:ORA-20001:SYSMAN already exists..
ORA-06512: at line 17

SEVERE: Error creating the repository
May 25, 2010 2:21:30 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at<ORACLE_HOME>/cfgtoollogs/emca/<sid>/emca_repos_create_<date>.logformore details.


emca_repos_create_<date>.log shows

DECLARE
*
ERROR at line 1:
ORA-20001: SYSMAN already exists..
ORA-06512: at line 17

 

2.3.3 Cause

This is causedby the fact that the DBConsole repository alreadyexists for thisdatabase.  This can also sometimes be seen if the dbconsolehas beenpreviously dropped (including the repository), but for some reason theSYSMANaccount may not have been completely removed as part of the drop process.

 

2.3.4 Solution

1.  Since the repository alreadyexists, it is only necessaryto create the configuration files using:

emca -configdbcontrol db


and provide answers to the prompts.

2.  Alternatively,  if it is deemed preferrable to create afreshdbconsole,  the existing dbconsole repository (including sysmanschema)needs to be dropped first.

 

To drop the existingrepository please follow below steps. 
(1) Drop theexisting repository

emca -deconfigdbcontrol db -repos drop


For more details Refer Note278100.1 How To Drop, Create And Recreate DB Control In A 10g Database. Repository canbe dropped either using above emca command or manually asexplained in <>

 

Note : Above emca -drop command requiresthe database to bequiesced. This means that, temporarily, no operations arepossible on thedatabase and new users cannot login. 
Refer Note375946.1 RunningEMCA Results in Database quiesce And No NewConnections or Operations Can BePerformed During the DB Control RepositoryCreation


(2) Once theDBconsole repository isdropped run the emca command to create thedbconsole :

emca -configdbcontrol db -repos create

 

2.4 案例四

How tochange the Hostname when Oracle 10Gand ASM are used [ID 422729.1]

 

2.4.1 Applies to:

Oracle Server - Enterprise Edition -Version: 10.1.0.2 to 10.2.0.4
Information in this document applies to any platform.

 

2.4.2 Goal

For Windows, what areas of the 10G Oracledatabase, ASM and EM, oneneeds to consider when changing the server'sHostname? 

 

2.4.3 Solution

When changing the Hostname, 4 files orareas would beaffected:

1) tnsnames.ora 
2) listener.ora 
3) Oraclecsservice
4) Enterprise Manager


** Note: After Changing the Hostname and Before StartingtheServices, please check the below ** 

1 & 2) The tnsnames.ora andlistener.orafiles 

** If the IP address is referred in these files then there will not beanyproblem, else you need to change the Hostname in the tnsnames of theclientsconnecting to the server and the listener on the Server ** 

tnsnames : 

(ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521)) 

listener:

LISTENER = 
(DESCRIPTION_LIST = 
(DESCRIPTION = 
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) 
Listener 

 

3) Oraclecsservice 
The Hostname will be hard-coded in the CSService, so we need to RecreatetheService 

Steps to Recreate the CSService

Login as a user that is a member of theAdministrator's group

Go to %ORACLE_HOME%/bin directory,where ASM runs of 

Example:

L:\oracle\product\10.2.0\db10g\BIN>localconfig delete 
Step 1: stopping local CSS stack 
Step 2: deleting OCR repository 
successfully deleted local CSS setup 

L:\oracle\product\10.2.0\db10g\BIN>localconfig add 
Step 1: creating new OCR repository 
Successfully accumulated necessary OCR keys. 
Creating OCR keys for user '********', privgrp ''.. 
Operation successful. 
Step 2: creating new CSS service 
successfully created local CSS service 
successfully added CSS to home


4)  EM

If the Hostname is changed, then the EMDbcontrolrepository has to be recreated.

To recreate the EM DBcontrol repository,please see the followingarticle:

Note.278100.1 HowToDrop, Create And Recreate DB Control In A 10g Database

 

 

2.5 案例五

How To Drop,Create And Recreate theDatabase Control (DB Control) Release 10g and 11g [ID278100.1]

 

2.5.1 Applies to:

Enterprise Manager Grid Control - Version:10.1.0.2 to 11.2.0.2 -Release: 10.1 to 11.2
Enterprise Manager for RDBMS -Version:10.1.0.5 to 11.2.0.2   [Release: 10.1 to 11.2]
Information in this document applies to any platform.
DBConsole

 

2.5.2 Purpose

This article provides detailed instructionson how to 1) create, 2)drop and 3)recreate the repository and configurationfiles for the DB Controlapplication used to manage a single 10g Database.

 

ATTENTION!

After 31-Dec-2010, creating/recreating/securing10.2.0.4/10.2.0.5EM DB Control will fail due to the expiration of the CertificateAuthority. Moreinformations in:

NOTE1217493.1 ATTENTION:Patch Required If You Plan To ConfigureEnterprise Manager Database Control WithOracle Database 10.2.0.4 Or 10.2.0.5On Or After 31-Dec-2010

NOTE1222603.1 RecoveringFrom Database Control Configuration Errors Due toCA Expiry on Oracle Database10.2.0.4 or 10.2.0.5

--传说中让N多OCM 挂掉的bug

 

2.5.3 Scopeand Application

The steps inthis article are written for a DBA or SystemAdministrator who needs to create,drop or reconfigure the DB ControlApplication.  

The format ofthe document will include steps for both 10.1, 10.2and 11.x EMCA because thecommands changed between these releases.

For detailedinstructions on DB Control on RAC, please consultalso:
Document395162.1 -How to manage DB Control 10.2 for RAC Database with emca
Document578011.1 -How to manage DB Control 11.x for RAC Database with emca

 

2.5.4  How ToDrop,Create And Recreate the Database Control (DB Control) Release 10g and 11g

 

2.5.4.1 . Delete DB ControlObjects:

步骤如下:

Option 1.  Delete DB ControlConfiguration Files using EMCAscripts
Option 2.  Delete DB Control Configuration Files Manually:
Option 3.  Delete DB Control Repository Objects using RepManager
Option 4.  Delete DB Control Repository Objects Manually
Option 5.  Delete DB Control Configuration Files and RepositoryObjectsusing EMCA

 

(1)Option 1. Delete DB Control ConfigurationFilesusing EMCA scripts:
DB Control 10.1.x

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

DC Control 10.2.x and 11.x

<ORACLE_HOME>bin/emca-deconfig dbcontrol db

 

 Important Note: the option -deconfig removes the EM jobsfrom Scheduling before theDB Control is deconfigured. Otherwise the repository,which is not dropped,could be corrupted or inconsistent if EM jobs werescheduled as the time the DBControl is dropped. It could also cause some errorsduring the DB Controldeletion.

 

(2)Option 2. Delete DB Control ConfigurationFilesManually:
Remove the following directories from yourfilesystem:
<ORACLE_HOME>/<hostname_sid>
<ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid>

If the dbcontrol is upgraded from lower version, for example,from 10.2.0.3to 10.2.0.4, then the following directory also needs to beremoved from the filesystem.

 

<ORACLE_HOME>/<hostname_sid>.upgrade
<ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid>.upgrade

 

NOTE:  
On Windows you also need to delete the DB Console service:
- 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 thefollowingfrom 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.   (Freedownloadfrom Microsoft)


(3)Option 3. Delete DB Control RepositoryusingRepManager:
This option is not as complete as the otheroptions.  You may find thatdropping the repository using the commandlineoptions is a bettersolution.  Also note, RepManager is not used to createa DB ControlRepository.
All DB Control Releases:

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

  

(4)Option 4. Delete DB Control RepositoryObjectsManually

Step 1: Drop AQ related objects inthe SYSMAN schema

DB Control 10.x to 11.1.x

Logon SQLPLUS as user SYS 

SQL>execDBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE);


DB Control 11.2.x

Logon SQLPLUS as user SYS

SQL>execDBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE);


Step 2: Drop the DB ControlRepository Objects

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

 

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 fromthedatabase; under certain circumstances (e.g. you want to recreate therepositorylater on) the following statements will be sufficient to remove therepository:


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

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;


(5)Option 5. Delete DB Control ConfigurationFilesand Repository Objects using EMCA

For DB Control 10.1.x, droppingboth the configurationfiles and the repository objects is a two stepprocess.  Run thefollowing 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 and11.x, both configurationfiles and repositoryobjects can be deleted with a single command. Run the command:

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

 

Warning: this command puts the database inQuiesce Mode for the DBControl Releases 10.x to 11.1.x.
Beginning DB Control Release 11.2, the database is not put in quiescemodeanymore.
Please consult the Note375946.1 RunningEMCA Results in Database quiesce And No NewConnections or Operations Can BePerformed During the DB Control RepositoryCreation

 

2.5.4.2  Create DBControl Objects

Option 1.  Create the DB ControlConfiguration Files
Option 2.  Create the DB Control Repository Objects and ConfigurationFiles


(1)Option 1.  Create the DBControlConfiguration Files
To create only the DB Control configuration files, skipping therepositorycreation (this would be done for instance if you dropped only thefiles andleft 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 -configdbcontrol db


(2)Option 2. Create the DB Control RepositoryObjectsand 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 -configdbcontrol db -repos create

 

IMPORTANT: Before creating the DB ConsoleRepository objects, makesure that the repository was dropped using the stepsin chapter 1 above..

 

2.5.4.3 Recreate/ReConfigure DB Control

Option 1.  Recreate the DB ControlConfiguration Files only (leaveRepository intact)

Option 2.  Recreate the DB ControlConfiguration Files andRepository 



In 10.2 and 11.x, the EMCA commands can be used to reconfigure theexistinginstalls without removing them first.

Option 1. Recreate the DB ControlConfiguration Filesonly (leave Repository intact):

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

<ORACLE_HOME>/bin/emca -configdbcontrol db


Option 2. Recreate the DB ControlConfiguration Filesand Repository 

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

<ORACLE_HOME>/bin/emca -configdbcontrol db -repos recreate

 

Warning: this command puts the database in QuiesceMode for the DBControl Releases 10.x to 11.1.x.
Beginning DB Control Release 11.2, the database is not put in quiescemodeanymore.
Please consult the Note375946.1 RunningEMCA Results in Database quiesce And No NewConnections or Operations Can BePerformed During the DB Control RepositoryCreation

 

2.5.4.4 Documentation

Oracle Database 11gRelease 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 OracleDatabase10g
Topic: Configuring Database Console During and After the Oracle Database10gInstallation




(责任编辑:IT)
------分隔线----------------------------