oracle 11.2.0.4.0配置OEM

来源:互联网 发布:php redis session 编辑:程序博客网 时间:2024/06/05 06:40

oralce 11g OEM组件及相関概念请参考dave大神的一片博文http://blog.csdn.net/tianlesoftware/article/details/5704374。
由于公司生产环境是前辈搭建的,当时在安装的时候没有搭建OEM,最近领导要看报表,所以想着基于生产环境搭建一套OEM好应付差事。
准备工作:
1、配置db_unqname
2、配置ORACLE_HOST_NAME,双节点都需要配置,并且ORACLE_HOSTNAME在/etc/hosts有定义
3、设置ssh对等性
4、配置sys,sysman,dbsnmp用户及密码
5、确保service_name或者SID正常注册到监听
6、确定集群名称

一般部署流程:

查看dbconsole状态

oracle@rac1 emctl status dbconsoleOC4J Configuration issue. /home/u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_server2_ghsjdb not found.

查看集群名:

grid@rac2:/home/grid>$ORACLE_HOME/bin/cemutlo -nrac-cluster

删除之前的配置:

oracle@rac1:/home/oracle>emca -deconfig dbcontrol db -repos drop -cluster 

配置11gR2 RC OEM:

oracle@rac1:/home/oracle>emca -config dbcontrol db -repos create -cluster

OEM常用的命令

1)创建一个EM资料库 ­    emca -repos create ­(2)重建一个EM资料库 ­    emca -repos recreate ­(3)删除一个EM资料库 ­    emca -repos drop ­(4)配置数据库的DatabaseControl ­    emca -config dbcontrol db ­(5)删除数据库的DatabaseControl配置 ­    emca -deconfig dbcontrol db ­(6)重新配置db control的端口,默认端口在1158 ­    emca -reconfig ports ­    emca -reconfig ports -dbcontrol_http_port 1160 ­    emca -reconfig ports -agent_port 3940 ­(7)先设置ORACLE_SID环境变量后,启动EM console服务 ­    emctl start dbconsole ­(8)先设置ORACLE_SID环境变量后,停止EM console服务 ­    emctl stopd bconsole ­(9)先设置ORACLE_SID环境变量后,查看EM console服务的状态 ­    emctl status dbconsole ­(10)配置dbconsole的步骤 ­    emca -repos create ­    emca -config dbcontrol db ­    emctl start dbconsole ­(11)重新配置dbconsole的步骤 ­    emca -repos drop ­    emca -repos create ­    emca -config dbcontrol db ­    emctl start dbconsole ­

问题1:

oracle.ops.mgmt.cluster.ClusterInfoException: PRKC-PRKC-1044 : Failed to check remote command execution setup for node jhdb02 using shells /usr/bin/ssh and /usr/bin/rsh File "/usr/bin/rsh" does not exist on node "jhdb02"Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). : <null>at oracle.ops.mgmt.cluster.ClusterInfo.getHostName(ClusterInfo.java:413)        at oracle.ops.mgmt.cluster.ClusterInfo.getHostName(ClusterInfo.java:381)

从提示来看,权限不对,使用rsh,ssh登录 jhdb02没有权限,自己尝试了下,ssh对等性验证失败,应为在部署RAC OEM的时候需要收集两个节点的信息
,所以需要配置ssh对等性。

jhdb02-> emca -config dbcontrol db -repos create -clusterSTARTED EMCA at Sep 21, 2017 4:26:55 PMEM Configuration Assistant, Version 11.2.0.3.0 ProductionCopyright (c) 2003, 2011, Oracle.  All rights reserved.Enter the following information:Database unique name: jhdbService name: jhdbListener port number: 1521Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]: Password for SYS user:  Password for DBSNMP user:  Password for SYSMAN user:  Cluster name: jhdbclusterEmail address for notifications (optional): Outgoing Mail (SMTP) server for notifications (optional): ASM ORACLE_HOME [ /u01/app/11.2.0/grid ]: ASM port [ 1521 ]: ASM username [ ASMSNMP ]: ASM user password:  ASM user password: Sep 21, 2017 4:28:15 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotelyWARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor-----------------------------------------------------------------You have specified the following settingsDatabase ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1Database instance hostname ................ Listener ORACLE_HOME ................ /u01/app/11.2.0/gridListener port number ................ 1521Cluster name ................ jhdbclusterDatabase unique name ................ jhdbEmail address for notifications ............... Outgoing Mail (SMTP) server for notifications ............... ASM ORACLE_HOME ................ /u01/app/11.2.0/gridASM port ................ 1521ASM user role ................ SYSDBAASM username ................ ASMSNMP-----------------------------------------------------------------Do you wish to continue? [yes(Y)/no(N)]: yesSep 21, 2017 4:28:23 PM oracle.sysman.emcp.EMConfig performINFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/jhdb/emca_2017_09_21_16_26_55.log.Sep 21, 2017 4:28:27 PM oracle.sysman.emcp.EMReposConfig createRepositoryINFO: Creating the EM repository (this may take a while) ...Sep 21, 2017 4:32:49 PM oracle.sysman.emcp.EMReposConfig invokeINFO: Repository successfully createdSep 21, 2017 4:32:53 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepositoryINFO: Uploading configuration data to EM repository (this may take a while) ...Sep 21, 2017 4:33:50 PM oracle.sysman.emcp.EMReposConfig invokeINFO: Uploaded configuration data successfullySep 21, 2017 4:33:50 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFilesINFO: Propagating /u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_jhdb01_jhdb to remote nodes ...Sep 21, 2017 4:33:53 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFilesINFO: Propagating /u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_jhdb02_jhdb to remote nodes ...Sep 21, 2017 4:33:58 PM oracle.sysman.emcp.EMAgentConfig deployStateDirsINFO: Propagating /u01/app/oracle/product/11.2.0/db_1/jhdb01_jhdb to remote nodes ...Sep 21, 2017 4:34:02 PM oracle.sysman.emcp.EMAgentConfig deployStateDirsINFO: Propagating /u01/app/oracle/product/11.2.0/db_1/jhdb02_jhdb to remote nodes ...Sep 21, 2017 4:34:07 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsoleINFO: Securing Database Control (this may take a while) ...Sep 21, 2017 4:34:33 PM oracle.sysman.emcp.util.DBControlUtil startOMSINFO: Starting Database Control (this may take a while) ...Sep 21, 2017 4:34:58 PM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: Database Control started successfullySep 21, 2017 4:34:58 PM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: >>>>>>>>>>> The Database Control URL is https://jhdb02:1158/em <<<<<<<<<<<Sep 21, 2017 4:35:01 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessageINFO: ****************  Current Configuration  **************** INSTANCE            NODE           DBCONTROL_UPLOAD_HOST----------        ----------        ---------------------jhdb              jhdb01              jhdb02jhdb              jhdb02              jhdb02Sep 21, 2017 4:35:01 PM oracle.sysman.emcp.EMDBPostConfig invokeWARNING: ************************  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/db_1/jhdb02_jhdb/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 successfullyFINISHED EMCA at Sep 21, 2017 4:35:01 PM

至此OEM创建完成。
但是过了一段时间发现OEM登录不上,决定重建OEM,为了投方便直接执行:

SQL > alter user syssnmp identified by oracle123 account unlock;jhdb02-> emca -config dbcontrol db -repos recreate -cluster
原创粉丝点击