Showing posts with label Patch. Show all posts
Showing posts with label Patch. Show all posts

Thursday, March 27, 2014

Steps to Recreate the Oracle Inventory

While deploying the bug patch to one of the staging server, I found the below error like 


No read or write permission to ORACLE_HOME/.patch_storage
   Central Inventory is locked by another OUI instance
   No read permission to Central Inventory
   The lock file exists in ORACLE_HOME/.patch_storage


   The Oracle Home does not exist in Central Inventory


-bash-3.2$ cd /u01/app/oracle/product/11.2.0/db_1/OPatch
-bash-3.2$ ./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       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-03-27_14-05-09PM.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


Soon I come to know that my Oracle Inventory is got corrupted since its unable to read the "inventory.xml" file so it needs to be recreate in order to apply the patch.

Below are the steps to recreate the Oracle Inventory.

cd $ORACLE_HOME/oui/bin/

./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="Oracle_Home_Location" ORACLE_HOME_NAME="Name_Of _Oracle_Home"

-bash-3.2$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_1" ORACLE_HOME_NAME="OraDb11g_home1"
Starting Oracle Universal Installer...

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

-bash-3.2$ cd /u01/app/oraInventory/
-bash-3.2$ ls
ContentsXML  logs
-bash-3.2$ cd ContentsXML/
-bash-3.2$ ls
comps.xml  inventory.xml  libs.xml
-bash-3.2$ more inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>11.2.0.3.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/db_1" TYPE="O" IDX="1"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>


-bash-3.2$ ./opatch apply
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       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-03-27_13-57-18PM.log

Applying interim patch '18483015' to OH '/u01/app/oracle/product/11.2.0/db_1'
Verifying environment and performing prerequisite checks...

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...

Patching component oracle.rdbms, 11.2.0.3.0...
Patch 18483015 successfully applied
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-03-27_03-32-52AM.log

OPatch succeeded.



Reference: 

OTN Doc: Doc ID 556834.1

Tuesday, March 26, 2013

Applying Hot Patch in Oracle Database 11203.

Online Patches for the RDBMS

A regular RDBMS patch is comprised of one or more object (.o) files and/or libraries (.a files). Installing a regular patch requires shutting down the RDBMS instance, re-linking the oracle binary, and restarting the instance; uninstalling a regular patch requires the same steps.

On the other hand, an online patch is a special kind of patch that can be applied to a live, running RDBMS instance. An online patch contains a single shared library; installing an online patch does not require shutting down the instance or relinking the oracle binary. An online patch can be installed/un-installed using Opatch (which uses oradebug commands to install/uninstall the patch).

Online patches are currently only supported for the RDBMS, i.e. the oracle binary.

How does Online Patching differ than traditional patches?


1. Online patches are applied and removed from a running instance where traditional patches require the instances to be shutdown.
2. Online patches utilize the oradebug interface to install and enable the patches where traditional diagnostic patches are linked into the "oracle" binary.
3. Online patches do not require the "oracle" binary to be relinked where traditional diagnostic patches do.
4. There is additional memory consumption and process start time penalty for online patches.

I downloaded and unzipped a patch in "/u01" location.




































Lets set the PATH to the OPatch path so that we can run the OPatch utility from the downloaded dir.




























Now check whether the patch is an Online Patch.






















































Note. There might be "-is_online_patch" not tell you about correct information whether is it Online or not. So sometime it is better to look into "README" text.

Syntax to apply online patch.

opatch apply online -connectString <SID>:<USERNAME>:<PASSWORD>:<NODE>
 





























































































Crosscheck the installed patch into alert log and PMAP.





























Excerpt from PMAP.












In case to Rollback the Online Patch.
























Reference.