网格控制器的客户端agent安装方式主要有OUI,COLNE,PUSH,PULL等几种,11g的版本的网格控制器agent不支持OUI方式安装,因而想要使用11g版本的OMA,需要采用后面三种方式安装!这三种方式当中,最快的应该是COLNE方式,其次是PULL方式,PUSH方式安装经过测试发现比较占用OMS服务器资源!本文介绍些如何在rhel5.4上使用PULL方式安装客户端agent,这种安装方法也叫做agentdownload方式!
PUSH方式安装请参考:http://ylw6006.blog.51cto.com/470441/775477
参考文档:
http://space.itpub.net/519536/viewspace-667753
http://gavinsoorma.com/2010/10/oracle-11g-grid-control-agent-deployment/
http://oracledb-admin.blogspot.jp/2011/05/gridcontrol-11g-agent-install-on-target.html
一:确定OMS正常运行,将agentdownload脚本发送到客户端上
- [oracle@ora11g ~]$ $OMS_HOME/bin/emctl status oms
- Oracle Enterprise Manager 11g Release 1 Grid Control
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- WebTier is Up
- Oracle Management Server is Up
- [oracle@ora11g ~]$ $AGENT_HOME/bin/emctl status agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- ---------------------------------------------------------------
- Agent Version : 11.1.0.1.0
- OMS Version : 11.1.0.1.0
- Protocol Version : 11.1.0.0.0
- Agent Home : /u01/app/oracle/Middleware/agent11g
- Agent binaries : /u01/app/oracle/Middleware/agent11g
- Agent Process ID : 16766
- Parent Process ID : 16746
- Agent URL : https://ora11g.yang.com:3872/emd/main/
- Repository URL : https://ora11g.yang.com:4900/em/upload
- Started at : 2012-04-02 12:00:08
- Started by user : oracle
- Last Reload : 2012-04-02 12:00:33
- Last successful upload : 2012-04-02 13:55:29
- Total Megabytes of XML files uploaded so far : 13.90
- Number of XML files pending upload : 0
- Size of XML files pending upload(MB) : 0.00
- Available disk space on upload filesystem : 16.25%
- Last successful heartbeat to OMS : 2012-04-02 14:01:38
- ---------------------------------------------------------------
- Agent is Running and Ready
- [oracle@ora11g ~]$ scp $OMS_HOME/sysman/agent_download/11.1.0.1.0/linux_x64/agentDownload.linux_x64 192.168.1.49:/home/oracle
二:在本例中客户端只安装数据库软件,未建库;在客户端上运行脚本进行安装
- [oracle@server49 ~]$ env |grep ORA
- ORACLE_SID=orcl
- ORACLE_BASE=/u01/app/oracle
- ORACLE_HOME=/u01/app/oracle/product/10.2.0/db1
- [oracle@server49 ~]$ ps -ef |grep ora
- root 1874 1852 0 13:59 ? 00:00:00 hald-addon-storage: polling /dev/hdc
- root 2326 2295 0 14:00 pts/1 00:00:00 su - oracle
- oracle 2327 2326 0 14:00 pts/1 00:00:00 -bash
- oracle 2393 2327 0 14:03 pts/1 00:00:00 ps -ef
- oracle 2394 2327 0 14:03 pts/1 00:00:00 grep ora
- [oracle@server49 ~]$ sh agentDownload.linux_x64 -b /u01/app/oracle -m ora11g.yang.com -r 4900 -y
- ———————————————其他输出省略———————————
- Provide the Agent Registration password so that the Management Agent can communicate with Secure Management Service.
- Note: You may proceed with the installation without supplying the password; however, Management Agent can be secured manually after the installation.
- If Oracle Management Service is not secured, agent will not be secured, so continue by pressing Enter Key.
- Enter Agent Registration Password: (此处输入密码)
- ———————————————其他输出省略———————————
- Configuration assistant "Agent Add-on Plug-in" Succeeded
- Querying Agent status: Agent is running
- Removing the copied stuff.....
- Removed: /home/oracle/agentDownload11.1.0.1.0Oui/oui_linux_x64.jar
- Removed: /home/oracle/agentDownload11.1.0.1.0Oui/agent_download.rsp
- Removed:/home/oracle/agentDownload11.1.0.1.0Oui/Disk1
- Log name of installation can be found at: "/u01/app/oracle/agentDownload.linux_x64040212140600.log"
- /u01/app/oracle/agent11g/root.sh needs to be executed by root to complete this installation.
- [root@server49 ~]# /u01/app/oracle/agent11g/root.sh
三:验证安装后,在客户端上建库测试
- [oracle@server49 ~]$ /u01/app/oracle/agent11g/bin/emctl status agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- ---------------------------------------------------------------
- Agent Version : 11.1.0.1.0
- OMS Version : 11.1.0.1.0
- Protocol Version : 11.1.0.0.0
- Agent Home : /u01/app/oracle/agent11g
- Agent binaries : /u01/app/oracle/agent11g
- Agent Process ID : 5798
- Parent Process ID : 5780
- Agent URL : https://server49.yang.com:3872/emd/main/
- Repository URL : https://ora11g.yang.com:4900/em/upload
- Started at : 2012-04-02 14:12:25
- Started by user : oracle
- Last Reload : 2012-04-02 14:12:25
- Last successful upload : 2012-04-02 14:13:08
- Total Megabytes of XML files uploaded so far : 2.11
- Number of XML files pending upload : 0
- Size of XML files pending upload(MB) : 0.00
- Available disk space on upload filesystem : 42.34%
- Last successful heartbeat to OMS : 2012-04-02 14:13:26
- ---------------------------------------------------------------
- Agent is Running and Ready
四:排错示例
1:在另外一台服务器上同样的方式安装完agent后,发现启动agent报错如下
- [oracle@dg1 ~]$ /u01/app/oracle/agent11g/bin/emctl secure agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- Agent is already stopped... Done.
- Securing agent... Started.
- Enter Agent Registration Password :
- Securing agent... Successful.
- [oracle@dg1 ~]$ /u01/app/oracle/agent11g/bin/emctl status agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- ---------------------------------------------------------------
- Agent is Not Running
- [oracle@dg1 ~]$ /u01/app/oracle/agent11g/bin/emctl start agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- Starting agent ....... failed.
- Failed to initialize the Fetchlet Manager.
- Consult the log files in: /u01/app/oracle/agent11g/sysman/log
2:查看日志后,猜想是由于该数据库服务器上存在EM的问题,因而删除EM,删除后,发现错误依旧!
- [oracle@dg1 log]$ pwd
- /u01/app/oracle/agent11g/sysman/log
- [oracle@dg1 log]$ tail -2 emagent.trc
- 2012-04-02 23:56:50,680 Thread-1109120944 ERROR fetchlets: Error when initializing C Logging Package for ECID generation.
- 2012-04-02 23:56:50,680 Thread-1109120944 ERROR main: nmefmgr_initialize failed sh to initialize Fetchlet Manager
- [oracle@dg1 log]$ emca -deconfig dbcontrol db -repos drop
- STARTED EMCA at Apr 2, 2012 11:59:30 PM
- EM Configuration Assistant, Version 11.2.0.3.0 Production
- Copyright (c) 2003, 2011, Oracle. All rights reserved.
- Enter the following information:
- Database SID: Database SID: dg1
- Listener port number: 1521
- Password for SYS user:
- Password for SYSMAN 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
- Apr 3, 2012 12:01:14 AM oracle.sysman.emcp.EMConfig perform
- INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/dg/emca_2012_04_02_23_59_28.log.
- Apr 3, 2012 12:01:15 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
- INFO: Stopping Database Control (this may take a while) ...
- Apr 3, 2012 12:01:19 AM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Dropping the EM repository (this may take a while) ...
- Apr 3, 2012 12:06:01 AM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Repository successfully dropped
- Enterprise Manager configuration completed successfully
- FINISHED EMCA at Apr 3, 2012 12:06:07 AM
3:发现该服务器的主机名解析只是单纯使用DNS,未使用hosts文件
- [root@dg1 ~]# hostname
- dg1.yang.com
- [root@dg1 ~]# cat /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.1.61 dg1.yang.com dg1 #(添加这行)
- 设置下ORACLE_UNQNAME变量,启动agent,居然奇迹般的正常了!
- [oracle@dg1 log]$ export ORACLE_UNQNAME=dg1.yang.com
- [oracle@dg1 log]$ /u01/app/oracle/agent11g/bin/emctl start agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- Starting agent ....... started.
- [oracle@dg1 log]$ /u01/app/oracle/agent11g/bin/emctl status agent
- Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
- Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
- ---------------------------------------------------------------
- Agent Version : 11.1.0.1.0
- OMS Version : 11.1.0.1.0
- Protocol Version : 11.1.0.0.0
- Agent Home : /u01/app/oracle/agent11g
- Agent binaries : /u01/app/oracle/agent11g
- Agent Process ID : 4641
- Parent Process ID : 4623
- Agent URL : https://192.168.1.61:3872/emd/main/
- Repository URL : https://ora11g.yang.com:4900/em/upload
- Started at : 2012-04-03 00:15:20
- Started by user : oracle
- Last Reload : 2012-04-03 00:15:20
- Last successful upload : 2012-04-03 00:16:13
- Total Megabytes of XML files uploaded so far : 9.79
- Number of XML files pending upload : 0
- Size of XML files pending upload(MB) : 0.00
- Available disk space on upload filesystem : 57.22%
- Last successful heartbeat to OMS : 2012-04-03 00:16:25
- ---------------------------------------------------------------
- Agent is Running and Ready
结论:在使用网格控制器agent的服务器上,本机主机名的解析在hosts文件中必须指定;同一台服务器,可以同时使用EM和GC管理数据库
[root@dg1 ~]# nslookup dg1.yang.com
Server: 192.168.1.100
Address: 192.168.1.100#53
Name: dg1.yang.com
Address: 192.168.1.61