Thursday, 9 February 2017

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 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

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

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

How to move the central Inventory (oraInventory) to another location.

Solution On Unix:

Find the current location of the central inventory (normally $ORACLE_BASE/oraInventory):

For example:

find /home/oracle -name oraInventory -print

 /u01/app/oracle/oraInventory

Open the oraInst.loc file in /var/opt/oracle and check the value of inventory_loc

cat /var/opt/oracle/oraInst.loc

inventory_loc=/u01/app/oracle/oraInventory inst_group=oinstall

Remark: The oraInst.loc file is simply a pointer to the location of the central inventory (oraInventory)

Copy the oraInventory directory to the destination directory

cp -Rp /home/oracle/oraInventory /app/oracle

Edit the oraInst.loc file to point to the new location

For example:

vi /var/opt/oracle/oraInst.loc

inventory_loc=/app/oracle/oraInventory inst_group=dba

Java.lang.OutOfMemoryError" Error When Applying Oracle Weblogic Server Patch(bsu.sh)

Java.lang.OutOfMemoryError" Error When Applying Oracle Weblogic Server Patch(bsu.sh)

While applying the latest PSU for Weblogic, you might get below error:

./bsu.sh -install -patch_download_dir=/home/oracle/fmw/product/112/utils/bsu/cache_dir -patchlist=S8C2 -prod_dir=/home/oracle/fmw/product/112/wlserver_10.3/

Exception in thread "main" java.lang.OutOfMemoryError: getNewTla
        at java.util.HashMap.createEntry(HashMap.java:897)
        at java.util.HashMap.addEntry(HashMap.java:884)
        at java.util.HashMap.put(HashMap.java:505)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.loadPropertyMap(XBeanDataHandler.java:778)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.(XBeanDataHandler.java:99)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.createDataHandler(XBeanDataHandler.java:559)

Cause:
The memory arguments are in bsu.sh are not sufficient

Solution:
1) Go to/u9000/app/oracle/product/ofm_11.1.1.6/fmw/utils/bsu
2) Take backup of bsu.sh and edit as below

> take back up and edit bsu.sh

From MEM_ARGS="-Xms256m -Xmx512m" to MEM_ARGS="-Xms1024m -Xmx1024m"

4) Apply the patch
./bsu.sh -install -patch_download_dir=/u9000/app/oracle/product/ofm_11.1.1.6/fmw/utils/bsu/cache_dir -patchlist=K25M -prod_dir=/u9000/app/oracle/product/ofm_11.1.1.6/fmw/wlserver_10.3
Checking for conflicts.....
No conflict(s) detected

Installing Patch ID: K25M..
Result: Success

Tuesday, 24 January 2017

Applying Patch sets 23743997,16702086 and 16205615 on Weblogic server, SOA and OSB

Applying Patch sets 23743997,16702086 and 16205615 on Weblogic server, SOA and OSB

High level steps:

Weblogic: Pre-Installation Instructions-(23743997)
-------------------------------------------
    
  $ . /u9000/app/oracle/product/ofm_11.1.1.6/fmw/wlserver_10.3 /server/bin/setWLSEnv.sh 

                                $ java weblogic.version

     PATCH_ID - K25M
     Patch number - 23743997

                1. Stop all weblogic services

                2. unzip p23743997_1036_Generic.zip to /u9000/app/oracle/product/ofm_11.1.1.6/fmw/utils/bsu/cache_dir or any local directory

                3. Navigate to the /u9000/app/oracle/product/ofm_11.1.1.6/fmw/utils/bsu directory

                4. ./bsu.sh -install -patch_download_dir=/u9000/app/oracle/product/ofm_11.1.1.6/fmw/utils/bsu/cache_dir -patchlist=K25M -prod_dir=/u9000/app/oracle/product/ofm_11.1.1.6/fmw/wlserver_10.3

Post-Installation Instructions
------------------------------

                1) Restart all WebLogic servers.

                2) The following command is a simple way to determine the application of WebLogic Server PSU.

                                $ . /u9000/app/oracle/product/ofm_11.1.1.6/fmw/wlserver_10.3 /server/bin/setWLSEnv.sh 

                                $ java weblogic.version

Uninstalling Oracle WebLogic Server Patch Set 
----------------------------------------------

                1. Stop all WebLogic Servers

                2. Navigate to /u9000/app/oracle/product/ofm_11.1.1.6/fmw/utils/bsu directory.

                3. ./bsu.sh -remove -patchlist= K25M -prod_dir=/u9000/app/oracle/product/ofm_11.1.1.6/fmw/wlserver_10.3

./bsu.sh -remove -patchlist=DEM4 -prod_dir=/u9000/app/oracle/product/ofm_11.1.1.6/fmw/wlserver_10.3

                4.Restart all WebLogic Servers.


SOA: Pre-Installation Instructions
-------------------------------------
./opatch lsinventory 

        1. Stop all soa services.

  2. Unzip the patch zip file into the PATCH_TOP.


    $ unzip -d PATCH_TOP p16702086_111160_Generic.zip

3. Set your current directory to the directory where the patch is located.

    $ cd PATCH_TOP/16702086

4. Run OPatch to apply the patch.

        $ opatch apply
-------------------------------------------------------------------------------------------------------
16922093: EMAIL NOTIFICATIONS ARE NOT SENT WITH CONTENT TYPE TEXT/HTML IN 11.1.1.6.6

1. Unzip the patch zip file into the PATCH_TOP.

   $ unzip -d PATCH_TOP p16922093_111167_Generic.zip

    NOTE: In WINDOWS, the unzip command might not work as this zip has
    certain contents which passes the 256 characters limit.
    To overcome this problem, please use alternate ZIP utility like
    7-Zip to unzip the patch.
    For example: To unzip using 7-zip, run the command:
         "c:\Program Files\7-Zip\7z.exe"  x p14302931_111154_Generic.zip

2. Set your current directory to the directory where the patch is located.

   $ cd PATCH_TOP/16922093/oui

3. Run OPatch to apply the patch.

   Run following command:
     - opatch apply

When OPatch starts, it validates the patch and makes sure that there are no
conflicts with the software already installed in the ORACLE_HOME.
  OPatch categorizes two types of conflicts:

     a. Conflicts with a patch already applied to the ORACLE_HOME
        In this case, stop the patch installation, and contact Oracle Support
        Services.
     b. Conflicts with subset patch already applied to the ORACLE_HOME
        In this case, continue the install, as the new patch contains all the
        fixes from the existing patch in the ORACLE_HOME.

7 Bugs Fixed by This Patch
--------------------------

  16922093: EMAIL NOTIFICATIONS ARE NOT SENT WITH CONTENT TYPE TEXT/HTML IN 11.1.1.6.6
Post-Installation Instructions:  
-------------------------------
Database Task:1

     1.For bug 13900609 - User should run soa_purge_scripts.sql after patch to rebuild purge procedure with the fix.
   
  2.$ORACLE_HOME/rcu/integration/soainfra/sql/upgsql/111170ps6/patch_bpelpkg_bug_13853994_oracle.sql on soainfra schema if backend is oracle database

       Once done DBA task, then ISS team will perform the restart the all services.
     3.Restart all servers (Admin Server and all Managed Server(s))

Deinstallation Instructions
----------------------------

1. Change to the directory where the patch was unzipped.

  $  cd PATCH_TOP/16702086

2. Run OPatch to deinstall the patch.

        $  opatch rollback -id 16702086

3. Restart all servers (Admin Server and all Managed Server(s))

OSB :Patch Installation Instructions:
------------------------------------

        ./opatch lsinventory

1. Stop all OSB services.

2. Set ORACLE_HOME env var to your OSB_HOME

  3.To apply the patch, unzip the PSE container file:

      unzip 16205615.zip

    4.Set your current directory to the directory where the patch is located:

    cd 16205615


5.Ensure that the directory containing the opatch script appears in
  your $PATH; then enter the following command:

    ./opatch apply -jdk -jre

    e.g. opatch apply -jdk /usr/local/packages/jdk14 -jre /usr/local/packages/jre14

Patch Deinstallation Instructions:
------------------------------------
1. Set your current directory to the directory where the patch is located & then enter the following command:

cd 16205615

./opatch rollback -id 16205615 -jdk -jre

Thursday, 5 January 2017

Upgrade steps for SOA 11.1.1.x to 11.1.1.7 (Doc ID 2041399.1)



A1. To upgrade, you first go to 11.1.1.7.0 from any 11.1.1.6.x release, and then apply the 11.1.1.7.x bundle patch onTOP of it.

Steps:
--------
1. 11.1.1.6.x to 11.1.1.7.0 
2. 11.1.1.7.0 to 11.1.1.7.x

Note: You can use the installer download from edelivery/OTN
Or
Use the patches
(Patch 16471502: ORACLE SOA SUITE 11G PATCH SET 6 (11.1.1.7.0))
(Patch 16471633: ORACLE SERVICE BUS 11G (11.1.1.7.0))

See: http://docs.oracle.com/cd/E28280_01/doc.1111/e16793/overview.htm#PATCH101

IMPORTANT
-------------
WRT to Bundle patches, on 11.1.1.7, SOA and OSB have different patch numbers
- SOA is on Patch 20423535: PS6 Bundle Patch 7 (11.1.1.7.7)
- OSB is on Patch 20423630: PS6 Bundle Patch 4 (11.1.1.7.4)

All relevant documents are found here.
--------------------------------------
SOA 11g: Bundle Patch Reference (Doc ID 1485949.1)
OSB 11g: Bundle Patch Reference (Doc ID 1499170.1)

The release documents are here
11.1.1.7 release doc - http://docs.oracle.com/cd/E23104_01/download_readme_ps6/download_readme_ps6.htm
11.1.1.8 release doc - http://docs.oracle.com/cd/E23104_01/download_readme_wc1118/download_readme_wc1118.htm

To go to 11.1.1.9.0, please see the following documentation:

 http://docs.oracle.com/middleware/11119/cross/upgradetasks.htm

Wednesday, 4 January 2017

opatch lsinventory error : LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

opatch lsinventory error : LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

$ /u01/app/R12/product/11.2.0/OPatch/opatch lsinventory --invPtrLoc=/etc/oraInst.loc
Oracle Interim Patch Installer version 11.2.0.3.2
Copyright (c) 2012, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/R12/product/11.2.0
Central Inventory : /u01/app/R12/oraInventory
   from           : /u01/app/R12/product/11.2.0/oraInst.loc
OPatch version    : 11.2.0.3.2
OUI version       : 11.2.0.3.0
Log file location : /u01/app/R12/product/11.2.0/cfgtoollogs/opatch/opatchAM_1.log

List of Homes on this system:

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
$

Fix
=====

$ cd $ORACLE_HOME/oui/bin
$ ./attachHome.sh
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 2006 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/R12/oraInventory
'AttachHome' was successful.

The Central Inventory is corrupted. The oraInst.loc file specified is not valid.

The Central Inventory is corrupted. The oraInst.loc file specified is not valid.
                                                 

Summary 
Trying to run $ opatch lsinventory to get the list of applied patches and software in an oracle installation and get the error:
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /p6data/orauser/osm/produt/11.2.0
Central Inventory : /oracle/DwhProd/orabin/oradb/oraInventory
   from           : /var/opt/oracle/oraInst.loc

OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0

Log file location : /p6data/orauser/osm/produt/11.2.0/cfgtoollogs/opatch/opatch2013-01-10_12-00-26PM.log

OPatch failed to locate Central Inventory.

Possible causes are: 

    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.

LsInventorySession failed: OPatch failed to locate Central Inventory.

Possible causes are: 

    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.

OPatch failed with error code 73
The reason for the error is that the content from file /var/opt/oracle/oraInst.loc is different from the content of file $ORACLE_HOME/oraInst.loc (where is supposed it has be the correct info). Usually the problem is that the file is owned by a different user/installation.

Workaround: Check the contents for the correct file $ORACLE_HOME/oraInst.loc and the contents of /var/opt/oracle/oraInst.loc

0. Rename the file: $ mv /var/opt/oracle/oraInst.loc /var/opt/oracle/oraInst.loc.old
1. Copy the new one: $ cp $ORACLE_HOME/oraInst.loc /var/opt/oracle/oraInst.loc
2. Run again the $ opatch lsinventory
$ cd $ORACLE_HOME/OPatch
$ opatch lsinventory

Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /p6data/orauser/osm/produt/11.2.0
Central Inventory : /p6data/orauser/oraInventory
   from           : /var/opt/oracle/oraInst.loc

OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0

Log file location : /p6data/orauser/osm/produt/11.2.0/cfgtoollogs/opatch/opatch2013-01-11_10-23-05AM.log

Lsinventory Output file location : /p6data/orauser/osm/produt/11.2.0/cfgtoollogs/opatch/lsinv/lsinventory2013-01-11_10-23-05AM.txt

--------------------------------------------------------------------------------

Installed Top-level Products (1): 
Oracle Database 11g                                                  11.2.0.3.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.
-------------------------------------------------------------------------------
OPatch succeeded.

Inventory lock file is stored in below location: another way to run opatch lsinventory
remove or backup  lock file from oralnventory and run opatch lsinventory
inventory_loc=/u9000/home/oracle/oraInventory
inst_group=oinstall