oracledba.help

DATABASE Patch Set Update (PSU) 12.1

<- Install

TOC

Overview

The following instructions cover applying Patch Set Updates (PSU) to Oracle DATABASE only systems. Always read the patch notes. This is just a cheat sheet version for an environment that only contains the Oracle database product. Change the gray examples to match your environment.

Patch 27547329 - Database Patch Set Update 12.1.0.2.180717 is used in these examples (AKA July Patch 2018).

You must load modified SQL files into the database for any new databases, i.e. run datapatch.

Prerequisites

  • Download and install the latest OPatch.
  • Validate Oracle home for the oracle user.
    $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
  • Download the latest PSU:
    1. Go to MOS DB Proactive Patching Doc ID: 756671.1
    2. From 756671.1, search on: 4.3 Database 12.1.0.2
    3. Select latest PSU entry: Database PSU 12.1.0.2.nnn
    4. Select Patch that matches your OS: Linux x86-64
    5. Select Download then corresponding patch: pnnn_121020_Linux-x86-64.zip
  • As oracle user copy patch .zip file to your patches dir on each node.
    Example: cp /media/sf_sw/Oracle/patches/Combo_OJVM-DB_PSU/p27547329_121020_Linux-x86-64.zip /u01/orasw/patches/
  • Run My Oracle Support's Conflict Checker tool to detect and resolve any conflicts.
    If you have never used this go here.
  • Unzip the file.
su - oracle
cd /u01/orasw/patches
unzip p<PatchFileName>.zip
A sub directory with the matching patch number will be created.

Ensure you have at least 25gb free on the volume your Oracle home is on.

opatch & datapatch Session

 su - oracle

 -- Validate Patch Path
 cd /u01/orasw/patches/27547329
 ls -l
 drwxrwxr-x 4 oracle oinstall    30 Mar 16 05:06 19769480
 drwxrwxr-x 4 oracle oinstall    30 Mar 16 05:06 20299023
 drwxrwxr-x 4 oracle oinstall    30 Mar 16 05:06 20831110
 ...

 -- Stop Database(s) and Listener
 oracle> lsnrctl stop
 oracle> sqlplus / as sysdba
 SQLPLUS> shutdown immediate
 SQLPLUS> exit

 -- Execute opatch
 export PATH=$PATH:/usr/ccs/bin
 export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1
 export PATH=$PATH:$ORACLE_HOME/OPatch
 cd $ORACLE_HOME/OPatch
 ./opatch apply /u01/orasw/patches/27547329

    Is the local system ready for patching? [y|n]: y
    Process runs...

    Upon completion status will be displayed on screen.

 -- Conflict Patches
 If any Patch Conflict Detection and Resolution patches where identified apply them now.

 -- Start Database(s) and Listener
 oracle> sqlplus / as sysdba
 SQLPLUS> startup
          startup mount <- For a Data Guard Standby
 SQLPLUS> exit
 oracle> lsnrctl start

 -- Run datapatch
 export ORACLE_SID=oradb
 cd $ORACLE_HOME/OPatch
 ./datapatch -verbose

Run datapatch for each database running on the same Oracle home being patched. Set the ORACLE_SID for each.

Post Patch Actions

  • Ensure Oracle Inventory oracle home shows applied patches.
    Show All Patches: $ORACLE_HOME/OPatch/opatch lsinventory|more
    Show One: $ORACLE_HOME/OPatch/opatch lsinventory|grep <PatchNumber>
  • Ensure the STATUS for the APPLY ACTION is SUCCESS.
 COL PATCH_ID    FORMAT 999999999
 COL PATCH_UID   FORMAT 999999999
 COL VERSION     FORMAT a10
 COL ACTION      FORMAT a10
 COL STATUS      FORMAT a10
 COL ACTION_TIME FORMAT a30
 COL DESCRIPTION FORMAT a45
 SELECT PATCH_ID,PATCH_UID,VERSION,ACTION,STATUS,ACTION_TIME,DESCRIPTION
 FROM dba_registry_sqlpatch;

  PATCH_ID   PATCH_UID  VERSION    ACTION     STATUS     ACTION_TIME		           DESCRIPTION 
  ---------- ---------- ---------- ---------- ---------- ------------------------------ --------------------------------------------- 
  27547329   22280349   12.1.0.2   APPLY      SUCCESS    12-SEP-18 08.30.21.915652 AM    DATABASE PATCH SET UPDATE 12.1.0.2.180717 

APPENDIX

Locking and Unlocking Example

Lock

As root:

 export GRID_HOME=/u01/app/12.1.0.2/grid
 export PATH=$GRID_HOME/bin:$PATH
 cd /u01/app/12.2.0.1/grid/crs/install
 ./rootcrs.sh -unlock

 <<Apply Patches>>

Unlock

As root console used to lock:

 cd /u01/app/12.1.0.2/grid/crs/install
 ./rootcrs.sh -postpatch

Common Errors

opatch apply Error

Jun 5, 2018 7:10:10 AM] [INFO] The following warnings have occurred during OPatch execution:
[Jun 5, 2018 7:10:10 AM] [INFO]
1) OUI-67215: OPatch found the word "error" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
chmod: changing permissions of ‘/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjobO’: 
Operation not permitted
make: [iextjob] Error 1 (ignored)

Solution

  1. Rollback patch.
  2. Reapply patch.

Example

 ./opatch rollback -id 27547329
 ./opatch apply /u01/orasw/patches/27547329

opatchauto Error

Opatchauto must run from Grid Home with current arguments. 
Please retry it inside Grid Home
opatchauto returns with error code = 2

Solution
You cannot use opatchauto apply on this patch. Reattempt just using opatch apply.

Example

 ./opatch apply /u01/orasw/patches/27338041

datapatch Error

Connecting to database...Database connect failed with:
ORA-24327: need explicit attach before authenticating a user (DBD ERROR: OCISessionBegin)

Please refer to MOS Note 1609718.1 and/or the invocation log
/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_4265_2018_09_12_07_14_41/sqlpatch_invocation.log
for information on how to resolve the above errors.

Solution
Set the ORACLE_SID variable on which you want to run the datapatch.

ORACLE_SID=oradb; export ORACLE_SID

Notes

  • Datapatch loads modified SQL files into the Database.
  • Run the datapatch for each separate database running on the same shared Oracle home being patched.
  • This processes adds an entry to dba_registry_sqlpatch view reflecting the patch application.