Applying the first RU for Oracle Database 12.2.0.1

Appying the first RU for Oracle Database 12.2.0.1The first RU (Release Update) for Oracle 12.2 is available on most platforms since July 18, 2017. And of course I started applying the first RU for Oracle Database 12.2.0.1 as soon as it got released.

See: https://mikedietrichde.com/2017/07/19/first-ru-oracle-12-2-0-1-available/

Download the RU 12.2.0.1.170718 for Linux

First of all I downloaded the Database RU 12.2.0.1.170718 Patch 26123830 for Linux from MyOracle Support. To my absolute surprise it was very small compared to previous Proactive Bundle Patches such as the April 2017 one. It has just 40 MB in size (no typo!).

Applying the first RU for Oracle Database 12.2.0.1

Download the first RU (Release Update) July 2017 for Oracle 12.2.0.1

Applying the first RU for Oracle Database 12.2.0.1

Then I unzipped the RU into my /tmp folder, set my environment and did the conflict check.

unzip p26123830_12201_Linux-x86-64.zip
cd 26123830
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph .

Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, 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.8
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2017-07-19_18-12-27PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
/

This looks good.

Lets start the “apply”.

$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, 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.8
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2017-07-19_18-13-57PM_1.log

Verifying environment and performing prerequisite checks...
Prerequisite check "CheckApplicable" failed.
The details are:

Patch 26123830:
Copy Action: Destination File "/u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar" is not writeable.
'oracle.rdbms.dbscripts, 12.2.0.1.0': Cannot copy file from 'preupgrade.jar' to '/u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar'

UtilSession failed: 
Prerequisite check "CheckApplicable" failed.
Log file location: /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2017-07-19_18-13-57PM_1.log

OPatch failed with error code 73

Ouch! What is going wrong here?

Fixing the issue

I downloaded the most recent version of preupgrade.jar from MOS Note:884522.1 a few weeks ago. And it set the following permissions:

$ ls -lrt /u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar 
-r-xr-xr-x. 1 oracle dba 559696 May 26 20:57 /u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar

I moved preupgrade.jar to preupgrade.jar.old and restarted the apply again:

$ mv /u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar  /u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar.old

$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, 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.8
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2017-07-19_18-19-12PM_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...
Skip copying to "/u01/app/oracle/product/12.2.0.1/ctx/admin/ctxposup.sql" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/ctx/admin/ctxposup.sql"
Skip copying to "/u01/app/oracle/product/12.2.0.1/ctx/admin/ctxpreup.sql" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/ctx/admin/ctxpreup.sql"
Skip copying to "/u01/app/oracle/product/12.2.0.1/ctx/admin/driparse.plb" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/ctx/admin/driparse.plb"

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...
Skip copying to "/u01/app/oracle/product/12.2.0.1/lib/libkubsagt12.so" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/lib/libkubsagt12.so"

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

Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...
Skip copying to "/u01/app/oracle/product/12.2.0.1/rdbms/admin/prvtgwmco.plb" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/rdbms/admin/prvtgwmco.plb"
Skip copying to "/u01/app/oracle/product/12.2.0.1/rdbms/admin/prvtash.plb" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/rdbms/admin/prvtash.plb"
Skip copying to "/u01/app/oracle/product/12.2.0.1/rdbms/admin/prvtrmns.plb" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/rdbms/admin/prvtrmns.plb"

Patching component oracle.tfa, 12.2.0.1.0...

Patching component oracle.rdbms.rsf.ic, 12.2.0.1.0...
Skip copying to "/u01/app/oracle/product/12.2.0.1/lib/libipc1.so" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/lib/libipc1.so"
Skip copying to "/u01/app/oracle/product/12.2.0.1/lib/libmql1.so" because it is the same as 
the file in incoming patch "/home/oracle/26123830/files/lib/libmql1.so"
Patch 26123830 successfully applied.
Sub-set patch [25862693] has become inactive due to the application of a super-set patch [26123830].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/12.2.0.1/cfgtoollogs/opatch/opatch2017-07-19_18-19-12PM_1.log

OPatch succeeded.

And Bingo! Now it worked fine.

Applying SQL changes

Finally I’ll have to apply the necessary SQL changes with datapatch:

$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed Jul 19 18:21:53 2017
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> alter pluggable database all open;
Pluggable database altered.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[CDB2] oracle@localhost:~/26123830
$ $ORACLE_HOME/OPatch/datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Wed Jul 19 18:22:29 2017
Copyright (c) 2012, 2017, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_16482_2017_07_19_18_22_29/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 DBBP:
  Not installed in the binary registry and ID 170516 in PDB CDB$ROOT, ID 170516 in PDB PDB$SEED
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
    The following patches will be rolled back:
      25862693 (DATABASE BUNDLE PATCH 12.2.0.1.170516)
    The following patches will be applied:
      26123830 (DATABASE RELEASE UPDATE 12.2.0.1.170718)

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

Validating logfiles...
Patch 25862693 rollback (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/25862693/21259009/25862693_rollback_CDB2_CDBROOT_2017Jul19_18_22_39.log (no errors)
Patch 26123830 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_CDBROOT_2017Jul19_18_22_39.log (no errors)
Patch 25862693 rollback (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/25862693/21259009/25862693_rollback_CDB2_PDBSEED_2017Jul19_18_23_02.log (no errors)
Patch 26123830 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB2_PDBSEED_2017Jul19_18_23_03.log (no errors)
SQL Patching tool complete on Wed Jul 19 18:23:12 2017

Check if the patches have been applied successfully

For this check I use my check_patches.sql script:

SQL> start /media/sf_TEMP/check_patches.sql

ACTION_TIME	     ACTION	STATUS	   DESCRIPTION				    VERSION	 PATCH_ID BUNDLE_SER
-------------------- ---------- ---------- ---------------------------------------- ---------- ---------- ----------
19-JUL-2017 18:23:10 ROLLBACK	SUCCESS    DATABASE BUNDLE PATCH 12.2.0.1.170516    12.2.0.1	 25862693 DBBP
19-JUL-2017 18:23:10 APPLY	SUCCESS    DATABASE RELEASE UPDATE 12.2.0.1.170718  12.2.0.1	 26123830 DBRU
19-MAY-2017 17:53:26 APPLY	SUCCESS    DATABASE BUNDLE PATCH 12.2.0.1.170516    12.2.0.1	 25862693 DBBP


ACTION_TIME	     ACTION	NAMESPACE	     VERSION		ID COMMENTS			  BUNDLE_SER
-------------------- ---------- -------------------- ---------- ---------- ------------------------------ ----------
		     BOOTSTRAP	DATAPATCH	     12.2.0.1		   RDBMS_12.2.0.1.0_LINUX.X64_17

Of course at the very end I did check if I can use the preupgrade.jar with the permission set by the RU:

$ ls -lrt /u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar
-rw-r--r--. 1 oracle dba 559676 Jul  7 09:34 /u01/app/oracle/product/12.2.0.1/rdbms/admin/preupgrade.jar

And yes, this works fine.

Which patches are included?

Quick exercise as this can be done easily with DBMS_QOPATCH:

SQL> set serverout on
SQL> set long 200000000
SQL> set pages 2000
SQL> select xmltransform(dbms_qopatch.get_opatch_bugs, dbms_qopatch.get_opatch_xslt) from dual;

–Mike

Share this: