Tag Archives: OPatch

How to debug Oracle opatch utility

The following procedure shows how to debug the Oracle opatch utility when you receive an error.

1. Execution of opatch utility results in the following error.

[oracle@mylinux1 OPatch]$ opatch lsinventory
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.1.0.6.6
OUI version : 11.2.0.1.0
OUI location : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2011-04-02_19-17-51PM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Inventory load failed… OPatch cannot load inventory for the given Oracle Home.
LsInventorySession failed: Unable to create patchObject

OPatch failed with error code 73
[oracle@mylinux1 OPatch]$

2. Set the environmental variable OPATCH_DEBUG equal to true.

[oracle@mylinux1 OPatch]$ export OPATCH_DEBUG=true
[oracle@mylinux1 OPatch]$

3. Re-execute your opatch utility and every action performed by opatch will be displayed in your buffer. Use the messages to determine the error.

This completes use of debug with the opatch utility.

Larry J. Catt, OCP
oracle@allcompute.com
www.allcompute.com

OPatch Oracle database still running: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received when you attempt to apply an Oracle patch to a currently executing Oracle database.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch apply

conflicts against Oracle Home…
OPatch continues with these patches: 7155248 7155249 7155250 7155251
7155252 7155253 7155254 7197583 7375611 7375613 7375617 7609057 7609058
8309592 8309632 8309642 8568395 8568397 8568398 8568402 8568404 8568405
8836667 8836671 8836675 8836677 8836678 8836681 8836683 8836684 8836686
9119226 9173244 9173248 9173253

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

Running prerequisite checks…
Prerequisite check “CheckActiveFilesAndExecutables” failed.
The details are:

Following executables are active :
/u01/prism/oracle/product/10.2.0/db_1/bin/oracle
UtilSession failed: Prerequisite check “CheckActiveFilesAndExecutables” failed.

OPatch failed with error code 73
mylinux :>

4. As seen above the OPatch utility errored out with code 73 and references the Prerequisite check “CheckActiveFilesAndExecutables”. This error normally occurs when the Oracle database is still up and running, so we check it below with the command ps:

mylinux :> ps -ef|grep smon
cimsora 26981 1 0 02:12 ? 00:00:00 ora_smon_prism
cimsora 4326 11581 0 02:34 pts/1 00:00:00 grep smon

5. As seen above the database is in fact up, so logon as sysdba and shut it down.

mylinux :> sqlplus ‘/ as sysdba’

SQL*Plus: Release 10.2.0.4.0 – Production on Sun Feb 2802:38:36 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

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> exit

6. Once the database is shutdown we can re-execute our OPatch install.

Larry J Catt, OCP9i, 10g
oracle@allcompute.com
www.allcompute.com

Wrong OPatch utility for CPU being applied: Code 14

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received when you use OPatch options that are not supported by your currently installed OPatch utility.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error or similar error during installation.

ORCL :> OPatch napply -skip_subset -skip_duplicate
Invoking OPatch 10.2.0.3.0

Oracle interim Patch Installer version 10.2.0.3.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..

Syntax Error… Unrecognized Command or Option: failed to parse arguments
“unknown option ‘-skip_subset'”
Please use the option ‘OPatch -help’ to get correct syntax

OPatch failed with error code 14
ORCL :>

5. This error is being generated because OPatch 10.2.0.3.0 did not support the napply option or its tags. The solution is to download the latest Oracle Patch 6880880, containing the OPatch utility, and unzip it in your ORACLE_HOME directory.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch picks up incorrect Home from OraInst.loc: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. OPatch uses the OraInst.loc file located in /etc or /var/opt/oracle depending on your OS to determine what needs to be applied during patch installation. In this article we will cover the error which would be received if your OraInst.loc file points at the incorrect home or contains invalid information.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error or similar error during installation.

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /app/oracle/product/10.2.0
Central Inventory : /app/agent10g
from : /var/opt/oracle/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.4.0
OUI location : /app/oracle/product/10.2.0/oui
Log file location : /app/oracle/product/10.2.0/cfgtoollogs/OPatch/OPatch2010
-02-20_14-48-27PM.log

Patch history file:
/app/oracle/product/10.2.0/cfgtoollogs/OPatch/OPatch_history.txt

List of Homes on this system:

Home name= agent10g, Location= “/app/agent10g”
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

5. As seen by the error message, the OPatch utility is picking up the incorrect inventory location from the file OraInst.loc. Open up the OraInst.loc file, correct the location of your inventory directory, and re-execute OPatch.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch apply lib .so file not writable: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received if the file permissions in your Oracle Home are not correctly set and a work-around to continue your patch installation.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error or similar error during installation.

Running prerequisite checks…
Prerequisite check “CheckApplicable” failed.
The details are:

Patch 8568398:
Copy Action: Desctination File “/app/oracle/product/10.2.0/lib/libjox10.so”
is not writeable.
‘oracle.rdbms, 10.2.0.4.0’: Cannot copy file from ‘libjox10.so’ to
‘/app/oracle/product/10.2.0/lib/libjox10.so’

UtilSession failed: Prerequisite check “CheckApplicable” failed.

OPatch failed with error code 73
$

5. The OPatch utility was unable to update one of the lib files for installation, due to a file permission error. To resolve this issue, change directories to your ORACLE_HOME/lib directory.

$ cd /app/oracle/product/10.2.0/lib/

6. Check the existence of the lib file in question with the command ls.

$ ls libjox10.so
-r-xr-xr-x 1 fpdfqt dba 20041728 Jan 07 2009 libjox10.so

7. Make a backup copy of this lib file with the command cp.

$ cp libjox10.so libjox10.so_bak

8. Change permission on the lib file in question.

$ chmod 777 libjox10.so
$

8. Attempt re-installation of your Oracle patch with the OPatch utility.

OPatch napply -skip_subset -skip_duplicate

Return Code = 0

The local system has been patched and can be restarted.

UtilSession: N-Apply done.

OPatch succeeded.
$

As seen above the patch set is successfully installed.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch using 64 bit linux CPU on a 32 bit linux Oracle home: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. When installing any oracle patch set it is important to know the bit count of your current Oracle binaries. In this article we will cover the error which would be received when you attempt to install a 64 bit patch on a 32 bit Oracle home

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You are under the assumption that you have a 64 bit Oracle home which is platform ID 226. However, you’re true Oracle home is 32 bit or platform ID 46. The following error message is the result.

OPatch2010-03-02_02-29-19AM.log:Platform IDs supported by patch are: 226 Patch (
8836667 ) is not applicable on current platform.
OPatch2010-03-02_02-29-19AM.log:Platform IDs supported by patch are: 226 Patch (
8836684 ) is not applicable on current platform.
ISM :> vi OPatch2010-03-02_02-29-19AM.log
Platform ID needed is : 46
Platform IDs supported by patch are: 226 Patch ( 9173253 ) is not applicable on
current platform.
Platform ID needed is : 46
Platform IDs supported by patch are: 226
SEVERE:OUI-67073:UtilSession failed: Prerequisite check
“CheckPatchApplicableOnCurrentPlatform” failed.
INFO:Finishing UtilSession at Sun Feb 28 02:33:02 EDT 2010
INFO:Stack Description: java.lang.RuntimeException: Prerequisite check
“CheckPatchApplicableOnCurrentPlatform” failed.
INFO:StackTrace: oracle.OPatch.OPatchSessionHelper.runApplyPrereqs(OPatchSession
Helper.java:4173)
INFO:StackTrace: oracle.OPatch.OPatchutil.NApply.process(NApply.java:2057)
INFO:StackTrace: oracle.OPatch.OPatchutil.OUSession.napply(OUSession.java:868)
INFO:StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO:StackTrace:
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO:StackTrace: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMetho
dAccessorImpl.java:25)
INFO:StackTrace: java.lang.reflect.Method.invoke(Method.java:324)
INFO:StackTrace: oracle.OPatch.UtilSession.process(UtilSession.java:313)
INFO:StackTrace: oracle.OPatch.OPatchSession.main(OPatchSession.java:1993)
INFO:StackTrace: oracle.OPatch.OPatch.main(OPatch.java:630)

5. The solution is to logon to www.metalink.oracle.com and download the correct bit version for your platform.

Larry Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch platform id 46-linux not 59-hpux: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. Oracle Corporation uses a numbering system for its patch sets which do not change across differing OS layers. Though the patch number would be the same for differing operating systems, the actual binary files are specific. In this article we will cover the error which would be received when you attempt to apply a CPU for HPUX on a LINUX OS.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error.

Platform ID needed is : 46
Platform IDs supported by patch are: 59 Patch ( 9173253 ) is not applicable on
current platform.
Platform ID needed is : 46
Platform IDs supported by patch are: 59
UtilSession failed: Prerequisite check “CheckPatchApplicableOnCurrentPlatform”
failed.

OPatch failed with error code 73

5. The error produced specifies the current platform ID is 46 – LINUX, however you are attempting to apply a CPU for platform ID of 59 –HPUX.

6. The resolution is to download the correct patch from www.metalink.oracle.com for your specific OS.

Larry Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch utility error due to incorrect option: Code 14

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received if you pass an unknown variable to the OPatch utility. This error message will appear regardless of OS you are trying to apply.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. Execute OPatch napply with the wrong tag –skip_subnet instead of –skip_subset.

mylinux:> OPatch napply -skip_subnet -skip_duplicate
Invoking OPatch 11.2.0.1.2

Oracle Interim Patch Installer version 11.2.0.1.2
Copyright (c) 2010, Oracle Corporation. All rights reserved.

Syntax Error… Unrecognized Command or Option: failed to parse arguments
“unknown option ‘-skip_subnet'”
Please use the option ‘OPatch -help’ to get correct syntax

OPatch failed with error code 14
mylinux:>

5. Above the OPatch utility errors out with code 14, “UNKOWN OPTION”. Reviewing the tags used, you can see that skip_subset is misspelled. NOTE: This error will occur if a misspelling is present in the tag or you give the utility a tag which does not exist.

6. Re-execute the OPatch utility with correct tags and the utility will complete successfully.

mylinux:> OPatch napply -skip_subset -skip_duplicate
Invoking OPatch 11.2.0.1.2

Oracle Interim Patch Installer version 11.2.0.1.2
Copyright (c) 2010, Oracle Corporation. All rights reserved.

UTIL session

Patch : 9119226

Do you want to proceed? [y|n]

Response = y
OPatch Session completed without warnings.

OPatch completed without warnings.
mylinux:>

This completes the correction of OPatch utility error code 14.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com