##############################################################################
# 如果OEM有问题可以按下面的方法重新配置OEM
##############################################################################
# 如何查看数据库的SID
sys@TESTDB11>select instance_name from v$instance;
INSTANCE_NAME
----------------
TestDB11
# 修改sysman的口令
sys@TESTDB11>alter user sysman identified by sysman;
User altered.
# 修改dbsnmp的口令
sys@TESTDB11>alter user dbsnmp identified by dbsnmp;
User altered.
# 查看监听的端口号
[oracle@S1011:/export/home/oracle]$ lsnrctl status
LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 05-JUN-2013 11:06:56
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
Start Date 05-JUN-2013 09:45:07
Uptime 0 days 1 hr. 21 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/S1011/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=kiwi)(PORT=1521)))
Services Summary...
Service "TestDB11" has 1 instance(s).
Instance "TestDB11", status READY, has 1 handler(s) for this service...
Service "TestDB11XDB" has 1 instance(s).
Instance "TestDB11", status READY, has 1 handler(s) for this service...
The command completed successfully
# 把dbconsole停止掉
[oracle@S1011:/export/home/oracle]$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://kiwi:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
# 删除dbconsole的配置库
[oracle@S1011:/export/home/oracle]$ emca -repos drop
STARTED EMCA at Jun 5, 2013 11:05:30 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database SID: TestDB11
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 5, 2013 11:08:26 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/TestDB11/emca_2013_06_05_11_05_29.log.
Jun 5, 2013 11:08:27 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jun 5, 2013 11:11:58 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 5, 2013 11:11:58 AM
# 重建dbconsole的配置库
[oracle@S1011:/export/home/oracle]$ emca -repos create
STARTED EMCA at Jun 5, 2013 11:12:43 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database SID: TestDB11
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 5, 2013 11:13:04 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/TestDB11/emca_2013_06_05_11_12_43.log.
Jun 5, 2013 11:13:05 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 5, 2013 11:21:19 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 5, 2013 11:21:20 AM
# 重新配置
[oracle@S1011:/export/home/oracle]$ emca -config dbcontrol db
STARTED EMCA at Jun 5, 2013 11:22:27 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database SID: TestDB11
Database Control is already configured for the database TestDB11
You have chosen to configure Database Control for managing the database TestDB11
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
Local hostname ................ kiwi
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1521
Database SID ................ TestDB11
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 5, 2013 11:24:23 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/TestDB11/emca_2013_06_05_11_22_27.log.
Jun 5, 2013 11:24:25 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jun 5, 2013 11:24:39 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jun 5, 2013 11:25:41 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jun 5, 2013 11:25:46 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jun 5, 2013 11:25:53 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jun 5, 2013 11:25:53 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jun 5, 2013 11:27:16 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jun 5, 2013 11:27:16 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://kiwi:1158/em
Jun 5, 2013 11:27:25 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/dbhome_1/kiwi_TestDB11/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 5, 2013 11:27:25 AM
# 查看EM database control的当前状态
[oracle@S1011:/export/home/oracle]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://kiwi:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/kiwi_TestDB11/sysman/log