Thursday, April 19, 2007

Opatch (utility to apply RDBMS patches)

Opatch Application Steps :

1) Read the patch readme thoroughly and make sure everything is fine. Remember database patches are applied using opatch.

2) Check the invalids and take the object name and count of invalids.
col owner format a15
col object_name format a40
col object_type format a15
select owner,object_type,object_name from dba_objects where status = 'INVALID' order by owner,object_type;

3) Make sure you have the right opatch utility version.
Recent db patches require opatch version is 1.0.0.0.55 or higher

opatch version

Also make sure opatch executable used to apply the patch is in the PATH

export PATH=$PATH:$ORACLE_HOME/OPatch

4) Make sure opatch lsinventory is working for the opatch. If lsinventory is not working then you should not go ahead with opatch. This is the most important step, as most of Opatch issues are related to bad inventory etc.

opatch lsinventory

The possible causes could be inventory is not pointing correctly.(especially in dev and test servers, where you have more than one db sharing the same inventory) then make make sure inventory is pointing to the right path. Inventory location is mentioned in oraInst.loc under db home.
eg /opt/oracle/product/appl/9.2.0/oraInst.loc

ex Oracle Installer Location File

Location#inventory_loc=/opt/oracle/product/9iAS/oraInventory#inventory_loc=/opt/oracle/product/appl/oraInventoryinventory_loc=/opt/oracle/product/appl/oraInventoryinst_group=dba

Note :The OraInventory dir would be in one dir below db home

dir /opt/oracle/product/appl/oraInventory (]$ ls -rlttotal 10drwxr-xr-x 2 oramgr dba 96 Nov 16 2005 ContentsXMLdrwxr-xr-x 2 oramgr dba 1024 Nov 16 2005 Contentsdrwxr-xr-x 2 oramgr dba 3072 Dec 09 20:10 logs-rwxr-xr-x 1 oramgr dba 38 Dec 09 20:10 install.platform/opt/oracle/product/appl/oraInventory (]$<> and make sure the entries in files under ContentsXML has correct db entry.Also note these day's inventory are also known as XML inventory. )

5) Ensure that the $PATH has the following executables:
make, ar, ld, and nm and make sure they are working with the below commands and also
Check whether the java and jar executables are present in your Oracle home.
which make
which ar
which ld
which nm
6) Before applying the opatch, database and db (9i) listener should be down. This is a must.
7) For applying opatch go the database patch directory where the patch is downloaded and unzipped and now give the following command :
opatch apply

8) After opatch is done, confirm the inventory is updated with the current patch.This is a confirmation step.
opatch lsinventory
9) Make sure there are no errors and also verify the log file.log file is located in
eg : /opt/oracle/product/appl/9.2.0/.patch_storage//

10) start the database and db listener and do the post steps like executing catcpu and other steps as mentioned in the patch readme, take the invalids again and compile them.
Note:
syntax for applying opatch on RAC instances is little different.
On each node you might have to apply with the following syntax
opatch apply -local
============================================================
OraInventory in Oracle
======================
What to do if Inventory is corrupted , What is global / Local Inventory

oraInventory :
=============

oraInventory is repository (directory) which store/records oracle software products & their oracle_homes location on a machine. This Inventory now a days in XML format and called as XML Inventory where as in past it used to be in binary format &
called as binary Inventory.
There are basically two kind of Inventory Global Inventory (also called as Central Inventory) and Local Inventory also called as Oracle Home Inventory.

Global Inventory :
=============
Global Inventory holds information about Oracle Products on a Machine. These products can be various oracle components like database, oracle application server, collaboration suite, soa suite, forms & reports or discoverer server . This global Inventory location will be determined by file oraInst.loc in /etc (on Linux/AIX) or /var/opt/oracle (solaris). If you want to see list of oracle products on machine check for file inventory.xml under ContentsXML in oraInventory
(Please note if you have multiple global Inventory on machine check all oraInventory directories)

Local Inventory:
============
Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This Inventory holds information to that oracle_home only.

Can We have multiple Global Inventory on a machine :
=======================================
Can we have multiple global Inventory and the answer is YES you can have multiple global Inventory but if your upgrading or applying patch then make sure you change Inventory Pointer oraInst.loc to respective location. If you are following single global Inventory and if you wish to uninstall any software then remove it from Global Inventory as well.

If Global Inventory is corrupted
=======================
If global Inventory is corrupted, we can recreate global Inventory on machine using Universal Installer and attach already Installed oracle home by option-attachHome

." DIV < cluster_nodes="{}" oracle_home_name="Oracle_Home_Name">
Optach failures are generally due to Inventory problem, above i have provided some info. about the Oracle Inventory (Global/Local).This will help us in understanding & resolving the issues in future.

]$<> and make sure the entries in files under ContentsXML has correct db entry.Also note these day's inventory are also known as XML inventory. )
5) Ensure that the $PATH has the following executables:
make, ar, ld, and nm and make sure they are working with the below commands and also
Check whether the java and jar executables are present in your Oracle home.
which make
which ar
which ld
which nm
6) Before applying the opatch, database and db (9i) listener should be down. This is a must.
7) For applying opatch go the database patch directory where the patch is downloaded and unzipped and now give the following command :
opatch apply

8) After opatch is done, confirm the inventory is updated with the current patch.This is a confirmation step.
opatch lsinventory
9) Make sure there are no errors and also verify the log file.log file is located in
eg : /opt/oracle/product/appl/9.2.0/.patch_storage//

10) start the database and db listener and do the post steps like executing catcpu and other steps as mentioned in the patch readme, take the invalids again and compile them.
Note:
syntax for applying opatch on RAC instances is little different.
On each node you might have to apply with the following syntax
opatch apply -local
============================================================
OraInventory in Oracle
======================
What to do if Inventory is corrupted , What is global / Local Inventory

oraInventory :
=============

oraInventory is repository (directory) which store/records oracle software products & their oracle_homes location on a machine. This Inventory now a days in XML format and called as XML Inventory where as in past it used to be in binary format &
called as binary Inventory.
There are basically two kind of Inventory Global Inventory (also called as Central Inventory) and Local Inventory also called as Oracle Home Inventory.

Global Inventory :
=============
Global Inventory holds information about Oracle Products on a Machine. These products can be various oracle components like database, oracle application server, collaboration suite, soa suite, forms & reports or discoverer server . This global Inventory location will be determined by file oraInst.loc in /etc (on Linux/AIX) or /var/opt/oracle (solaris). If you want to see list of oracle products on machine check for file inventory.xml under ContentsXML in oraInventory
(Please note if you have multiple global Inventory on machine check all oraInventory directories)

Local Inventory:
============
Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This Inventory holds information to that oracle_home only.

Can We have multiple Global Inventory on a machine :
=======================================
Can we have multiple global Inventory and the answer is YES you can have multiple global Inventory but if your upgrading or applying patch then make sure you change Inventory Pointer oraInst.loc to respective location. If you are following single global Inventory and if you wish to uninstall any software then remove it from Global Inventory as well.

If Global Inventory is corrupted
=======================
If global Inventory is corrupted, we can recreate global Inventory on machine using Universal Installer and attach already Installed oracle home by option-attachHome

." DIV < cluster_nodes="{}" oracle_home_name="Oracle_Home_Name">

No comments: