Applying OPATCH on single instance database

0
1413

Opatch is a set of perl scripts and java classes which allow the application and rolling back of interim (one-off) patches currently for the Oracle RDBMS product.

In single line you can say,  OPatch is the oracle database’s Interim (one-off) Patch Installer.

Where can I download it from ?

If OPatch is not installed into your Oracle Home ($ORACLE_HOME/OPatch), you may need to download it from Metalink.

Download latest OPatch (Patch 6880880 ) for the Oracle software release.

p6880880_112000_AIX64-5L.zip

Follow README.txt for the OPatch utility installation.

https://updates.oracle.com/Orion/Services/download?type=readme&aru=13116058

cd $ORACLE_HOME

mv -f OPatch OPatch.26042016

unzip p6880880_112000_AIX64-5L.zip

Archive:  p6880880_101000_SOLARIS64.zip
   creating: OPatch/
   creating: OPatch/docs/
  inflating: OPatch/docs/FAQ        
  inflating: OPatch/docs/README.txt 
  inflating: OPatch/docs/Users_Guide.txt 
  inflating: OPatch/docs/bt1.txt    
  inflating: OPatch/docs/bt2.txt    
  inflating: OPatch/docs/tmp        
  inflating: OPatch/emdpatch.pl     
   creating: OPatch/jlib/
  inflating: OPatch/jlib/opatch.jar 
  inflating: OPatch/opatch          
  inflating: OPatch/opatch.bat      
  inflating: OPatch/opatch.pl       
   creating: OPatch/perl_modules/
  inflating: OPatch/perl_modules/Apply.pm 
  inflating: OPatch/perl_modules/AttachHome.pm 
  inflating: OPatch/perl_modules/Command.pm 
  inflating: OPatch/perl_modules/LsInventory.pm 
  inflating: OPatch/perl_modules/Query.pm 
  inflating: OPatch/perl_modules/RollBack.pm 
  inflating: OPatch/perl_modules/Version.pm 
  inflating: OPatch/perl_modules/XML.pm 
  inflating: OPatch/perl_modules/opatchIO.pm 
  inflating: OPatch/README.txt      
   creating: OPatch/ocm/
 extracting: OPatch/ocm/ocm.zip     
   creating: OPatch/ocm/doc/
  inflating: OPatch/ocm/doc/license.txt 
   creating: OPatch/ocm/lib/
  inflating: OPatch/ocm/lib/emocmutl.jar 
   creating: OPatch/ocm/bin/
  inflating: OPatch/ocm/bin/emocmrsp


What is Oracle Database Inventory and where it is located?

Oracle Inventory is the location or the place where all the information about an Oracle Home is stored and maintained. When ever we install an RDBMS Oracle Home, a new inventory gets created. Applying any new patch to Oracle Home will update the inventory for that Oracle Home and record the details for the patch applied. This inventory is in the form of XML files.

The location of inventory is defined in a file called oraInst.loc. The path for this file is provided while installing Oracle Home. If we dont supply any path, the is file will be present at central location /etc/oraInst.loc. Also we can have a central inventory if its not used by any other oracle installation. If the central inventory is used by previous Oracle installation we can create local inventory. The content of oraInst.loc file is as shown below.

cat oraInst.loc
inventory_loc=/*****/oraInventory
inst_group=dba

How to create Local Inventory?

You can create local inventory at any location while installing Oracle Home. You need to use -invPtrLoc variable along with runInstaller command and give the location of oraInst.loc. Otherwise the default path assumed for oraInst.loc is /etc/oraInst.loc.


./runInstaller -silent -attachHome ORACLE_HOME=/hazinetest/oracle/11203 ORACLE_HOME_NAME=”11203″

After the installation starts it will ask for location of oraInventory directory and group which should own it. It will make entry of these into oraInst.loc file.

How to Applying the OPATCH?

Check the opatch version

-opatch version
OPatch Version: 11.2.0.3.12

OPatch succeeded.

Check the command opatch lsinventory command is working properly.

emre@emre:/*****/oracle/11203 > opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /****/oracle/11203
Central Inventory : /*****/oraInventory
from : /******/oracle/11203/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.3.0
Log file location : /*****/oracle/11203/cfgtoollogs/opatch/opatch2016-04-27_09-55-14AM_1.log

Lsinventory Output file location : /******/oracle/11203/cfgtoollogs/opatch/lsinv/lsinventory2016-04-27_09-55-14AM.txt

There are no Interim patches installed in this Oracle Home.

shut down the database.

sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 13 00:30:17 2011

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

stop the listener.

lsnrctl stop

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.5.0 - Production on 13-SEP-2011 00:30:04

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bcfprddb)(PORT=1521)))
The command completed successfully

Stop the DBCONSOLE

emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.5.0  
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
http://******:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...

Stop isqlplus

isqlplusctl stop
iSQL*Plus 10.2.0.5.0
Copyright (c) 2003, 2010, Oracle.  All Rights Reserved.
iSQL*Plus instance on port 5560 is not running ...

Crosscheck the database & listener is not running.

lsnrctl status
 LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production on 13-SEP-2011 00:34:31
 Copyright (c) 1991, 2010, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bcfprddb)(PORT=1521)))
  TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
  IBM/AIX RISC System/6000 Error: 79: Connection refused
ps -ef|grep pmon_

Unzip the downloaded opatch,

make a copy of the OPatch folder, copy the etc & files folders of the patch to $ORACLE_HOME/OPatch directory,

Run the command opatch apply command from $ORACLE_HOME/OPatch location

emre@emre:/mnt/database/11g/psu/patch_11.2.0.3.15/interim_rollbacked_patches/13443029 > opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /*****/oracle/11203
Central Inventory : /******/oraInventory
from : /******/oracle/11203/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.3.0
Log file location : /******/oracle/11203/cfgtoollogs/opatch/13443029_Apr_26_2016_17_10_22/apply2016-04-26_17-10-22PM_1.log

Verifying environment and performing prerequisite checks…
OPatch continues with these patches: 13443029

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = ‘/******/oracle/11203’)
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files…
Applying interim patch ‘13443029’ to OH ‘/*******/oracle/11203’

Patching component oracle.rdbms, 11.2.0.3.0…

OPatch found the word “warning” in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-415 WARNING: Symbol ldxdts is already exported.
ld: 0711-415 WARNING: Symbol ldxsto is already exported.
ld: 0711-415 WARNING: Symbol lnxadd is already exported.
ld: 0711-415 WARNING: Symbol lnxcopy is already exported.
ld: 0711-415 WARNING: Symbol lnxmin is already exported.
ld: 0711-415 WARNING: Symbol lnxmul is already exported.
ld: 0711-415 WARNING: Symbol lnxnur is already exported.
ld: 0711-415 WARNING: Symbol lnxren is already exported.
ld: 0711-415 WARNING: Symbol lnxsca is already exported.
ld: 0711-415 WARNING: Symbol lnxshift is already exported.
ld: 0711-415 WARNING: Symbol lnxsni is already exported.
ld: 0711-415 WARNING: Symbol lxgu2t is already exported.
ld: 0711-415 WARNING: Symbol sldxgd is already exported.
ld: 0711-224 WARNING: Duplicate symbol: fc_softc
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-773 WARNING: Object /********/oracle/11203/lib//liboraolap11.a[sxstime.o], imported symbol timezone
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /******/oracle/11203/lib//libgeneric11.a[sdbgrfu.o], imported symbol timezone
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /*******/oracle/11203/lib//libordsdo11.a[mdowd.o], imported symbol ksudbrmseccnt_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /*******/oracle/11203/lib//libordsdo11.a[mdrt.o], imported symbol ksudbrmseccnt_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /*******/oracle/11203/lib//libordsdo11.a[mdidx.o], imported symbol ksudbrmseccnt_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /*******/oracle/11203/lib//libordsdo11.a[mdrcr.o], imported symbol kcbstdbz_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /******/oracle/11203/lib//libordsdo11.a[mdrt.o], imported symbol kcbstdbz_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /******/oracle/11203/lib//libordsdo11.a[mdrcnc.o], imported symbol mdrcnccmt_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
ld: 0711-783 WARNING: TOC overflow. TOC size: 227728 Maximum size: 65536
Extra instructions are being generated for each reference to a TOC
symbol if the symbol is in the TOC overflow area.
Patch 13443029 successfully applied.
OPatch Session completed with warnings.
Log file location: /*******/oracle/11203/cfgtoollogs/opatch/13443029_Apr_26_2016_17_10_22/apply2016-04-26_17-10-22PM_1.log

OPatch completed with warnings.

Opatch is successfully applied, Start the listener & the database.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.