Online Patching


ORACLE_SID=CDB12C
ORACLE_HOME=/opt/oracle/app/product/12.1.0/dbhome_1
PATH=/opt/oracle/app/product/12.1.0/dbhome_1/bin:
/opt/oracle/app/product/12.1.0/dbhome_1/OPatch:
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin
1. Check actual patch state
[bash]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
 from : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/
cfgtoollogs/opatch/opatch2013-07-13_07-14-28AM_1.log
Lsinventory Output file location : /opt/oracle/app/product/
12.1.0/dbhome_1/cfgtoollogs/opatch/lsinv
/lsinventory2013-07-13_07-14-28AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
2. Switch to extracted patch location:
[bash]$ cd /tmp/16527374
3. Patch with online method
Install the patch by running the following command:
For Non-RAC Environments (Standalone Databases)
$ opatch apply online -connectString :::
For RAC Environments
$ opatch apply online -connectString :::,:::,:::
[bash]$ opatch apply online -connectString CDB12C:sys::
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
 from : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/
cfgtoollogs/opatch/16527374_Jul_13_2013_07_15_42/
apply2013-07-13_07-15-41AM_1.log
The patch should be applied/rolled back in '-all_nodes' mode only.
Converting the RAC mode to '-all_nodes' mode.
Applying interim patch '16527374' to OH '/opt/oracle/app/product/12.1.0/dbhome_1'
Verifying environment and performing prerequisite checks...
All checks passed.
Backing up files...
Patching component oracle.rdbms, 12.1.0.1.0...
Installing and enabling the online patch 'bug16527374.pch', on database 'CDB12C'.
Verifying the update...
Patch 16527374 successfully applied
Log file location: /opt/oracle/app/product/12.1.0/dbhome_1/
cfgtoollogs/opatch/16527374_Jul_13_2013_07_15_42/
apply2013-07-13_07-15-41AM_1.log
OPatch succeeded.
4. Verify opatch inventory
[bash]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
 from : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/
cfgtoollogs/opatch/opatch2013-07-13_07-16-18AM_1.log
Lsinventory Output file location : /opt/oracle/app/product/12.1.0/
dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-07-13_07-16-18AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch (online) 16527374: applied on Thu Jul 13 07:15:45 CEST 2013
Unique Patch ID: 16551736
 Created on 12 Jul 2013, 13:23:36 hrs PST8PDT
 Bugs fixed:
 16527374
--------------------------------------------------------------------------------
OPatch succeeded.
5. Verify alertlog of database:
Thu Jul 13 07:15:45 2013
Patch file bug16527374.pch is out of sync with oracle binary; performing fixup
Patch file bug16527374.pch has been synced with oracle binary
Thu Jul 13 07:15:45 2013
Patch bug16527374.pch Installed - Update #1
Thu Jul 13 07:15:45 2013
Patch bug16527374.pch Enabled - Update #2
Thu Jul 13 07:15:48 2013
Online patch bug16527374.pch has been installed
Online patch bug16527374.pch has been enabled
6. If you want to patch multiple instances with the same patch use the following per instance:
[bash]$ opatch util enableonlinepatch -connectString CDB12C2:sys:: -id 16527374
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
 from : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2013-07-13_08-32-14AM_1.log
Invoking utility "enableonlinepatch"
Installing and enabling the online patch 'bug16527374.pch', on database 'CDB12C2'.
OPatch succeeded.
7. Verify enabled patch:
[bash]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Thu Jul 13 08:33:59 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> oradebug patch list
Patch File Name State
================ =========
bug16527374.pch ENABLED
SQL>
Or again in alertlog:
Thu Jul 13 08:32:17 2013
Patch bug16527374.pch Installed - Update #1
Thu Jul 13 08:32:17 2013
Patch bug16527374.pch Enabled - Update #2
Thu Jul 13 08:32:18 2013
Online patch bug16527374.pch has been installed
Online patch bug16527374.pch has been enabled

More informatin: https://gumpx.wordpress.com/tag/opatch-apply-online-connectstring/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: