Cloning Oracle Management Agent 11.1.0.1 (command line example)

There are multiple ways to install management agent, in this example I will use cloning process of installation.
I am going to clone Oracle Management Agent from host where OMS 11.1.0.1 is already installed.

As first, stop the agent on the OMS host.

[oracle@ed01pc bin]$ ./emctl stop agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0 
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Stopping agent ... stopped.
[oracle@ed01pc bin]$

tar/zip the agent, I’ve used tar command.

[oracle@ed01pc ~]$ cd /u01/app/oracle/product/middleware/
[oracle@ed01pc middleware]$ tar -zcvf /home/oracle/agent.tar agent11g/

Start back the agent on the OMS host.

[oracle@ed01pc 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@ed01pc bin]$

Transfer the tar file on the host that you want to clone the agent, It’s up to you to decide which method you’re going to use.
Extract the tar/zip file.

[oracle@ed02pc ~]$ cd /u01/app/oracle/product/
[oracle@ed02pc product]$ tar -zxvf agent.tar

Next, execute runInstaller from $AGENT_HOME/bin, but the attributes you specify depends on what type of agent installation you are cloning.

* Cloning agent from host where it is installed together with OMS:

./runInstaller -clone -forceClone ORACLE_HOME=<Location_to_Agent's_OracleHome> ORACLE_HOME_NAME=<alphanumeric_without_special_characters> -noconfig -silent 
b_chainedInstall=false oracle.sysman.top.agent:s_installType=AGENT OMS_HOST=<oms_host> OMS_PORT=<oms_port>

* Cloning agent from host where it is installed as standalone installation:

./runInstaller -clone -forceClone ORACLE_HOME=<Location_to_Agent's_OracleHome> ORACLE_HOME_NAME=<alphanumeric_without_special_characters> -noconfig -silent 
OMS_HOST=<oms_host> OMS_PORT=<oms_port>

In my case I am cloning agent installed along with OMS.

[oracle@ed03pc product]$ export ORACLE_HOME=/u01/app/oracle/product/agent11g
[oracle@ed03pc product]$ cd $ORACLE_HOME/oui/bin/
[oracle@ed03pc bin]$ ./runInstaller -clone -forceClone ORACLE_HOME=/u01/app/oracle/product/agent11g ORACLE_HOME_NAME=AGENT_HOME -noconfig -silent 
b_chainedInstall=false oracle.sysman.top.agent:s_installType=AGENT OMS_HOST=ed01pc.example.com OMS_PORT=4900

The previous command will ask you to run execute /u01/app/oracle/product/agent11g/root.sh script as root user.

[oracle@ed03pc bin]$ su -
Password: 
[root@ed03pc ~]# sh /u01/app/oracle/product/agent11g/root.sh
[root@ed03pc ~]#

Now, we have to configure the agent, run agentca -f from $AGENT_HOME/bin

[oracle@ed03pc bin]$ cd /u01/app/oracle/product/
11.2.0/     agent11g/   agent1.tar  
[oracle@ed03pc bin]$ cd $ORACLE_HOME/bin
[oracle@ed03pc bin]$ pwd
/u01/app/oracle/product/agent11g/bin
[oracle@ed03pc bin]$ ./agentca -f

Finally, check agent status.

[oracle@ed03pc 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/product/agent11g
Agent binaries    : /u01/app/oracle/product/agent11g
Agent Process ID  : 5265
Parent Process ID : 5248
Agent URL         : http://ed03pc.example.com:3872/emd/main/
Repository URL    : https://ed01pc.example.com:4900/em/upload/
Started at        : 2013-04-10 15:17:09
Started by user   : oracle
Last Reload       : 2013-04-10 15:17:09
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far :     0.00
Number of XML files pending upload           :       77
Size of XML files pending upload(MB)         :    23.89
Available disk space on upload filesystem    :    55.84%
Last attempted heartbeat to OMS              : 2013-04-10 15:19:43
Last successful heartbeat to OMS             : unknown
---------------------------------------------------------------
Agent is Running and Ready
[oracle@ed03pc bin]$

You can see the agent can’t communicate with the OMS (Last successful heartbeat to OMS has status unknown), this is because in my case when I installed the OMS I’ve configured to accept connection only from secured agents. So, we need to secure the agent.

[oracle@ed03pc 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 successfully stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password : 
Agent successfully restarted...   Done.
Securing agent...   Successful.
[oracle@ed03pc bin]$

Now the agent status should be OK.

[oracle@ed03pc 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/product/agent11g
Agent binaries    : /u01/app/oracle/product/agent11g
Agent Process ID  : 5805
Parent Process ID : 5788
Agent URL         : https://ed03pc.example.com:3872/emd/main/
Repository URL    : https://ed01pc.example.com:4900/em/upload
Started at        : 2013-04-10 15:22:02
Started by user   : oracle
Last Reload       : 2013-04-10 15:22:02
Last successful upload                       : 2013-04-10 15:22:36
Total Megabytes of XML files uploaded so far :    32.38
Number of XML files pending upload           :        1
Size of XML files pending upload(MB)         :     0.01
Available disk space on upload filesystem    :    55.88%
Last successful heartbeat to OMS             : 2013-04-10 15:22:04
---------------------------------------------------------------
Agent is Running and Ready
[oracle@ed03pc bin]$

Leave a Reply