Installing Grid Control (10.2.0.3) ON Oracle Enterprise Linux 5.4

一、概述

这篇文章介绍如何在Oracle EnterPrise Linux 5上安装Oracle Enterprise Manager Grid Control (10.2.0.5).首先我们需要了解Oracle Enterprise Manager 10g Grid Control的概念.它包括三个主要的组件:

  • Oracle Management Service
  • Oracle Database(the OEM repository)
  • Oracle Management Agent

如下图所示:

Grid Control console是一个基于web的用户界面.主要是用来监控、管理数据中心的目标数据库.

Oracle Management Agent主要负责监控目标端,如果要监控一个目标,你就需要在其上面安装Agent.不管一台主机上运行了多少实例,你只需要在每台主机上安装一个代理即可.Agent收集目标数据库的可用性、配置信息、性能,并将这些发送给OMS.

Oracle Management Service是一个J2EE web应用程序.用于对Grid Control console做呈现.OMSagent接受信息并将其保存到Oracle Management Repository库中.OMS进程会去监控每一个目标机还有它的作业信息.同时,OMSOracle Management Repository中获取数据并显示到Grid Control console.

Oracle Management Repository包含的对象如:RDBMS jobs,packages,procedures,views和两个表空间(Mgmt_tablespace and Ecm_depot_tables)在数据库中,还包括了管理员、目标、Grid Control中的应用程序管理的所有可用信息.

在这里要提到的是,我们安装Grid Control的时候,OUI图形界面提供了两种不同的安装方式去建立Oracle Management Repository.

  • Installing Enterprise Manager 10g Grid Control Using a New Database.
  • Installing Enterprise Manager 10g Grid Control Using an Existing Database.

因为在OCM的考试中,会使用到第二种,也就是已存在的Database来创建.所以这篇文档也就采用了第二种方式来进行安装.我们会使用到两台机器.

  • 第一台机器安装Oracle Management Repository.
  • 第二台机器上安装OMS.
  • 第一台机器上安装Agent.

二、认证需求

首先,我们要检查我们的操作系统版本是否支持我们的Oracle Grid Control.在这里我们需要上Support.oracle.com上的认证板块.我们查询到了10.2.0.5在Oracle Enterprise Linux 5上已经通过了认证.在这里需要阐述一点是接下来的安装步骤是:

  • 安装Grid Control的完整安装包(10.2.0.1 or 10.2.0.3).
  • Apply Patch到10.2.0.5.

在这里需要阐述一点的是,在Oracle官方网站上下到的10.2.0.1是32位的.只有完整安装包10.2.0.3是64位的,我这篇文章是在Oracle Enterprise Linux 5.4 (64位)上面先安装Grid Control 10.2.0.3 64位完全版.然后在Apply Patch到10.2.0.5上.涉及到的安装包如下:

  • Linux_x86_64_Grid_Control_full_102030_disk1.zip
  • Linux_x86_64_Grid_Control_full_102030_disk2.zip
  • gc_x86_64_10205_part1of2.zip
  • gc_x86_64_10205_part2of2.zip

三、安装需求

这里我的环境是两台虚拟机,第一台叫gc-a,第二台叫gc-b,我已经在gc-a机器上安装了10.2.0.5的数据库叫emrep.具体如下所示:

gc-a:

  • ORACLE_HOME=/oracle/app/oracle/product/10.2.0/db_1
  • ORACLE_SID=emrep

gc-b:

  • OMS_HOME=/oracle/app/oracle/product/oms10g
  • AGENT_HOME=/oracle/app/oracle/product/agent10g
这里不介绍A机数据库的安装,所以接下来的操作如果没有明确指示,都是在B机上操作.
1.确定操作系统的包.

make-3.81-3.el5.x86_64.rpm</pre>
binutils-2.17.50.0.6-12.el5.x86_64.rpm
gcc-4.1.2-46.el5.x86_64.rpm
glibc-devel-2.5-42.i386.rpm
glibc-devel-2.5-42.x86_64.rpm
libXp-1.0.0-8.1.el5.i386.rpm
libXp-1.0.0-8.1.el5.x86_64.rpm

2.设置操作系统的内核参数

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

kernel.shmmax和kernel.shmall两个参数我没有设置值大小,因为系统本身设置的值大于我们要设置的值;
3.设置用户和组

[root@gc-b Server]# groupadd -g 501 oinstall
[root@gc-b Server]# groupadd -g 502 dba
[root@gc-b Server]# groupadd -g 503 oper
[root@gc-b Server]# useradd -u 501 -g oinstall -G dba,oper oracle
[root@gc-b Server]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

4.创建目录

[root@gc-b ~]# mkdir -p /oracle/app/oracle/product/oms10g
[root@gc-b ~]# mkdir -p /oracle/app/oracle/product/agent10g
[root@gc-b ~]# chown -R oracle.oinstall /oracle

5.设置HOST文件

[oracle@gc-b agent10g]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.204.118 gc-a.localdomain gc-a
192.168.204.119 gc-b.localdomain gc-b

6.设置环境变量

export ORACLE_BASE=/oracle/app/oracle
export OMS_HOME=/oracle/app/oracle/product/oms10g
export AGENT_HOME=/oracle/app/oracle/product/agent10g
export PATH=$PATH:/usr/bin:/sbin:/usr/local/bin:/usr/sbin:$OMS_HOME/bin:$OMS_HOME/opmn/bin
export LD_LIBRARY_PATH=/usr/lib:$OMS_HOME/lib:$OMS_HOME/opmn/lib:$AGENT_HOME/lib:$OMS_HOME/perl/lib/5.6.1

7.在A机上对数据库做设置
a.查看是否有DBMS_SHARED_POOL 这个Package.如果没有需要运行@?/rdbms/admin/dbmspool.sql

SQL> select count(*) from DBA_OBJECTS where object_name='DBMS_SHARED_POOL';
  COUNT(*)
----------
         2

b.删除已经存在的em respository

[oracle@gc-a ~]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https://gc-a.localdomain:5500/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /oracle/app/oracle/product/10.2.0/db_1/gc-a.localdomain_emrep/sysman/log

[oracle@gc-a ~]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https://gc-a.localdomain:5500/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /oracle/app/oracle/product/10.2.0/db_1/gc-a.localdomain_emrep/sysman/log
[oracle@gc-a ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Mar 11, 2012 6:06:50 AM
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2009, Oracle.  All rights reserved.

Enter the following information:
Database SID: emrep
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
Mar 11, 2012 6:07:03 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/emrep/emca_2012-03-11_06-06-50-AM.log.
Mar 11, 2012 6:07:04 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Mar 11, 2012 6:07:09 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Mar 11, 2012 6:07:09 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Mar 11, 2012 6:07:46 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully

FINISHED EMCA at Mar 11, 2012 6:07:46 AM

四、开始安装
1.上传文件并解压.

把10.2.0.3的安装包上传到B机,然后解压安装包.

2.制定安装类型,选择使用已经存在的Database

3.指定安装路径

4.指定Inventory的目录

5.安装前校验

这里出现了错误,主要是软件包的问题,上述错误显示如下:

Checking operating system package requirements …
Checking for make-3.79; found make-1:3.81-3.el5. Passed
Checking for binutils-2.15.92.0.2-13; found binutils-2.17.50.0.6-12.el5. Passed
Checking for gcc-3.4.3-22.1; found gcc-4.1.2-46.el5. Passed
Checking for libaio-0.3.96; found libaio-0.3.106-3.2. Passed
Checking for glibc-common-2.3.4-2.9; found glibc-common-2.5-42. Passed
Checking for libstdc++-3.4.3-22.1; found libstdc++-4.1.2-46.el5. Passed
Checking for openmotif21-2.1.30-11; found Not found. Failed <<<<
Checking for pdksh-5.2.14-30; found Not found. Failed <<<<
Checking for setarch-1.6-1; found setarch-2.0-1.1. Passed
Checking for gnome-libs-1.4.1.2.90-44.1; found Not found. Failed <<<<
Checking for sysstat-5.0.5-1; found sysstat-7.0.2-3.el5. Passed
Checking for compat-db-4.1.25-9; found Not found. Failed <<<<
Checking for control-center-2.8.0-12; found control-center-1:2.16.0-16.el5. Passed
Checking for xscreensaver-4.18-5.rhel4.2; found Not found. Failed <<<<
Check complete. The overall result of this check is: Failed <<<<
Problem: Some packages required for the Oracle EnterPrise Manager 10gR2 to function properly are missing (see above).

在这儿我们只需要把pdksh和compat-db处理掉,就行了.还剩下openmotif21-2.1.30-11、gnome-libs-1.4.1.2.90-44.1、xscreensaver-4.18-5.rhel4.2这三个包在Linux 5上是没有的.经过测试不用安装也行.

[root@gc-b Server]# rpm -Uvh pdksh-5.2.14-36.el5.x86_64.rpm
warning: pdksh-5.2.14-36.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:pdksh                  ########################################### [100%]

[root@gc-b Server]# rpm -Uvh compat-db-4.2.52-5.1.i386.rpm
warning: compat-db-4.2.52-5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:compat-db              ########################################### [100%]
[root@gc-b Server]# rpm -Uvh compat-db-4.2.52-5.1.x86_64.rpm
warning: compat-db-4.2.52-5.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:compat-db              ########################################### [100%]

6.指定Repository Database配置

[注]下面那两个指定表空间的是A机的路径.

修改A服务器参数dispatchers

SQL> show parameter dispatcher

NAME                                 TYPE        VALUE
----------------------------------------------- ------------------------------
dispatchers                         string      (PROTOCOL=TCP) (SERVICE=emrepX
                                                 DB)
max_dispatchers                      integer

SQL> alter system set dispatchers='';

System altered.


修改A服务器参数session_cached_cursors为200

SQL> alter system set session_cached_cursors=200 scope=spfile;

System altered.


修改A服务器参数aq_tm_processes为1

SQL> show parameter aq_tm_processes

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     0
SQL> alter system set aq_tm_processes=1;

System altered.

SQL> show parameter aq_tm_processes

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     1

7.指定Optional配置

8.指定密码

9.安装概要

10.安装

在安装OMS的时候会报一个错误,这个错误如上图所示,这个时候我们不要点其他的, 先手动去启动OPMN,启动成功后,再返回到该界面点Continue.结果我在手动启动的时候OPMN的时候报错,后来查询了Google,需要做如下Link才能启动OPMN.

ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2

[oracle@gc-b bin]$ ./opmnctl startall
opmnctl: starting opmn and all managed processes...
================================================================================
opmn id=gc-b.localdomain:6200
    3 of 4 processes started.

ias-instance id=EnterpriseManager0.gc-b.localdomain
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ias-component/process-type/process-set:
    HTTP_Server/HTTP_Server/HTTP_Server

Error
--> Process (pid=1664)
    failed to start a managed process after the maximum retry limit
    Log:
    /oracle/app/oracle/product/oms10g/opmn/logs/HTTP_Server~1

[oracle@gc-b bin]$ cd /oracle/app/oracle/product/oms10g/opmn/logs/
[oracle@gc-b logs]$ ls
HTTP_Server~1  ipm.log  OC4J~home~default_island~1  ons.log  opmn.log  states  WebCache~WebCache~1  WebCache~WebCacheAdmin~1
[oracle@gc-b logs]$ tail -200f HTTP_Server~1

--------
12/03/20 11:19:20 Start process
--------
/oracle/app/oracle/product/oms10g/Apache/Apache/bin/apachectl start: execing httpd
/oracle/app/oracle/product/oms10g/Apache/Apache/bin/httpd: error while loading shared libraries: libdb.so.2: cannot open shared object file: No such file or directory

--------
12/03/20 11:19:20 Start process
--------
/oracle/app/oracle/product/oms10g/Apache/Apache/bin/apachectl start: execing httpd
/oracle/app/oracle/product/oms10g/Apache/Apache/bin/httpd: error while loading shared libraries: libdb.so.2: cannot open shared object file: No such file or directory

[root@gc-b Server]# ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2

[oracle@gc-b bin]$ ./opmnctl startall
opmnctl: starting opmn and all managed processes...

[root@gc-b bin]# ./opmnctl status

Processes in Instance: EnterpriseManager0.gc-b.localdomain
-------------------+--------------------+---------+---------
ias-component      | process-type       |     pid | status
-------------------+--------------------+---------+---------
DSA                | DSA                |     N/A | Down
HTTP_Server        | HTTP_Server        |    5011 | Alive
LogLoader          | logloaderd         |     N/A | Down
dcm-daemon         | dcm-daemon         |     N/A | Down
OC4J               | home               |    5012 | Alive
WebCache           | WebCache           |    5029 | Alive
WebCache           | WebCacheAdmin      |    5020 | Alive

11.运行Root.sh

[root@gc-b bin]# /oracle/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oracle/oraInventory to 770.
Changing groupname of /oracle/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@gc-b bin]# /oracle/app/oracle/product/oms10g/allroot.sh
Starting to execute allroot.sh .........
Starting to execute /oracle/app/oracle/product/oms10g/root.sh ......
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME=  /oracle/app/oracle/product/oms10g
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Adding entry to /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished execution of  /oracle/app/oracle/product/oms10g/root.sh ......
Starting to execute /oracle/app/oracle/product/agent10g/root.sh ......
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME=  /oracle/app/oracle/product/agent10g
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Finished execution of  /oracle/app/oracle/product/agent10g/root.sh ......

12.配置助手

最后一步到OMS Configuration报错了,这个错误在我的安装GRID CONTROL 10.2.0.3在做OMS配置的时候遇到OUI-25031解决办法做了详细说明.需要安装补丁8430622.安装完需要reset,然后再回来点Retry.

[oracle@gc-b 8430622]$ export ORACLE_HOME=/oracle/app/oracle/product/oms10g/
[oracle@gc-b 8430622]$ /oracle/app/oracle/product/oms10g/OPatch/opatch apply
Invoking OPatch 10.2.0.3.0

Oracle interim Patch Installer version 10.2.0.3.0
Copyright (c) 2005, Oracle Corporation.  All rights reserved..

Oracle Home       : /oracle/app/oracle/product/oms10g
Central Inventory : /oracle/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.3.0
OUI version       : 10.2.0.3.0
OUI location      : /oracle/app/oracle/product/oms10g//oui
Log file location : /oracle/app/oracle/product/oms10g/cfgtoollogs/opatch/opatch2012-03-23_05-24-01AM.log

ApplySession applying interim patch '8430622' to OH '/oracle/app/oracle/product/oms10g'

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '8430622' for restore. This might take a while...
Backing up files affected by the patch '8430622' for rollback. This might take a while...

Patching component oracle.sysman.top.oms, 10.2.0.3.0...
Updating jar file "/oracle/app/oracle/product/oms10g/sysman/jlib/emagentSDK.jar" with "/sysman/jlib/emagentSDK.jar/oracle/sysman/eml/sec/util/RootCert.class"
ApplySession adding interim patch '8430622' to inventory

Verifying the update...
Inventory check OK: Patch ID 8430622 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8430622 are present in Oracle Home.

OPatch succeeded.

[oracle@gc-b bin]$ opmnctl stopall
opmnctl: stopping opmn and all managed processes...

[oracle@gc-b bin]$ emctl secure oms -reset
Oracle Enterprise Manager 10g Release 3 Grid Control
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root Password :
Enter Agent Registration password :
OPMN processes already stopped...   Done.
Securing central oms...   Started.
Checking Repository...   Done.
Checking Em Key...   Done.
Checking Repository for an existing Enterprise Manager Root Key...
WARNING! An Enterprise Manager Root Key already exists in
the Repository. This operation will replace your Enterprise
Manager Root Key.
All existing Agents that use HTTPS will need to be
reconfigured if you proceed. Do you wish to continue and
overwrite your Root Key
(Y/N) ?
Y
Are you sure ? Reset of the Enterprise Manager Root Key
will mean that you will need to reconfigure each Agent
that is associated with this OMS before they will be
able to upload any data to it. Monitoring of Targets
associated with these Agents will be unavailable until
after they are reconfigured.
(Y/N) ?
Y
Generating Enterprise Manager Root Key (this takes a minute)...   Done.
Fetching Root Certificate from the Repository...   Done.
Generating Registration Password Verifier in the Repository...   Done.
Generating Oracle Wallet Password for Enterprise Manager OMS...   Done.
Generating Oracle Wallet for Enterprise Manager OMS...   Done.
Generating Oracle Wallet for iAS HTTP Server...   Done.
Updating HTTPS port in emoms.properties file...   Done.
Generating HTTPS Virtual Host for Enterprise Manager OMS...   Done.
Securing central oms...   Ended.

[oracle@gc-b bin]$ emctl start oms
Oracle Enterprise Manager 10g Release 3 Grid Control
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
opmnctl: opmn is already running
Starting HTTP Server ...
Starting Oracle Management Server ...
Checking Oracle Management Server Status ...
Oracle Management Server is Up.

13.安装结束

分享到: 更多

Post a Comment

Your email is never published nor shared. Required fields are marked *