今天在帮一个朋友安装和配置RAC,并配置Oracle EM;因之前一直没怎么用过EM,加上这次用的是10.2.0.04版本,居然碰到一个在04和05版本才有的BUG(但在10.2.0.01版本中却不存在和这个BUG!真TM奇怪)
.....经过这次的经历,我发现要搞好EM还真不是件很容易的事情......
 
以下是安装配置的时候做的详细记录:
一、Oracle Enterprise Manager配置注意事项
1)  In Enterprise Manager Database Control with Oracle Database 10.2.0.4 and 10.2.0.5, the root certificate used to secure communications via the Secure Socket Layer (SSL) protocol will expire on 31-Dec-2010 00:00:00. The certificate expiration will cause errors if you attempt to configure Database Control on or after 31-Dec-2010. Existing Database Control configurations are not affected by this issue.
If you plan to configure Database Control with either of these Oracle Database releases, Oracle strongly recommends that you apply Patch 8350262 to your Oracle Home installations before you configure Database Control. Configuration of Database Control is typically done when you create or upgrade Oracle Database, or if you run Enterprise Manager Configuration Assistant (EMCA) in standalone mode.意即,在10.2.0.04或10.0.05版本中,自2011年开始,需要打8350262补丁,否则无法运行EM,因为安全证书将在2011-12-31号过期。
 
  2)In 10.2.x.x, to improve performance and reduce the workload on the RAC database/instances,when a DB Control is first deployed on a RAC cluster with n nodes, a dbconsole is started only on the node from which the DB Control is deployed. Each agent on each node reports to that same unique dbconsole management service.
It is however possible to later reconfigure the DB Control to have more than one dbconsole started and to have agents reporting to several dbconsole.
也就是说,在10.2.X.X RAC环境中,Oracle Enterprise Manager只能在配置DB Control的节点上运行。
二、Bug 8350262补丁安装
1)下载补丁解压后,认真浏览README.txt文本文件,按照指导完成该补丁的安装。
2)下载地址
https://support.oracle.com/CSP/ui/flash.html#tab=PatchHomePage(page=PatchHomePage&id=gj46o799()),(page=PatchSearchResultsHome&id=gj46pr1y(search=%3CSearch%3E%0A%20%20%3CFilter%20name=%22patch_number%22%20op=%22IS%22%20value=%228350262%22%20type=%22patch_number%22/%3E%0A%20%20%3CFilter%20name=%22platform%22%20op=%22IS%22%20value=%22%22%20type=%22platform%22/%3E%0A%3C/Search%3E&incFamilyProds=false&flag=search))
 
3)以下是README.txt全部内容:
=========================================================================
Interim Patch for Base Bug: 8350262
=========================================================================
Date: Sep 10, 2010
-------------------------------------------------------------------------
 Platform Patch for      : Generic
 Product Patched         : 10.2.0.4.0
 Product Version         : Enterprise Manager Database Control
 
Bugs Fixed by this patch:
-------------------------
8350262:CREATE DBCONSOLE CERT WITH 10YEAR VALIDITY
Patch Preinstall Steps:
-----------------------
1. For non-recommended patches, you must have the exact symptoms
   described in the service request (SR).
 
2. Verify the OUI Inventory.
OPatch needs access to a valid OUI inventory to apply patches.
Validate the OUI inventory with the following command:
  % opatch lsinventory
If the command errors out, contact Oracle Support and work to validate
and verify the inventory setup before proceeding.
 
3. Please use the latest Version of OPatch.
Oracle recommends that all customers be on the latest version of OPatch.
Please review the following metalink note and follow the instructions
to update to the latest version if needed:
 
https://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=224346.1
 
4. Confirm executables appear in your system PATH.
 
The patching process will use the unzip and the opatch executables.  After
sourcing the ORACLE_HOME environment, confirm both of these exist before
continuing:
 
  - "which opatch"
  - "which unzip"
 
If either of these executables do not show in the PATH, correct the problem
before proceeding.
 
5. Create a location for storing the unzipped patch.  This location
will be referred to later in the document as <PATCH_TOP>.
 
6. Unzip the patch zip file into the <PATCH_TOP>.
unzip -d <PATCH_TOP> p8350262_102040_Generic.zip
 
7. Shut down services running from the ORACLE_HOME.
Before applying this patch, do a clean shut down of all services
running from the ORACLE_HOME.
 
Patch Installation Steps:
-------------------------
1. Shutdown EM DB Console using the following command.
  % $ORACLE_HOME/bin/emctl stop dbconsole
2. Set your current directory to the directory where the patch is located:
  % cd <PATCH_TOP>/8350262
  Ensure that the directory containing the opatch script appears in your $PATH; then enter the following command:
   % opatch apply
3. Start EM DB Console using the following command.
    % $ORACLE_HOME/bin/emctl start dbconsole
 
NOTE:
------
There may be cases when Starting dbconsole may fail post 31-Dec-2010.
In this case, Please set ORACLE_HOME to your Database Home & ORACLE_SID and run the following from the patch folder.
 % ./killDBConsole
 
Patch Deinstallation Instructions:
----------------------------------
1. Shutdown EM DB Console using the following command.
       % $ORACLE_HOME/bin/emctl stop dbconsole
 
2. Set your current directory to the directory where the patch is located:
    % cd <PATCH_TOP>/8350262
 
3. Ensure that the directory containing the opatch script appears in your $PATH; then run the following command:-
   %  opatch rollback -id 8350262
  
4. Start EM DB Console using the following command.
      % $ORACLE_HOME/bin/emctl start dbconsole
 
以下是补丁安装步骤:
1)解压并CD到补丁目录下/orasoft/8350262
2)以Oracle用户登录到其中一个节点执行opathch(注意opatch路径不在环境变量中,需要指定或者用绝对路径)
[oracle@racdb1 8350262]$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.
Oracle 主目录       : /u01/app/oracle/product/10.2.0/db_1
主产品清单: /u01/app/oracle/oraInventory
从           : /etc/oraInst.loc
OPatch 版本    : 10.2.0.4.2
OUI 版本       : 10.2.0.4.0
OUI 位置      : /u01/app/oracle/product/10.2.0/db_1/oui
日志文件位置 : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-02-11_20-34-42下午.log
ApplySession 将中间补丁程序 '8350262' 应用到 OH '/u01/app/oracle/product/10.2.0/db_1' 
Running prerequisite checks...
OPatch 从产品清单中检测到节点列表和本地节点。OPatch 将对本地系统打补丁, 然后将补丁程序传播到远程节点。
为 Oracle 主目录备份文件和产品清单 (不是用于自动回退)
正在备份受补丁程序 '8350262' 影响的文件以用于恢复。此操作将需要一些时间...
正在备份受补丁程序 '8350262' 影响的文件以用于回退。此操作将需要一些时间...
 
正在为组件 oracle.sysman.agent.core, 10.2.0.4.0a 打补丁...
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class" 更新 jar 文件 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
ApplySession 将中间补丁程序 '8350262' 添加到产品清单 
Verifying the update...
Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8350262 are present in Oracle Home.
在滚动模式下打补丁。
Updating nodes 'racdb2'
   Apply-related files are:
     FP = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_files.txt"
     DP = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_dirs.txt"
     MP = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/make_cmds.txt"
     RC = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/remote_cmds.txt"
 
Instantiating the file "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes... 
OPatch succeeded.
[oracle@racdb1 8350262]$
 
三、创建Cluster Repos
1)       列出CRS名称
[oracle@racdb1 bin]$ /u01/app/crs/bin/cemutlo -n
crs
 
2)列出数据库的db_unique_name
SQL> show parameter db_unique_name;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      racdb
SQL>
 
3)运行emca配置cluster repos
[oracle@racdb1 ~]$ emca -config dbcontrol db -repos create -cluster
EMCA 开始于 2012-2-11 21:35:06
EM Configuration Assistant, 10.2.0.1.0 正式版
版权所有 (c) 2003, 2005, Oracle。保留所有权利。
 
输入以下信息:
数据库的唯一名称: racdb
监听程序端口号: 1521
集群名: crs
SYS 用户的口令: 
DBSNMP 用户的口令: 
SYSMAN 用户的口令:  t
通知的电子邮件地址 (可选):
通知的发件 (SMTP) 服务器 (可选):
ASM ORACLE_HOME [ /u01/app/oracle/product/10.2.0/db_1 ]:
ASM 端口 [ 1521 ]:
ASM 用户角色 [ SYSDBA ]:
ASM 用户名 [ SYS ]:
ASM 用户口令: 
-----------------------------------------------------------------
已指定以下设置
 
数据库 ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1
数据库实例主机名 ................ racdb1
监听程序端口号 ................ 1521
集群名 ................ crs
数据库的唯一名称 ................ racdb
通知的电子邮件地址 ...............
通知的发件 (SMTP) 服务器 ...............
ASM ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1
ASM 端口 ................ 1521
ASM 用户角色 ................ SYSDBA
ASM 用户名 ................ SYS
 
-----------------------------------------------------------------
是否继续? [是(Y)/否(N)]: y
2012-2-11 21:35:52 oracle.sysman.emcp.EMConfig perform
信息: 正在将此操作记录到 /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/racdb/emca_2012-02-11_09-35-06-下午.log。
2012-2-11 21:35:54 oracle.sysman.emcp.EMReposConfig createRepository
信息: 正在创建 EM 资料档案库 (此操作可能需要一段时间)...
2012-2-11 21:38:12 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功创建资料档案库
2012-2-11 21:38:14 oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
信息: 正在将 /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_racdb2_racdb2 传播到远程节点...
2012-2-11 21:38:15 oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
信息: 正在将 /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_racdb1_racdb1 传播到远程节点...
2012-2-11 21:38:17 oracle.sysman.emcp.EMAgentConfig deployStateDirs
信息: 正在将 /u01/app/oracle/product/10.2.0/db_1/racdb2_racdb2 传播到远程节点...
2012-2-11 21:38:19 oracle.sysman.emcp.EMAgentConfig deployStateDirs
信息: 正在将 /u01/app/oracle/product/10.2.0/db_1/racdb1_racdb1 传播到远程节点...
2012-2-11 21:38:20 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
信息: 正在保护 Database Control (此操作可能需要一段时间)...
2012-2-11 21:40:20 oracle.sysman.emcp.util.DBControlUtil startOMS
信息: 正在启动 Database Control (此操作可能需要一段时间)...
2012-2-11 21:42:07 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: 已成功启动 Database Control
2012-2-11 21:42:07 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 为 https://racdb1:1158/em <<<<<<<<<<<
2012-2-11 21:42:07 oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
信息:
****************  当前配置 ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------
racdb2            racdb2            racdb1
racdb1            racdb1            racdb1
 
已成功完成 Enterprise Manager 的配置
EMCA 结束于 2012-2-11 21:42:07
[oracle@racdb1 ~]$
 
4)检查Oracle EnterPrise Manager运行状态
[oracle@racdb1 ~]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0 
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
https://racdb1:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/racdb1_racdb1/sysman/log
[oracle@racdb1 ~]$