You are on page 1of 3

PATCHING AND

UPGRADING
Patching and upgrading:
Patches are two types.
1. Standalone patch (means one of the patch)
2. Patch set(combination of patches)
In ordered to apply patches we need to download patches from Meta link
site.

Unzip the patch set:


$unzip ******.zip
$cd folder name
$vi README.txt
$opatch apply #most of the time we dont need to shutdown the database.

To know the oracle inventory:


$cd /etc
$ls oraInst.loc
$cat oraInst.loc
On one physical server we have
9.2.0.1
10.2.0.1
9.2.0.4
10.2.0.4
Oracle will maintain the oraInst.loc file on each ORACLE_HOME.
$cd $ORACLE_HOME
$ls oraInst.loc
$cd OPatch
$ls
$ps ef |grep pmon
$sqlplus / as sysdba
Sql> shutdown immediate;
$cd patch location
$which opatch
$export PATH=$ORACLE_HOME/OPatch:$PATH
$which opatch
$pwd
$opatch
$opatch apply
If oraInst.loc is not in default location we need to provide a path to it when
we are applying patch.
#mv /etc/oraInst.loc /etc/oraInst.loc.bkp
$opatch apply help
$opatch lsinventory
If we move oracle home location oraInst.loc file then we will get error.
$mv $ORACLE_HOME/oraInst.loc $ORACLE_HOME/oraInst.loc.bkp
$optach lsinventory
Rename file as oraInst.loc
$mv $ORACLE_HOME/oraInst.loc.bkp $ORACLE_HOME/oraInst.loc
$opatch apply
$opatch lsinventory
$sqlplus / as sysdba
Sql> startup
Upgrading from 10.2.0.1 to 10.2.0.4:
Download the patch:
Copy the patch to Oracle server.
Sql>select * from v$version;
Make sure all the processes and instance is down when we are applying the
patch.

Before applying the patch we have to backup the oracle software and oracle
database.
$unzip *****.zip
$cd *****
$./runInstaller
It will just upgrade the oracle binaries from 10.2.0.1 to 10.2.0.4
$sqlplus / as sysdba
Sql>select * from v$version;
10.2.0.1
Sql>startup upgrade;
Sql>@$ORACLE_HOME/rdbms/admin/catupgrd.sql
Sql>shutdown immediate;
Sql>startup
Sql>select * from v$version;
10.2.0.4
Sql>select object_name,count(*) from dba_objects where status=INVALID
group by object_name;
Sql>@?/rdbms/admin/utlrp.sql