1.准备工作
前提1:检查是否已有EM组件
set pagesize 999
col comp_name for a50
set linesize 180
select comp_id,comp_name,version,status,startup from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
------------------- --------------------------------------- ------------------------------
EM Oracle Enterprise Manager 11.2.0.4.0 VALID
OWB OWB 11.2.0.4.0 VALID
APEX Oracle Application Express 3.2.1.00.12 VALID
AMD OLAP Catalog 11.2.0.4.0 VALID
SDO Spatial 11.2.0.4.0 VALID
ORDIM Oracle Multimedia 11.2.0.4.0 VALID
XDB Oracle XML Database 11.2.0.4.0 VALID
CONTEXT Oracle Text 11.2.0.4.0 VALID
EXF Oracle Expression Filter 11.2.0.4.0 VALID
RUL Oracle Rules Manager 11.2.0.4.0 VALID
OWM Oracle Workspace Manager 11.2.0.4.0 VALID
CATALOG Oracle Database Catalog Views 11.2.0.4.0 VALID
CATPROC Oracle Database Packages and Types 11.2.0.4.0 VALID
JAVAVM JServer JAVA Virtual Machine 11.2.0.4.0 VALID
XML Oracle XDK 11.2.0.4.0 VALID
CATJAVA Oracle Database Java Packages 11.2.0.4.0 VALID
APS OLAP Analytic Workspace 11.2.0.4.0 VALID
XOQ Oracle OLAP API 11.2.0.4.0 VALID
RAC Oracle Real Application Clusters 11.2.0.4.0 VALID
col comp_name for a50
set linesize 180
select comp_id,comp_name,version,status,startup from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
------------------- --------------------------------------- ------------------------------
EM Oracle Enterprise Manager 11.2.0.4.0 VALID
OWB OWB 11.2.0.4.0 VALID
APEX Oracle Application Express 3.2.1.00.12 VALID
AMD OLAP Catalog 11.2.0.4.0 VALID
SDO Spatial 11.2.0.4.0 VALID
ORDIM Oracle Multimedia 11.2.0.4.0 VALID
XDB Oracle XML Database 11.2.0.4.0 VALID
CONTEXT Oracle Text 11.2.0.4.0 VALID
EXF Oracle Expression Filter 11.2.0.4.0 VALID
RUL Oracle Rules Manager 11.2.0.4.0 VALID
OWM Oracle Workspace Manager 11.2.0.4.0 VALID
CATALOG Oracle Database Catalog Views 11.2.0.4.0 VALID
CATPROC Oracle Database Packages and Types 11.2.0.4.0 VALID
JAVAVM JServer JAVA Virtual Machine 11.2.0.4.0 VALID
XML Oracle XDK 11.2.0.4.0 VALID
CATJAVA Oracle Database Java Packages 11.2.0.4.0 VALID
APS OLAP Analytic Workspace 11.2.0.4.0 VALID
XOQ Oracle OLAP API 11.2.0.4.0 VALID
RAC Oracle Real Application Clusters 11.2.0.4.0 VALID
前提2:ASM实例的remote listener 需要使用scan listener
IMPORTANT:
1. Starting with 11.2, SCAN listener configuration is mandatory when configuring Database Control in an Oracle RAC environment
Please check the Document 1188736.1 - How to Setup SCAN Listener and Client for TAF and Load Balancing
2. Starting with 11.2 EMCA, the reconfig command uses the parameter -EM_NODE_LIST instead of -EM_SID_LIST
Example:
$ emca -reconfig dbcontrol -cluster -EM_NODE <node1> -EM_NODE_LIST <node1,node2,nodeN>
Reference:How to manage DB Control 11.x for RAC Database with emca (文档 ID 578011.1)
1. Starting with 11.2, SCAN listener configuration is mandatory when configuring Database Control in an Oracle RAC environment
Please check the Document 1188736.1 - How to Setup SCAN Listener and Client for TAF and Load Balancing
2. Starting with 11.2 EMCA, the reconfig command uses the parameter -EM_NODE_LIST instead of -EM_SID_LIST
Example:
$ emca -reconfig dbcontrol -cluster -EM_NODE <node1> -EM_NODE_LIST <node1,node2,nodeN>
设置asm实例的remote listener:
grid@rac01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Wed Nov 16 04:16:52 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.12.11)(PORT=1521))))
remote_listener string
SQL> alter system set remote_listener='rac-scan:1521';
System altered.
SQL> alter system register;
System altered.
SQL> show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string rac-scan:1521
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
SQL*Plus: Release 11.2.0.4.0 Production on Wed Nov 16 04:16:52 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.12.11)(PORT=1521))))
remote_listener string
SQL> alter system set remote_listener='rac-scan:1521';
System altered.
SQL> alter system register;
System altered.
SQL> show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string rac-scan:1521
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
如果通过管理命令无法查看服务命令,则需要重建,过程如下:
1)获取cluster名
#su - grid$ cd $ORACLE_HOME/bin$ ./cemutlo -n$rac-cluster
2)或者设置好如下账号的密码
DBSNMP/SYS/SYSMAN, ASMSNMP注:ASMSNMP如不记得密码,直接以grid用户下登录SQLPLUS / AS SYSASM方式更改即可。
3)开始重建
$emca -config dbcontrol db -repos recreate -cluster
//因为原来有过em组件但无法使用,顾选择重建
STARTED EMCA at Nov 16, 2016 4:35:14 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database unique name: racdb
Service name: racdb
Listener port number: 1521
Listener ORACLE_HOME [ /oracle/app/11.2/grid ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Cluster name: rac-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /oracle/app/11.2/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /oracle/app/oracle/product/11.2.0
Database instance hostname ................ Listener ORACLE_HOME ................ /oracle/app/11.2/grid
Listener port number ................ 1521
Cluster name ................ rac-cluster
Database unique name ................ racdb
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /oracle/app/11.2/grid
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ ASMSNMP
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes
Nov 16, 2016 4:35:48 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/app/oracle/cfgtoollogs/emca/racdb/emca_2016_11_16_04_35_14.log.
Nov 16, 2016 4:35:51 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Nov 16, 2016 4:40:20 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Nov 16, 2016 4:40:21 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 16, 2016 4:50:08 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Nov 16, 2016 4:50:22 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Nov 16, 2016 4:52:03 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Nov 16, 2016 4:52:03 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_rac01_racdb to remote nodes ...
Nov 16, 2016 4:52:05 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_rac02_racdb to remote nodes ...
Nov 16, 2016 4:52:09 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0/rac01_racdb to remote nodes ...
Nov 16, 2016 4:52:11 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0/rac02_racdb to remote nodes ...
Nov 16, 2016 4:52:13 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Nov 16, 2016 4:52:37 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Nov 16, 2016 4:54:18 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Nov 16, 2016 4:54:18 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://rac01:1158/em <<<<<<<<<<<
Nov 16, 2016 4:54:28 AM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------
racdb rac01 rac01
racdb rac02 rac01
Nov 16, 2016 4:54:28 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: /oracle/app/oracle/product/11.2.0/rac01_racdb/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 Nov 16, 2016 4:54:29 AM
STARTED EMCA at Nov 16, 2016 4:35:14 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database unique name: racdb
Service name: racdb
Listener port number: 1521
Listener ORACLE_HOME [ /oracle/app/11.2/grid ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Cluster name: rac-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /oracle/app/11.2/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /oracle/app/oracle/product/11.2.0
Database instance hostname ................ Listener ORACLE_HOME ................ /oracle/app/11.2/grid
Listener port number ................ 1521
Cluster name ................ rac-cluster
Database unique name ................ racdb
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /oracle/app/11.2/grid
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ ASMSNMP
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes
Nov 16, 2016 4:35:48 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/app/oracle/cfgtoollogs/emca/racdb/emca_2016_11_16_04_35_14.log.
Nov 16, 2016 4:35:51 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Nov 16, 2016 4:40:20 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Nov 16, 2016 4:40:21 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 16, 2016 4:50:08 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Nov 16, 2016 4:50:22 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Nov 16, 2016 4:52:03 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Nov 16, 2016 4:52:03 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_rac01_racdb to remote nodes ...
Nov 16, 2016 4:52:05 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_rac02_racdb to remote nodes ...
Nov 16, 2016 4:52:09 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0/rac01_racdb to remote nodes ...
Nov 16, 2016 4:52:11 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0/rac02_racdb to remote nodes ...
Nov 16, 2016 4:52:13 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Nov 16, 2016 4:52:37 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Nov 16, 2016 4:54:18 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Nov 16, 2016 4:54:18 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://rac01:1158/em <<<<<<<<<<<
Nov 16, 2016 4:54:28 AM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------
racdb rac01 rac01
racdb rac02 rac01
Nov 16, 2016 4:54:28 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: /oracle/app/oracle/product/11.2.0/rac01_racdb/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 Nov 16, 2016 4:54:29 AM
提醒:使用hostname代替IP地址访问rac的em,https://rac01:1158/em
Reference :How to manage DB Control 11.x for RAC Database with emca (文档 ID 578011.1)
如果安装过程中遇到如下问题:
WARNING: ORA-28003: password verification for the specified password failedORA-20006: Password too simple
参考:EMCA: RepManager Fails With Password Verification Error ORA-28003 (文档 ID 779098.1)