OCM考试-安装Grid Control

ocm考试的重头戏之一,是安装grid control(以下简称gc)。

gc的安装分成3步骤:

根据考试要求,gc的建立是using a exsit database作为repository database的。因此,题目会要求建立一个新的dabase,这个database没有要求是用OUI建立还是命令行建立,可以根据个人习惯。我个人比较喜欢命令行,觉得简单直接而且速度快。下面我们先来建立这个database。

一、repository database的建立。
之前我们就已经手工建立过一个database,因此在建立repository database的时候,很多可以参考。
1、export ORACLE_SID=omcgc
2、建立ocmgc的密码文件
3、cp 原来的initocmdb.ora为initocmgc.ora
4、修改initocmgc.ora中的db_name,各个xxx_dump_dest的路径,修改control_files的路径。对于整体的替换,我们在vi中可以使用::%s/ocmdb/ocmgc/g 这样就把该文件中所有的ocmdb替换成了ocmgc。取消里面的关于shared server的配置:dispatchers、shared_servers
5、建立xxx_dump_dest的路径。
6、用这个pfile启动数据库到nomount,然后参考用之前用的create database语句建立数据库。(在线文档administrator guide-Part I Basic Database Administration-2 creating an oracle database – Step 7: Issue the CREATE DATABASE Statement)
7、@?/rdbms/admin/catalog
8、@?/rdbms/admin/catproc
9、@?/rdbms/admin/dbmspool<--注意,这个必须,不然gc会失败。 10、alter system register;注册侦听。 二、建立gc 1、检查/etc/hosts是否正确。建议可以如下:

2、root权限下执行xhost + 3、进gc的安装程序,./runInstaller 4、以下看图说话: 4.1 [caption id="attachment_925" align="aligncenter" width="500"]gc install step 1[/caption]

4.2
gc install step 2

4.3

4.4

注意这里可能会有个报错:openmotif21-2.1.30-11.RHEL4.4; found Not found. 这个可以不管,因为这个包是个gc的一个demo有关,我们不安装demo。

4.5

在这里,我们要注意修改路径为奇数机的repository database数据文件的路径。不然后面在configure gc的时候,在经过漫长的等待,会报错。
而且在报错信息中很难找到错误的原因:INFO: The "/oracle/app/oracle/OracleHomes/agent10g/cfgtoollogs/configToolFailedCommands" script contains all commands that failed, were skipped or were cancelled. This file may be used to run these configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.

这个时候,你去看/oracle/app/oracle/OracleHomes/agent10g/cfgtoollogs/configToolFailedCommands,只能发现。这个信息不是有用的信息:
[root@ocmdb2 logs]# cat /oracle/app/oracle/OracleHomes/oms10g/cfgtoollogs/configToolFailedCommands
# Copyright (c) 1999, 2009, Oracle. All rights reserved.
oracle.sysman.emcp.oms.OmsPlugIn -configureOms

其实,你应该去找/oracle/app/oracle/OracleHomes/oms10g/cfgtoollogs/emca_repos_createxx_xx_xx.log
如果你的数据文件的路径没有配正确,你会在这个log中发现:
ERROR at line 1:
ORA-01119: error in creating database file
'/oracle/app/oracle/OracleHomes/oms10g/oradata/mgmt.dbf'
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
ORA-06512: at line 44

要是之前没配对,在这个时候再去改,就来不及了。

4.6

修改一下pfile中的一些参数

4.7

4.8

注意密码至少5位,且包含至少1位的数字。

4.9

4.10

4.11

另开个窗口看日志

4.12

4.13

运行allroot.sh ,这个……大哥,你懂的……

4.14

开始configure,漫长的等待……特别是在oms configuration那一步,出去上个厕所应该没问题。

4.15

大功告成!

三、安装agent
我们用agentDownload脚本来跑。
agentDownload的脚本在刚刚安装完gc的偶数机的$OMS_HOME下的sysman/agent_download/version/os/agentDownload.os,形如:/oracle/app/oracle/OracleHomes/oms10g/sysman/agent_download/10.2.0.1.0/linux/agentDownload.linux
把这个脚本cp到奇数机下。开始安装:
1、chmod +x agentDownload.linux
2、测试prerequisite是否满足:
2.1 测试jar能否运行,不然运行的话,find / -name jar 把找到的路径发到PATH中。
2.2 测试wget能否运行。这个一般不是问题,如果不能,方法同上,加到PATH中。
2.3 不需要sshUserSetup.sh,这个是图形化的agent deploy才需要的。agentDownload不需要。
3、运行./agentDownload.linux -b 你希望安装agent的目录,形如./agentDownload.linux -b /oracle/app/oracle/agent
4、在一系列下载、解包、静默安装之后,agent安装完毕。记得运行root.sh,不然后面会死的很惨。
/oracle/app/oracle/agent/agent10g/root.sh
如果,没有执行,那么,在gc的target-database-configure时就会:

这个问题,我一直没发现,也找了好多资料尝试去绕过这个问题,如修改/oracle/app/oracle/OracleHomes/oms10g/sysman/config/emoms.properties中的oracle.sysman.emSDK.svlt.PublicServletEnabled参数。
后来删除agent10g下的所有文件,尝试重装agent,发现无法重装,总是报错:Completed with Status=255,而且不会再次生成agent10g的文件夹。
最后是通过删除oraInventory目录,再次运行agentDownload才搞定。
5、检查agent状态,在agent10g/bin下,注意一定要到这个目录下,哪怕你配置了PATH,在这个目录下运行:
[oracle@ocmdb1 bin]$ ./emctl status agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.2.0.1.0
OMS Version : 10.2.0.1.0
Protocol Version : 10.2.0.0.0
Agent Home : /oracle/app/oracle/agent/agent10g
Agent binaries : /oracle/app/oracle/agent/agent10g
Agent Process ID : 9385
Parent Process ID : 9361
Agent URL : https://localhost.localdomain:3872/emd/main/
Repository URL : https://ocmdb2.localdomain:1159/em/upload
Started at : 2010-04-11 21:25:01
Started by user : oracle
Last Reload : 2010-04-11 21:25:01
Last successful upload : 2010-04-11 21:56:39
Total Megabytes of XML files uploaded so far : 5.76
Number of XML files pending upload : 0
Size of XML files pending upload(MB) : 0.00
Available disk space on upload filesystem : 26.93%
Last successful heartbeat to OMS : 2010-04-11 21:56:41
---------------------------------------------------------------
Agent is Running and Ready

说明正常。

四、配置target database:
1、在偶数机上打开firefox,http://machinename:4889/em
2、看图说话:
2.1

2.2

2.3

2.4

2.5

相关文章

15条评论

  1. 我这个题目挂了
    我只能说
    如果你用已经存在的db建立gc不成功的话
    赶紧的,直接用新建db的模式建立一个gc

  2. re David.Guo:恩,using a new database会省心很多。谢谢分享你的经验。

  3. 写的很详细啊。

    新机器上安装比较痛快。
    我今天在一个Windows机上,一个9i、10g、11g三个HOME并存的环境再装GC(使用现有11g数据库),发现PATH变量被整得乱七八糟,sql*plus都会报错,折腾了好一会才理清楚。

  4. 小荷老师,能否详细说明以下三步该如何操作,具体命令,谢谢了!

    2、测试prerequisite是否满足:
    2.1 测试jar能否运行,不然运行的话,find / -name jar 把找到的路径发到PATH中。
    2.2 测试wget能否运行。这个一般不是问题,如果不能,方法同上,加到PATH中。

  5. “在这里,我们要注意修改路径为奇数机的repository database数据文件的路径。不然后面在configure gc的时候,在经过漫长的等待,会报错。
    而且在报错信息中很难找到错误的原因”
    那两个地址都要改吗?还是改下面的那个数据表空间路径?

  6. 小荷老师,您好!
    有几个问题请教您
    1)安装配置agent的时候,我执行了root.sh,为什么还是会报截图中的错误?!
    “oracle/app/oracle/agent/agent10g/root.sh
    如果,没有执行,那么,在gc的target-database-configure时就会”
    2)在ocm实际考试中,安装介质是使用10.2.0.1.0版本还是使用10.2.0.1.1版本?
    还需要配置操作系统的参数吗?还是已经配置好了,直接安装就可以了?
    谢谢!

  7. 小荷老师,您好!
    第一个问题解决了。原因是/etc/sysconfig/network中HOSTNAME=local.localdomain
    改成真实的主机名比如HOSTNAME=helaoshi.localdomain
    然后完全删除agent,再重新安装一遍,就解决了。
    我用的是虚拟机。
    陷阱真多啊!
    非常感谢您的这个系列的分享,给我很多帮助。

  8. [oracle@odd scripts]$ ./agentstup start
    在这一直等,就是没反应,啥也不输出。就后ctrl+c给终止了。
    [oracle@odd scripts]$
    请问你有遇到过吗?上面是在没有安装GC软件的主机上运行的。
    ———————————————————
    在安装GC的主机上启动时有报一个文件不存在,但最后还是启来了。网页也能登陆上去,也没找到是什么原因。
    [root@even admin]# /etc/init.d/gcstartup start
    opmnctl: starting opmn and all managed processes…
    grep: /u01/app/oracle/OracleHomes/agent10g/sysman/admin/ossupportedtzs.lst: No such file or directory
    Oracle Enterprise Manager 10g Release 10.2.0.1.0.
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    Starting agent …. started.
    [root@even admin]#
    您有遇到过吗?ossupportedtzs.lst这个文件应该是跟时区有关系吧,但问别人搞好的环境中,却没有这个文件,怪呀。

  9. 后来把agent重装了,现在已经不会一直等在那里了。
    但现在两台机子在执行gcstartup start都会报:/ossupportedtzs.lst: No such file or directory,搞不懂为什么会报这个,好像跟时区有关,但以前没过,后来报的,中途也没做什么改动。

  10. target-database 库总是宕的状态
    报: Get dynamic property error,Dynamic Category property
    通过configure进行监听测试也都正常。
    两台机子的agent也都启动了。
    你感觉有可能是哪里的问题,这个我遇着过两次了,总摸不着头绪,向你请教

  11. agent安装一次以后再次安装出现255的报错,只要修改/oracle/oraInventory/ContentsXML/inventory.xml里面agent的相关条目即可!

  12. 还需要设置好
    session_cached_cursors >=200 job_queue_processes>=10 open_cursors>=200 aq_tm_processes>=1

  13. Thread-105397168 ERROR command: nmejcn: received no status header from repository at https://omsmachine.domain:1159/em/upload
    ..
    Thread-3907406768 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository

    emagent.trc 里有这个报错的,在AGENT机器上执行下emctl secure agent 就OK了,折腾了好久。

回复 zhangliao 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据