oracledba.help
Install

Patching Oracle RAC Databases

<- Install

TOC

Overview

The following instructions cover applying quarterly CPU patches to an Oracle RAC on a Linux based system. The GIPSU patch contains DBPSU so there is no need to download a separate DBPSU. Change as required for your environment.

Patch 24412235 is used in these examples. OPatch version 12.2.0.1.8.

These instructions cover patching the GI Home and the Database home together where:

  • The GI home is not shared.
  • The database home is not shared.
  • ACFS not used.

If ACFS is used go here.

Prerequisites

  • Backup core directories.
    • cd \u02\backups
    • tar -cvf grid_home.tar /u01/app/12.1.0.2/grid
    • tar -cvf oracle_home.tar /u01/app/oracle/product/12.1.0.2/db_1
    • tar -cvf oraInventory.tar /u01/app/oraInventory
  • Download Patch
su -
mkdir /u01/orasw/patches
Download .zip file to /u01/orasw/patches
chown -R grid:oinstall /u01/orasw/patches

su - grid
cd /u01/orasw/patches
unzip p24412235_121020_Linux-x86-64.zip
chmod 777 /u01/orasw/patches
  • Ensure you have the latest OPatch (see Doc ID 274526.1) on all nodes.
  su -
  chown -R oracle:oinstall /u01/orasw/OPatch/p6880880_122010_Linux-x86-64.zip
  chmod 777 /u01/orasw/OPatch

  su - oracle
  cd /u01/orasw/OPatch
  unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME
      replace /<PatchPath>/datapatch? [y]es, [n]o, [A]ll, [N]one, [r]ename: A

  $ORACLE_HOME/OPatch/opatch lsinventory
     OPatch version    : 12.2.0.1.8

  su -
  chown -R grid:oinstall /u01/orasw/OPatch/p6880880_122010_Linux-x86-64.zip
  chmod 777 /u01/orasw/OPatch

  su - grid
  cd /u01/orasw/OPatch
  unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME
  $ORACLE_HOME/OPatch/opatch lsinventory
     OPatch version    : 12.2.0.1.8
  • Validate Oracle Inventory
su - oracle
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME>/tmp/oraInventory_status.txt 
If this command succeeds, it lists the Oracle components that are installed in the home. If this command fails, contact Oracle Support Services for assistance.
  • Stop Enterprise Manager Agent (if used).
    Run on each node as the oracle user.
    • su - oracle
    • cd /u01/app/oracle/agent/agent_13.1.0.0.0/bin
    • ./emctl status agent
    • ./emctl stop agent
    • ./emctl status agent

Patch Installation

opatchauto will restart both GI stack on the local node and the databases. Perform these steps as the root user.

  1. Set environment.
    • export GRID_HOME=/u01/app/12.1.0.2/grid
    • export PATH=$GRID_HOME/bin:$PATH
  2. Run opatchauto.
    • cd $GRID_HOME/OPatch
    • ./opatchauto apply /u01/orasw/patches/24412235

Repeat above steps for each node sequentially, i.e. dont run more than one at a time.
Example patch console output.

Post Patch Installation

  1. Remount ACFS file system (if used).
  2. Start Enterprise Manager Agent on each node (if used).
    Run on each node as the oracle user.
    • su - oracle
    • cd /u01/app/oracle/agent/agent_13.1.0.0.0/bin
    • ./emctl start agent
    • ./emctl status agent
  3. Patch Status
    • su - oracle
    • $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME>/tmp/oraInventory_status_post.txt
  4. Check Status of RAC.

APPENDIX

Patch Console Output Example

[root@rac01 Desktop]# export GRID_HOME=/u01/app/12.1.0.2/grid
[root@rac01 Desktop]# export PATH=$GRID_HOME/bin:$PATH
[root@rac01 Desktop]# cd $GRID_HOME/OPatch
[root@rac01 OPatch]# ./opatchauto apply /u01/orasw/patches/24412235

OPatchauto session is initiated at Thu Dec 22 09:21:34 2016

System initialization log file is /u01/app/12.1.0.2/grid/cfgtoollogs/opatchautodb/systemconfig2016-12-22_09-21-37AM.log.

Session log file is /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/opatchauto2016-12-22_09-21-55AM.log
The id for this session is LRPB

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/12.1.0.2/db_1

Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.1.0.2/grid
Patch applicablity verified successfully on home /u01/app/12.1.0.2/grid

Patch applicablity verified successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Verifying patch inventory on home /u01/app/oracle/product/12.1.0.2/db_1

Verifying patch inventory on home /u01/app/12.1.0.2/grid
Patch inventory verified successfully on home /u01/app/oracle/product/12.1.0.2/db_1

Patch inventory verified successfully on home /u01/app/12.1.0.2/grid


Verifying SQL patch applicablity on home /u01/app/oracle/product/12.1.0.2/db_1
SQL patch applicablity verified successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Preparing to bring down database service on home /u01/app/oracle/product/12.1.0.2/db_1
Successfully prepared home /u01/app/oracle/product/12.1.0.2/db_1 to bring down database service


Bringing down CRS service on home /u01/app/12.1.0.2/grid
Prepatch operation log file location: /u01/app/12.1.0.2/grid/cfgtoollogs/crsconfig/crspatch_rac01_2016-12-22_09-28-15AM.log
CRS service brought down successfully on home /u01/app/12.1.0.2/grid


Performing prepatch operation on home /u01/app/oracle/product/12.1.0.2/db_1
Perpatch operation completed successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Start applying binary patch on home /u01/app/oracle/product/12.1.0.2/db_1
Binary patch applied successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Performing postpatch operation on home /u01/app/oracle/product/12.1.0.2/db_1
Postpatch operation completed successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Start applying binary patch on home /u01/app/12.1.0.2/grid
Binary patch applied successfully on home /u01/app/12.1.0.2/grid


Starting CRS service on home /u01/app/12.1.0.2/grid
Postpatch operation log file location: /u01/app/12.1.0.2/grid/cfgtoollogs/crsconfig/crspatch_rac01_2016-12-22_09-58-49AM.log
CRS service started successfully on home /u01/app/12.1.0.2/grid


Preparing home /u01/app/oracle/product/12.1.0.2/db_1 after database service restarted
No step execution required.........
Prepared home /u01/app/oracle/product/12.1.0.2/db_1 successfully after database service restarted


Trying to apply SQL patch on home /u01/app/oracle/product/12.1.0.2/db_1
SQL patch applied successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Verifying patches applied on home /u01/app/12.1.0.2/grid
Patch verification completed with warning on home /u01/app/12.1.0.2/grid


Verifying patches applied on home /u01/app/oracle/product/12.1.0.2/db_1
Patch verification completed with warning on home /u01/app/oracle/product/12.1.0.2/db_1

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:rac01
RAC Home:/u01/app/oracle/product/12.1.0.2/db_1
Summary:

==Following patches were SKIPPED:

Patch: /u01/orasw/patches/24412235/21436941
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /u01/orasw/patches/24412235/24007012
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /u01/orasw/patches/24412235/23854735
Log: /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2016-12-22_09-32-40AM_1.log

Patch: /u01/orasw/patches/24412235/24006101
Log: /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2016-12-22_09-32-40AM_1.log


Host:rac01
CRS Home:/u01/app/12.1.0.2/grid
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /u01/orasw/patches/24412235/21436941
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2016-12-22_09-39-24AM_1.log

Patch: /u01/orasw/patches/24412235/23854735
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2016-12-22_09-39-24AM_1.log

Patch: /u01/orasw/patches/24412235/24006101
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2016-12-22_09-39-24AM_1.log

Patch: /u01/orasw/patches/24412235/24007012
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2016-12-22_09-39-24AM_1.log


OPatchauto session completed at Thu Dec 22 10:11:30 2016
Time taken to complete the session 49 minutes, 56 seconds

ACFS

Various notes on ACFS. Here is a good Oracle article on working with ACFS: How to Mount or Unmount ACFS File System While Applying GI Patches? (Doc ID 1494652.1)

If ACFS Used

See the patch notes. This is just one option for select environments.

  1. As oracle, on the 1st node: stop the Oracle RAC databases running on that node.
  2. As root, on the 1st node: unmount the ACFS file system(s).
  3. As root, on the 1st node: apply the patch to the GI Home using the opatchauto.
  4. As root, on the 1st node: remount ACFS file system(s).
  5. As oracle, on the 1st node: start the Oracle RAC databases running on that node.

Repeat above steps for all nodes.

ACFS Session Example (rac01)

Done on each node.

su - 
srvctl stop filesystem -d /dev/asm/acfs_vol-42 -n rac01
cd $ORACLE_HOME/OPatch
./opatchauto apply /u01/orasw/patches/24412235 -ocmrf /u01/orasw/ocmrsp/ocm.rsp

Display ACFS Info

Show Mounted Volume Info: /sbin/acfsutil registry

[root]$ /sbin/acfsutil registry
Mount Object:
  Device: /dev/asm/acfs_vol-42
  Mount Point: /u02
  Disk Group: ACFS
  Volume: ACFS_VOL
  Options: none
  Nodes: all

Show Oracle\Grid Services

   ps -eaf |grep d.bin