Oracle Patches And Upgradation.
What are the types of patch in oracle?
There are different kinds of oracle patches.
CPU - Critical Patch Update
Interim patches
Generic patches.
PSU - Patch Set Update
How will you apply a patch ?
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_19-59-25PM. log
ApplySession applying interim patch '9267897' to OH '/u01/product/10.2.0/db_1'
Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :
/u01/product/10.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecu tables" failed.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 74
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc /u01/app/oraInventory/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oraInventory/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_19-59-48PM. log
ApplySession applying interim patch '9267897' to OH '/u01/product/10.2.0/db_1'
Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :
/u01/product/10.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecu tables" failed.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 74
solution:
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oraInventory/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_19-58-06PM. log
Failed to load the patch object. Possible causes are:
The specified path is not an interim Patch shiphome
Meta-data files are missing from the patch area
Patch location = /tmp
Details = PatchObject constructor: Input file "/tmp/etc/config/actions" or "/tmp/etc/confi g/inventory" does not exist.
ApplySession failed: PatchObject constructor: Input file "/tmp/etc/config/actions" or "/tmp/ etc/config/inventory" does not exist.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 73
[oracle@oracleserver tmp]$ cd /u01
[oracle@oracleserver u01]$ du -a|grep -i oraInst
4 ./app/oraInventory/oraInstaller.properties
4 ./app/oraInventory/orainstRoot.sh
4 ./app/oraInventory/oraInst.loc
0 ./app/oraInventory/logs/oraInstall2012-07-11_07-55-22PM.err
0 ./app/oraInventory/logs/oraInstall2012-07-11_06-18-32PM.err
0 ./app/oraInventory/logs/oraInstall2012-07-11_06-18-32PM.out
4 ./app/oraInventory/logs/oraInstall2012-07-11_07-55-22PM.out
44 ./product/10.2.0/db_1/oui/lib/linux/liboraInstaller.so
4 ./product/10.2.0/db_1/oui/oraInst.loc
8 ./product/10.2.0/db_1/oui/jlib/OraInstallerNet.jar
3764 ./product/10.2.0/db_1/oui/jlib/OraInstaller.jar
0 ./product/10.2.0/db_1/cfgtoollogs/oui/oraInstall2012-07-11_06-18-32PM.err
0 ./product/10.2.0/db_1/cfgtoollogs/oui/oraInstall2012-07-10_08-28-23PM.err
0 ./product/10.2.0/db_1/cfgtoollogs/oui/oraInstall2012-07-11_06-18-32PM.out
12 ./product/10.2.0/db_1/cfgtoollogs/oui/oraInstall2012-07-10_08-28-23PM.out
4 ./product/10.2.0/db_1/oraInst.loc
[oracle@oracleserver u01]$ opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_19-59-15PM. log
Failed to load the patch object. Possible causes are:
The specified path is not an interim Patch shiphome
Meta-data files are missing from the patch area
Patch location = /u01
Details = PatchObject constructor: Input file "/u01/etc/config/actions" or "/u01/etc/confi g/inventory" does not exist.
ApplySession failed: PatchObject constructor: Input file "/u01/etc/config/actions" or "/u01/ etc/config/inventory" does not exist.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 73
[oracle@oracleserver u01]$ cd /tmp/9267897/
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_19-59-25PM. log
ApplySession applying interim patch '9267897' to OH '/u01/product/10.2.0/db_1'
Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :
/u01/product/10.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecu tables" failed.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 74
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc /u01/app/oraInventory/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oraInventory/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_19-59-48PM. log
ApplySession applying interim patch '9267897' to OH '/u01/product/10.2.0/db_1'
Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :
/u01/product/10.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecu tables" failed.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 74
[oracle@oracleserver 9267897]$ opatch -help
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Usage: opatch [ -help ] [ -r[eport] ] [ command ]
command := apply
lsinventory
napply
nrollback
rollback
query
version
prereq
util
<global_arguments> := -help Displays the help message for the command.
-report Print the actions without executing.
example:
'opatch -help'
'opatch apply -help'
'opatch lsinventory -help'
'opatch napply -help'
'opatch nrollback -help'
'opatch rollback -help'
'opatch prereq -help'
'opatch util -help'
OPatch succeeded.
[oracle@oracleserver 9267897]$ opatch prereq -help
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
DESCRIPTION
This operation runs the prerequisite checks on an ORACLE_HOME.
SYNTAX
opatch prereq <command> [-invPtrLoc <Path to oraInst.loc> ]
[-jdk <LOC> ] [-jre <LOC> ]
[-oh <ORACLE_HOME> ]
[-property_file <Path to property file>]
[-local_node <Local node name>]
[-remote_nodes <List of remote nodes (node1,node2)>]
[-ph <Path to the single patch location>]
[-phBaseDir <Path to the dir containing all patches>]
[-phBaseFile <Path to the file containing the
location of the patches to be applied>]
[-id <Comma separated list of patch IDs>]
COMMANDS
CheckOracleHome
Check if the given ORACLE_HOME is valid. Check if it
has the inventory files with proper permissions.
CheckOraInstLocation
Check if the oraInst.loc file is proper and has the
read permissions.
CheckCentralInventoryLocation
Validate the Central Inventory location. Check if it
has the correct directory structure and has the
inventory.xml with read permissions.
CheckCentralInventoryForOH
Check if the given ORACLE_HOME is registered
in the central inventory specified by the
oraInst.loc file.
CheckCentralInventoryForRWSession
Check if a RW (read-write) session can be created
for the given central inventory.
CheckJDK
Check if the given ORACLE_HOME has jdk in it.
CheckOUILocation
Check the ORACLE_HOME for the presence of OUI.
CheckOUIVersionCompatible
Check if the OUI in the ORACLE_HOME is compatible
for the OPatch.
CheckRequiredLibs
Check if all the required OUI libraries are present
in the given ORACLE_HOME.
CheckUserAdminPrivilege
Check is the user is 'root'.
Note: OPatch should not be invoked by 'root', if so
then this check fails.
CheckIfOHLockedForPatching
Check if the ORACLE_HOME is locked for patching
by any previous unsuccessful OPatch Session.
CheckInstalledOneOffs
Check if all the patches provided by the user to rollback
are present in the given Oracle Home.
CheckSystemCommandAvailable
Check if all the commands required for applying or
rolling back the given patch are present in the system.
CheckActiveFilesAndExecutables
Check if there are any file(s) that are active,
which are touched by the patch to be applied
or rolled back.
CheckActiveServices
Check for the services that are active.
Note: Applicable for Windows platforms only.
CheckPatchShipHome
Check if the given patch to be applied has the
proper structure and has the correct permissions
for all the files.
CheckSystemSpace
Check if enough system space is available for
the patch(es) to be applied.
CheckPatchApplicableOnCurrentPlatform
Check if the given patch(es) is applicable on the
current platform.
CheckApplicable
Check for the presence of the required components in
the ORACLE_HOME and check if all the actions of the
given patch(es) are applicable.
CheckRollbackable
Check if the given patch(es) can be rollbacked from
the ORACLE_HOME.
CheckConflictAmongPatches
Check if there are any conflicts among the patches
to be applied.
CheckConflictAmongPatchesWithDetail
Check if there are any conflicts among the patches
to be applied, by giving out the detailed information
about the conflicts/supersets.
CheckConflictAgainstOH
Check if there are any conflicts between the patches
to be applied and the patches in the OH.
CheckConflictAgainstOHWithDetail
Check if there are any conflicts between the patches
to be applied and the patches in the OH, by giving
out the detailed information about the
conflicts/supersets.
CheckRACNodeList
Check if all the nodes in the RAC setup are valid, up
and reachable.
CheckRemoteCommandInvocable
Check if commands can be invoked on the remote machines.
CheckRemoteCopyAndRemove
Check if files can be copied to and removed from the
remote machines.
CheckForCRSHomeIfRAC
Check if the given Central Inventory has a CRS Home
registered with it, if it is a RAC setup.
OPTIONS
-invPtrLoc
Used to locate the oraInst.loc file. Needed when the
installation used the -invPtrLoc flag. This should be
the path to the oraInst.loc file.
-jdk
This option tells OPatch to use JDK (jar) from the
specified location instead of the default location
under Oracle Home. If -jre option is not specified,
java virtual machine is executed from -jdk location.
-jre
This option tells OPatch to use JRE (java) from the
specified location instead of the default location
under Oracle Home. Both -jdk and -jre options cannot
be specified together. OPatch will display error in
that case.
-oh
The oracle home to work on. This takes precedence over
the environment variable ORACLE_HOME.
-property_file
The user defined property file for OPatch to use. The
path to the property file should be absolute. This
property file takes precedence over the one that is
supplied with OPatch.
-local_node
This option can be used to specify to OPatch the local
node name to be used for RAC mode application of the patch.
-remote_nodes
This option can be used to specify to OPatch the list
of remote nodes to be used for RAC mode application of
the patch. The node names are comma separated and
without spaces.
-ph
This option can be used to specify the path to the
patch location. Ex: /tmp/101010
-phBaseDir
This option can be used to specify the path to base dir
where all the patches to be applied are kept.
-phBaseFile
This option can be used to specify complete path to the
file containing the location of the patches to be applied.
-id
This option can be used to specify the patch IDs of all
the patches that are to be rollbacked from the given OH.
OPatch succeeded.
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_20-01-20PM. log
ApplySession applying interim patch '9267897' to OH '/u01/product/10.2.0/db_1'
Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :
/u01/product/10.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecu tables" failed.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 74
[oracle@oracleserver 9267897]$ ps -ef|grep pmon
oracle 5354 1 0 18:42 ? 00:00:00 ora_pmon_rachel
oracle 8216 7181 0 20:04 pts/1 00:00:00 grep pmon
[oracle@oracleserver 9267897]$ export ORACLE_SID=rachel
[oracle@oracleserver 9267897]$ sqlplus
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jul 11 20:04:16 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Enter user-name: / as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Productio n
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/product/10.2.0/db_1/oui
Log file location : /u01/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-07-11_20-04-34PM. log
ApplySession applying interim patch '9267897' to OH '/u01/product/10.2.0/db_1'
Running prerequisite checks...
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system o nly.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/product/10.2.0/db_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9267897' for restore. This might take a while...
Backing up files affected by the patch '9267897' for rollback. This might take a while...
Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kkxs.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kza.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzvdve.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kkt.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ koka.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzp.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzu.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzvdve.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzvdvre.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzvutil.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ kzl.o"
Updating archive file "/u01/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ klc.o"
Copying file to "/u01/product/10.2.0/db_1/rdbms/admin/catmacd.sql"
Copying file to "/u01/product/10.2.0/db_1/rdbms/admin/catmacp.sql"
Copying file to "/u01/product/10.2.0/db_1/rdbms/admin/prvtmacp.plb"
Copying file to "/u01/product/10.2.0/db_1/rdbms/admin/rule_set.dlf"
Running make for target ioracle
ApplySession adding interim patch '9267897' to inventory
Verifying the update...
Inventory check OK: Patch ID 9267897 is registered in Oracle Home inventory with proper meta -data.
Files check OK: Files from Patch ID 9267897 are present in Oracle Home.
The local system has been patched and can be restarted.
OPatch succeeded.
[oracle@oracleserver 9267897]$ opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
[oracle@oracleserver 9267897]$
Comments
Post a Comment