Apply and review patches


Overview

I will apply APRIL 2019 PSU for 12.1.0.2 to both PADSTOW and BOTANY .

References

Procedure

Download PSU and README

I downloaded P29141015 from Oracle Support and saved it into /opt/share/Software/Patches as p29141015_121020_Linux-x86-64.zip .

The README for this PSU was saved into /opt/share/Software/Patches/Patch 29141015 - Database Patch Set Update 12.1.0.2.190416.html .

Review PSU README

The README for the APRIL 2019 PSU says:

You must use the OPatch utility version 12.2.0.1.14 or later to apply this patch. Oracle recommends that you use the latest released OPatch version for 12.2, which is available for download from My Oracle Support patch 6880880 by selecting the 12.2.0.1.0 release.

Get Current Version of OPatch

On PADSTOW , I ran the following command to get the current version of OPatch:

${ORACLE_HOME}/OPatch/opatch version

The output was

OPatch Version: 12.1.0.1.3

OPatch succeeded.

However, the output from BOTANY was different:

OPatch Version: 12.1.0.1.8

OPatch succeeded.

I need to get the latest version of OPatch.

Download OPatch

I downloaded OPatch into /opt/share/Software/OPatch/p6880880_122010_Linux-x86-64.zip .

The README was saved into /opt/share/Software/OPatch/Patch 6880880 OPatch 12.2.0.1.19.txt .

Save Old Version of OPatch

On PADSTOW , I saved the old version of OPatch as follows:

cd ${ORACLE_HOME}
mv OPatch OPatch_12_1_0_1_3

I repeated similar commands on BOTANY :

cd ${ORACLE_HOME}
mv OPatch OPatch_12_1_0_1_8

Install New Version of Patch

Ran the following command on both PADSTOW and BOTANY :

cd ${ORACLE_HOME}
unzip -q /opt/share/Software/OPatch/p6880880_122010_Linux-x86-64.zip

Get New Version of OPatch

On both PADSTOW and BOTANY , I ran the following command to get the current version of OPatch:

${ORACLE_HOME}/OPatch/opatch version

The output was

OPatch Version: 12.2.0.1.19

OPatch succeeded.

Environment Checks

On both PADSTOW and BOTANY , I ran the following command to validate the correct executables are in the path:

which make ar ld nm

The output was the same on both systems:

/usr/bin/make
/usr/bin/ar
/usr/bin/ld
/usr/bin/nm

Unzip PSU

On both PADSTOW and BOTANY , I ran the following commands to unzip the PSU:

mkdir /tmp/P29141015 
unzip -q /opt/share/Software/Patches/p29141015_121020_Linux-x86-64.zip -d /tmp/P29141015

Interim Patch Conflict Detection and Resolution

On both PADSTOW and BOTANY , I ran the following commands to unzip the PSU:

cd /tmp/P29141015/29141015
${ORACLE_HOME}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./

The output was similar on both systems:

Oracle Interim Patch Installer version 12.2.0.1.19
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /opt/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /opt/app/oraInventory
   from           : /opt/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.19
OUI version       : 12.1.0.2.0
Log file location : /opt/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2020-02-24_14-04-10PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

Shutdown Listener and Database Instances

On both PADSTOW and BOTANY , I ran the following command to stop the Oracle listener:

lsnrctl stop

The output was similar on both systems:

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 24-FEB-2020 14:07:02

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
The command completed successfully

On PADSTOW only (the data guard standby was not running on BOTANY ), I ran the following series of commands to stop the running Oracle database instances:

[oracle@padstow 29141015]$ ps -ef|grep pmon
oracle     2555      1  0 08:58 ?        00:00:01 ora_pmon_jar
oracle    15619  11703  0 14:07 pts/1    00:00:00 grep pmon
[oracle@padstow 29141015]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 24 14:07:48 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Patch Installation

On PADSTOW only, I ran the following command to patch the Oracle database home:

cd /tmp/P29141015/29141015
${ORACLE_HOME}/OPatch/opatch apply

The output was too long to include here. It is attached as apply_psu_201904_padstow.log. However, it contained the following warning:

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 `/opt/app/oracle/product/12.1.0/dbhome_1/bin/extjobO': Operation not permitted
make: [iextjob] Error 1 (ignored)

Oracle Support document, (Doc ID 2265726.1) , matches this warning. It says:

The Issue / Warning "chmod: changing permissions of '$ORACLE_HOME/bin/extjobO'': Operation not permitted" can be ignored safely.

Patch Post-Installation

On PADSTOW only, I ran the following command to do the data patch on the JAR database:

[oracle@padstow 29141015]$ . oraenv
ORACLE_SID = [jar] ? 
The Oracle base remains unchanged with value /opt/app/oracle
[oracle@padstow 29141015]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 24 15:43:57 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size		    2924832 bytes
Variable Size		  503320288 bytes
Database Buffers	 1056964608 bytes
Redo Buffers		   13848576 bytes
Database mounted.
Database opened.
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified Auditing options
[oracle@padstow 29141015]$ cd $ORACLE_HOME/OPatch
[oracle@padstow OPatch]$ ./datapatch
SQL Patching tool version 12.1.0.2.0 Production on Mon Feb 24 15:48:55 2020
Copyright (c) 2012, 2016, Oracle.  All rights reserved.

Connecting to database...OK
Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PLUM JAM0 VEGEMITER JAM1 JAM
    Nothing to roll back
    The following patches will be applied:
      29141015 (DATABASE PATCH SET UPDATE 12.1.0.2.190416)

Installing patches...
Patch installation complete.  Total patches installed: 7

Validating logfiles...done
SQL Patching tool complete on Mon Feb 24 16:02:38 2020

There is no need to apply the data patch on the physical standby.