Apply RU on DATABASE 12.2

Applying RU (Release Update) for Oracle Database 12.2.0.1

Goal: We are going to apply 26123830 (DATABASE RELEASE UPDATE 12.2.0.1.170718) on 12.2 Oracle Database Home

Contents
___________________________________________________________________________________________________

1. Environment
2. Introduction
3. Download the patch from MOS (My Oracle Support)
4. Unzip patch
5. List patches which were applied
6. CheckConflict
7. Shutdown ALL PDBs and CDB
7.1 Backup Oracle Home / Inventory
8. Stop LISTENER which is running from Oracle Database Home
9. Apply Patch
10. List Patches
11. Startup CDB and ALL PDBs
12. Apply SQL changes (datapatch)
13. Verify from dba_registry_sqlpatch
14. Start LISTENER
_________________________________________________________________________________________________


1. Environment

Platform   : Linuxx86_64
Server IP  : 192.168.2.101
DB Version : Oracle 12.2.0.1.0, File system: Normal, RAC: Non-RAC
CDB Name   : CDB2
PDB Name   : PDB1,PDB2,PDB3,PDB4
Oracle Home: /u01/app/oracle/product/12.2.0.1


2. Introduction

What is an RU? Release Update (formerly known as Proactive Bundle Patches). 

on 18c onwards RU are actually the second number, eg. 19.4.0.0.0, 
Each release update can also be updated with PSUs

What is RUR? Release Update Revision (formerly known as PSU)


3. Download the patch from MOS


4. Unzip patch

-- Copy the patch to server from local machine using WinSCP or FTP

[oracle@localhost RU]$ pwd
/home/oracle/RU
[oracle@localhost RU]$ unzip p26123830_122010_Linux-x86-64.zip

[oracle@localhost RU]$ ls -lrth
total 40M
drwxrwxr-x. 4 oracle dba 4.0K Jul  7  2017 26123830
-rw-rw-r--. 1 oracle dba  17K Aug  7  2017 PatchSearch.xml
-rw-r--r--. 1 oracle dba  40M Jul 16 14:55 p26123830_122010_Linux-x86-64.zip
[oracle@localhost RU]$


5. List patches which were applied

[oracle@localhost ~]$ cd /u01/app/oracle/product/12.2.0.1/OPatch/
[oracle@localhost OPatch]$ ./opatch lsinv
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2018, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/12.2.0.1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0.1/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2018-07-16_15-05-18PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/lsinv/lsinventory2018-07-16_15-05-18PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c                                                  12.2.0.1.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@localhost OPatch]$


6. CheckConflict

[oracle@localhost RU]$ pwd
/home/oracle/RU
[oracle@localhost RU]$ cd 26123830
[oracle@localhost 26123830]$ /u01/app/oracle/product/12.2.0.1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/RU/26123830
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2018, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/12.2.0.1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0.1/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2018-07-16_22-14-05PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed. <-----

OPatch succeeded.
[oracle@localhost 26123830]$


7. Shutdown ALL PDBs and CDB

[oracle@localhost 26123830]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 16 16:08:35 2018

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT <----
SQL>
SQL> ALTER PLUGGABLE DATABASE ALL CLOSE IMMEDIATE;

Pluggable database altered.

SQL> SHUT IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@localhost 26123830]$
[oracle@localhost 26123830]$ ps -ef | grep pmon
oracle   11763  3363  0 16:10 pts/0    00:00:00 grep pmon
[oracle@localhost 26123830]$


7.1 Backup Oracle Home / Inventory

-- Take Backup of below for safer side

Oracle Inventory

[oracle@localhost 26123830]$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=dba
[oracle@localhost 26123830]$

[oracle@localhost ~]$ cd /u01/app/
[oracle@localhost app]$ ls -ltrh
total 8.0K
drwxr-xr-x. 10 oracle dba 4.0K Jan 13  2017 oracle
drwxrwx---.  6 oracle dba 4.0K Jul 16 16:15 oraInventory
[oracle@localhost app]$

tar -czvf /u01/stage/Backup_OraInv.tar oraInventory | gzip > /u01/stage/Backup_OraInv.tar.gz


Oracle Database Home

[oracle@localhost app]$ cd /u01/app/oracle/product
[oracle@localhost product]$ ls -lrth

drwxr-xr-x. 72 oracle dba 4.0K Oct 21  2016 12.1.0.2
[oracle@localhost product]$

tar -czvf /u01/stage/Backup_Soft_12.2.tar 12.2.0.1 | gzip > /u01/stage/Backup_Soft_12.2.tar.gz


8. Stop LISTENER which is running from Oracle Database Home

[oracle@localhost 26123830]$ ps -ef | grep tns
root        22     2  0 13:45 ?        00:00:00 [netns]
oracle    2958     1  0 13:46 ?        00:00:00 /u01/app/oracle/product/12.2.0.1/bin/tnslsnr LISTENER -inherit
oracle   11767  3363  0 16:10 pts/0    00:00:00 grep tns
[oracle@localhost 26123830]$
[oracle@localhost 26123830]$ lsnrctl stop LISTENER

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-JUL-2018 16:10:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully
[oracle@localhost 26123830]$
[oracle@localhost 26123830]$ ps -ef | grep tns
root        22     2  0 13:45 ?        00:00:00 [netns]
oracle   11775  3363  0 16:11 pts/0    00:00:00 grep tns
[oracle@localhost 26123830]$


9. Apply Patch

[oracle@localhost 26123830]$ /u01/app/oracle/product/12.2.0.1/OPatch/opatch apply -oh /u01/app/oracle/product/12.2.0.1 -local
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2018, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/12.2.0.1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0.1/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2018-07-16_16-12-25PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   26123830

Do you want to proceed? [y|n]
y <-----
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.2.0.1')


Is the local system ready for patching? [y|n]
y  <------
User Responded with: Y
Backing up files...
Applying interim patch '26123830' to OH '/u01/app/oracle/product/12.2.0.1'

Patching component oracle.oracore.rsf, 12.2.0.1.0...

Patching component oracle.ctx, 12.2.0.1.0...

Patching component oracle.rdbms.deconfig, 12.2.0.1.0...

Patching component oracle.rdbms.rsf, 12.2.0.1.0...

Patching component oracle.rdbms.rman, 12.2.0.1.0...

Patching component oracle.rdbms, 12.2.0.1.0...

Patching component oracle.rdbms.util, 12.2.0.1.0...

Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...

Patching component oracle.tfa, 12.2.0.1.0...

Patching component oracle.rdbms.rsf.ic, 12.2.0.1.0...
Patch 26123830 successfully applied.
Log file location: /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2018-07-16_16-12-25PM_1.log

OPatch succeeded.
[oracle@localhost 26123830]$


10. List Patches

[oracle@localhost 26123830]$ /u01/app/oracle/product/12.2.0.1/OPatch/opatch lsinv -oh  /u01/app/oracle/product/12.2.0.1
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2018, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/12.2.0.1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0.1/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2018-07-16_16-16-43PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/lsinv/lsinventory2018-07-16_16-16-43PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c                                                  12.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  26123830     : applied on Mon Jul 16 16:13:29 CEST 2018
Unique Patch ID:  21405588
Patch description:  "DATABASE RELEASE UPDATE: 12.2.0.1.170718 (26123830)"
   Created on 7 Jul 2017, 00:33:59 hrs PST8PDT
   Bugs fixed:
     23026585, 24336249, 24929210, 24942749, 25036474, 25110233, 25410877
     25417050, 25427662, 25459958, 25547901, 25569149, 25600342, 25600421
     25606091, 25655390, 25662088, 24385983, 24923215, 25099758, 25429959
     25662101, 25728085, 25823754, 22594071, 23665623, 23749454, 24326846
     24334708, 24560906, 24573817, 24578797, 24609996, 24624166, 24668398
     24674955, 24744686, 24811725, 24827228, 24831514, 24908321, 24976007
     25184555, 25210499, 25211628, 25223839, 25262869, 25316758, 25337332
     25455795, 25457409, 25539063, 25546608, 25612095, 25643931, 25410017
     22729345, 24485174, 24509056, 24714096, 25329664, 25410180, 25607726
     25957038, 25973152, 26024732, 24376878, 24589590, 24676172, 23548817
     24796092, 24907917, 25044977, 25736747, 25766822, 25856821, 25051628
     24534401, 24835919, 25050160, 25395696, 25430120, 25616359, 25715167
     25967985



--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@localhost 26123830]$


11. Startup CDB and ALL PDBs

[oracle@localhost 26123830]$ . oraenv
ORACLE_SID = [CDB2] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@localhost 26123830]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 16 16:59:14 2018

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

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size                  8793208 bytes
Variable Size             503317384 bytes
Database Buffers         1056964608 bytes
Redo Buffers                7983104 bytes
Database mounted.
Database opened.
SQL>
SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT <-----
SQL>
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;

Pluggable database altered.

SQL>
SQL> col name for a30
SQL> select name,open_mode,con_id,dbid from v$containers;

NAME                           OPEN_MODE      CON_ID       DBID
------------------------------ ---------- ---------- ----------
CDB$ROOT                       READ WRITE          1  680230459
PDB$SEED                       READ ONLY           2 2993936271
PDB1                           READ WRITE          3  627484885
PDB2                           READ WRITE          4  891811039
PDB3                           READ WRITE          5  424568091
PDB4                           READ WRITE          6 2306285303

6 rows selected.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@localhost 26123830]$


12. Apply SQL changes (datapatch)

[oracle@localhost 26123830]$ /u01/app/oracle/product/12.2.0.1/OPatch/datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Mon Jul 16 17:03:21 2018
Copyright (c) 2012, 2017, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_15649_2018_07_16_17_03_21/sqlpatch_invocation.log

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

Current state of SQL patches:
Bundle series DBRU:
  ID 170718 in the binary registry and not installed in any PDB

Adding patches to installation queue and performing prereq checks...
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PDB1 PDB2 PDB3 PDB4
    Nothing to roll back
    The following patches will be applied:
      26123830 (DATABASE RELEASE UPDATE 12.2.0.1.170718)

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

Validating logfiles...
Patch 26123830 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_CDBROOT_2018Jul16_17_04_18.log (no errors)
Patch 26123830 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_PDBSEED_2018Jul16_17_06_59.log (no errors)
Patch 26123830 apply (pdb PDB1): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_PDB1_2018Jul16_17_06_59.log (no errors)
Patch 26123830 apply (pdb PDB2): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_PDB2_2018Jul16_17_07_00.log (no errors)
Patch 26123830 apply (pdb PDB3): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_PDB3_2018Jul16_17_06_59.log (no errors)
Patch 26123830 apply (pdb PDB4): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_PDB4_2018Jul16_17_09_43.log (no errors)
SQL Patching tool complete on Mon Jul 16 17:11:28 2018
[oracle@localhost 26123830]$


13. Verify from dba_registry_sqlpatch

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT <-----
SQL>

SET LINESIZE 500
SET PAGESIZE 1000
SET SERVEROUT ON
SET LONG 2000000

COLUMN action_time FORMAT A12
COLUMN action FORMAT A10
COLUMN bundle_series FORMAT A4 
COLUMN comments FORMAT A30
COLUMN description FORMAT A40
COLUMN namespace FORMAT A20
COLUMN status FORMAT A10
COLUMN version FORMAT A10

SELECT TO_CHAR(action_time, 'YYYY-MM-DD') AS action_time,
 action,
 status,
 description,
 version,
 patch_id,
 bundle_series
 FROM   sys.dba_registry_sqlpatch
 ORDER by action_time;


ACTION_TIME  ACTION     STATUS     DESCRIPTION                              VERSION      PATCH_ID BUND
------------ ---------- ---------- ---------------------------------------- ---------- ---------- ----
2018-07-16   APPLY      SUCCESS    DATABASE RELEASE UPDATE 12.2.0.1.170718  12.2.0.1     26123830 DBRU

SQL>


14. Start LISTENER

[oracle@localhost 26123830]$ ps -ef | grep tns
root        22     2  0 13:45 ?        00:00:00 [netns]
oracle   21274  3363  0 18:47 pts/0    00:00:00 grep tns
[oracle@localhost 26123830]$
[oracle@localhost 26123830]$ lsnrctl start LISTENER

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-JUL-2018 18:47:50

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

Starting /u01/app/oracle/product/12.2.0.1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                16-JUL-2018 18:47:50
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@localhost 26123830]$
[oracle@localhost 26123830]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-JUL-2018 18:47:58

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                16-JUL-2018 18:47:50
Uptime                    0 days 0 hr. 0 min. 8 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=5501))(Security=(my_wallet_directory=/u01/app/oracle/admin/CDB2/xdb_wallet))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=5511))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/CDB2/xdb_wallet))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=5510))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "6f205af172040e0ce055000000000001" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "6f205af172050e0ce055000000000001" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "6f205af172060e0ce055000000000001" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "6f2c146104472ecee055000000000001" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "pdb2" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "pdb3" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "pdb4" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@localhost 26123830]$

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala