Monday, December 31, 2018

OutOfMemoryError while WLS Patching | GC overhead limit exceeded

Issue:
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded


Error:
[applvision@test bsu]$ ./bsu.sh -install -patch_download_dir=/backups/appsvision/VISION/fs1/FMW_Home/utils                                            /bsu/cache_dir -patchlist=QMJP -prod_dir=/backups/appsvision/VISION/fs1/FMW_Home/wlserver_10.3
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.Arrays.copyOf(Arrays.java:2367)
        at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
        at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
        at java.lang.StringBuilder.append(StringBuilder.java:132)
        at java.lang.Class.getMethod(Class.java:1678)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.isValueSet(XBeanDataHandler.java:958)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.getValueFromObject(XBeanDataHandler.java:589)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.getSimpleValue(XBeanDataHandler.java:431)
        at com.bea.plateng.patch.dao.cat.PatchDependency.getRule(PatchDependency.java:48)
        at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getInvalidatedPatchMap(PatchCatalogHelper.java:1625)
        at com.bea.plateng.patch.PatchSystem.updatePatchCatalog(PatchSystem.java:436)
        at com.bea.plateng.patch.PatchSystem.refresh(PatchSystem.java:130)
        at com.bea.plateng.patch.PatchSystem.setCacheDir(PatchSystem.java:201)

        at com.bea.plateng.patch.Patch.main(Patch.java:281)


Reason:
The default java memory arguments  provided in bsu.sh file are not sufficient

Solution:
Increase the Java memory values in bsu.sh file (under $MW_HOME/utils/bsu) by adjusting the valuMEM_ARGS values.

By default the values will be
MEM_ARGS="-Xms256m -Xmx512m"

I increased it to 1024-1024 as follows
"-Xms1024m -Xmx1024m"

Save the bsu.sh file and re-execute the patching command.


Saturday, December 29, 2018

Applying WLS Patch and Patch Conflicts

Patch ID: K25M
Patch No: 23743997

(WLS) 10.3.6.0.7
23743997 [SU Patch [K25M]: WLS PSU 10.3.0.6.161018]
    - Filename: p23743997_1036_Generic.zip\

./bsu.sh ‐install ‐patch_download_dir=$FMW_HOME/utils/bsu/cache_dir ‐patchlist=K25M ‐prod_dir=$FMW_HOME/wlserver_10.3

Oracle E-Business Suite Release 12 Critical Patch Update Knowledge Document (October 2016) (Doc ID 2181748.1)

Set your environment:

cd $FMW_HOME

 cd wlserver_10.3/server/bin

.  ./setWLSEnv.sh

Verify the patch applied or not

bsu.sh -prod_dir=$FMW_HOME/wlserver_10.3 -status=applied -verbose -view | grep -i K25M

Unzip the patch to the cache_dir directory:
cd $FMW_HOME/utils/bsu/cache_dir

cp /oracle/software/ p23743997_1036_Generic.zip $FMW_HOME/utils/bsu/cache_dir
unzip p23743997_1036_Generic.zip

Stop all WebLogic servers

Install the patch using the Smart Update command utility:
cd $FMW_HOME/utils/bsu

./bsu.sh install patch_download_dir=$FMW_HOME/utils/bsu/cache_dir patchlist=K25M prod_dir=$FMW_HOME/wlserver_10.3

Patch Conflicts detected


Conflict condition details follow: 

Patch K25M is mutually exclusive and cannot coexist with patch(es): HSZB,Z62H,5C71,7Z9S,DEM4

This means that the new PSU patch is conflicting with the other patches listed above, so I have 3 options here:
1. Forget about the latest PSU patch and leave– not recommended.
2. Request an “overlay” patch from Oracle Support which effectively merges all of the patches if some patches listed above aren’t included
in the new PSU﴿.
3. If the new PSU contains all of the above patches, remove them first, then apply the new PSU.


Capture patches installed

cd $FMW_HOME/utils/bsu

/bsu.sh -prod_dir=$FMW_Home/wlserver_10.3 -status=applied -view -verbose > /tmp/bsu_patches_installed.log


Remove patches
cd $ FMW_Home/utils/bsu

The below patches are Oracle WebLogic Sever overlay patch for PSU 10.3.6.0.160419. We  need to remove these following patches in order to apply the latest PSU.

 HSZB,Z62H,5C71,7Z9S,DEM4

./bsu.sh -prod_dir= $FMW_Home /wlserver_10.3  -patchlist= <Patch ID> -verbose -remove

Now  Install  the patch.

cd $ FMW_Home/utils/bsu

bsu.sh -install -patch_download_dir=$FMW_HOME/utils/bsu/cache_dir  -patchlist=K25M -prod_dir=$WLS_HOME

  
cd  $FMW_HOME/wlserver_10.3/server/bin
.  ./setWLSEnv.sh

 java weblogic.version|grep PSU
WebLogic Server 10.3.6.0.161018 PSU Patch for BUG23743997 TUE AUG 30 18:34:42 IST 2016

That’s it, WebLogic is installed and patched up-to-date.

For more details on WebLogic PSU conflicts, following  are  good MOS notes.

Announcing Oracle WebLogic Server PSUs (Patch Set Updates) [ID 1306505.1]
Replacement Patches for WebLogic Server PSU Conflict Resolution [ID 1471192.1]

Friday, December 21, 2018

Recreating OraInventory(Corrupted/Lost) for already existing Oracle Home

Registering Oracle Home in the Central Inventory:

Symptoms: 
         Exception oracle.sysman.oii.oiil.OiilNativeException: S_OWNER_SYSTEM_EPERM occurred..
          'AttachHome' failed.
           LsInventorySession failed: Oracle Home inventory cannot be loaded.     
           Oracle Home inventory is corrupted.
           OPatch failed with error code 73

Cause:
             ORACLE_HOME is not registered in the Central Inventory.

Solution:
                Take a backup copy of oraInst.loc as oraInst.loc.bak
                Check $cat /etc/oraInst.loc file to know where you want to create OraInventory file.
                Give Read Permissions for all groups to the oraInventory file $chmod 644 oraInventory
                   $cd $ORACLE_HOME/oui/bin    (Go to Oracle Universal Installer)

                    [oravision@test bin]$ ./attachHome.sh
                    Starting Oracle Universal Installer...

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

(OR)

               $./runInstaller -silent -attachHome ORACLE_HOME="/u01/oracle/product/12.1.0" ORACLE_HOME_NAME="Ora12CHome"