Monday 13 April 2015

Opatch: LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo : OPatch failed with error code 73

Problem
While running opatch lsinventory, command fails with the below error:

Inventory load failed... OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
   Oracle Home dir. path does not exist in Central Inventory
   Oracle Home is a symbolic link
   Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73


Solution
Attach the Oracle Home to the Central Inventory:

$ cd $ORACLE_HOME/oui/bin 
$ ./attachHome.sh

Now check, command should work fine.

$ORACLE_HOME/OPatch/opatch lsinventory

Friday 10 April 2015

How to change EM Agent Port ?

EM Agent uses a specific port to receive requests. This port is defined during installation. We faced an issue while installing OID and ODS, both have EMAGENT component:

Processes in Instance: oid1
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component                    | process-type       |     pid | status   |        uid |  memused |    uptime | ports
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
oid1                             | oidldapd           |   31821 | Alive    | 1389237283 |  1472620 |  21:24:59 | N/A
oid1                             | oidldapd           |   31790 | Alive    | 1389237282 |   415084 |  21:25:00 | N/A
oid1                             | oidmon             |   31754 | Alive    | 1389237281 |   559676 |  21:25:00 | LDAPS:4040,LDAP:4041
EMAGENT                          | EMAGENT            |   31755 | Alive    | 1389237280 |   106148 |  21:25:00 | N/A



Processes in Instance: ods1
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component                    | process-type       |     pid | status   |        uid |  memused |    uptime | ports
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
EMAGENT                          | EMAGENT            |   30455 | Down    |  436375769 |   106148 |   | N/A


If by mistake you give same port to EMAGENT during installation of OID and ODS then it will give you an exception of "Address already in use or bind exception" while starting the component. EMAGENT can be seen as down in one of the instance.

Solution

You have to change EMAGENT port for one of the component.

Steps

1. Stop the EMAgent.
$ $AGENT_HOME/bin/emctl stop agent

In our case $AGENT_HOME=/home/ajNode1/instances/ods1/EMAGENT/EMAGENT

2. Modify the $AGENT_HOME/sysman/config/emd.properties file in the EMAgent home directory:
    For example:
    EMD_URL=http://ajmachine1:5011/emd/main

    Modify the <port number> in the EMD_URL property so the EMAgent uses a new unused port on the target host.
    EMD_URL=http://ajmachine1:5015/emd/main

3. Start the EMAgent.
$ $AGENT_HOME/bin/emctl start agent

Error while creating ovd component on second node

Issue
While doing cluster installation of Oracle Virtual Directory (OVD), we faced this issue. When you run config.sh from $ORACLE_IDM_HOME/bin, it goes successful and creates a ovd component, however it register it as ovd1 instead of ovd2 on second node.

Hence, folder structure created is something like this for 2 nodes:

on Node1: OVD1 server: /home/ajnode1/instances/ovdinst1/config/OVD/ovd1

on Node2: OVD2 server: /home/ajnode2/instances/ovdinst2/config/OVD/ovd1

Due to same name of ovd instance on both nodes, it creates a confusion and it is difficult to monitor.

Solution
It is a bug, and only solution is to manually create the component on second node.

a) Stop ovd2:

/home/ajnode2/instances/ovdinst2/bin/opmnctl stopall

b) Delete the component:

/home/ajnode2/instances/ovdinst2/bin/opmnctl deletecomponent -componentName ovd1

c) Create a new OVD component and name it ovd2 (fill the values accoring to your environment

-bash-4.1$ ./opmnctl createcomponent -adminHost <admin_host> -adminPort <admin_port> -adminUsername <weblogic> -componentName ovd2 -componentType OVD -admin cn=orcladmin -isAdminSSL true -ovdAdminPort <ovd_admin_port> -namespace <dc=your company,dc=com> -ldapPort <Non SSL Port> -ldapSport <SSL Port>

Command requires login to weblogic admin server (localhost):
  Username: weblogic
  Password:


Creating empty component directories...Done
Provisioning OVD files for ovd2
  OVD creation in progress
  Creating OVD specific directories
  Copying Configuration Files
  Registering OVD Ports
  Updating OVD Admin Password
OVD Admin Password:

  Setting CSF values
  Updating Configuration Files
  Adding opmn Snippet
  Setting proxy mbean information
Registering ovd2 component
Command succeeded.


d) Restart the ovd server on second node.