Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Oracle Configuration : Apply a Database Bundle Patch


From Robs_Wiki

Contents
1 Introduction
2 Preparation Steps
2.1 Step 1 Evaluate the patch
2.2 Step 2 Download, Stage and Unzip the patch
2.3 Step 3 Check the OPatch version
2.4 Step 4 Check if the OJVM Patch needs to be applied
2.5 Step 5 Check and save the current Oracle inventory information
2.6 Step 6 Check and save the current Oracle database registry information
2.7 Step 7 Run the Bundle Patch conflict check
2.8 Step 8 Run the Bundle Patch space check
2.9 Step 9 Run the OJVM Patch conflict check
3 Apply the Database Bundle Patch
3.1 Step 1 Stop the database and listener (if running from that same Oracle Home)
3.2 Step 2 Run the patch SIMULATION
3.3 Step 3 Apply the patch on the software binaries
3.4 Step 4 Check the Oracle inventory
3.5 Step 5 Apply the patch to the database
3.6 Step 6 Check the database registry
3.7 Step 7 Restart the listener
4 Apply the OJVM Patch
4.1 Step 1 Stop the database and listener (if running from that same Oracle Home)
4.2 Step 2 Run the patch SIMULATION
4.3 Step 3 Apply the patch to the software binaries
4.4 Step 4 Check the Oracle inventory
4.5 Step 5 Apply the patch to the database
4.6 Step 6 Check the database registry
4.7 Step 7 Restart the database in NORMAL mode and restart the listener
5 Post Patch Steps
5.1 Step 1 Save the inventory information
6 Supplement 1: Rollback the OJVM Patch
6.1 Step 1 Stop the database and the listener
6.2 Step 2 Rollback the patch
6.3 Step 3 Verify the inventory
6.4 Step 4 Rollback the OJVM patch from the database
6.5 Step 5 Verify the rollback
6.6 Step 6 Restart the database in the normal mode and the listener
7 Supplement 2: Rollback the Database Bundle Patch
7.1 Step 1 Stop the database and the listener
7.2 Step 2 Rollback the patch
7.3 Step 3 Check the rollback
7.4 Step 4 Rollback the patch from the database
7.5 Step 5 Check the database rollback
7.6 Step 6 Restart the listener
8 Supplement 3 Restore at the OS level

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 1/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Introduction
In this example the 12.1.0.2 Database Bundle Patch for October 2018 is applied: Patch 28259867 - Database Bundle
Patch 12.1.0.2.181016
This patch is applied on a Standalone Database. (No RAC or Oracle Restart configured).
This bundle patch usually contains a Database Bundle Patch and a OJVM bundle patch. Most likely both will need to be
applied, but I will check that later on.
The patching methodology changes regularly, so always check the README to see if this approach still applies for
future patches.

Preparation Steps
Step 1 Evaluate the patch
Go to the My Oracle Support site and check the following Oracle Note: Master Note for Database Proactive Patch
Program (Doc ID 756671.1)
This note lists the most recent PSU patches. Scroll to the 12.1.0.2 database (our current version) and select the patch that
needs to be applied.
In order to review the README of the patch we will need to download and stage the patch.

Step 2 Download, Stage and Unzip the patch

I downloaded the patch and staged the patch in: /rman/Software/Patches>cd CPU_20181016_Oracle

-- perform as the oracle user


$ cd /rman/Software/Patches>cd CPU_20181016_Oracle
$ unzip p28689151_121020_SOLARIS64.zip

Once unzipped the following directories and files are present:

28689151
|
|- README.txt
|
|- README.html
|
|- 28349951/ <== contains Database Bundle Patch
| --README.html
| --<other files and directories>
|
|- 28440711/ <== contains OJVM Patch
| --README.html
| --<other files and directories>
|

Step 3 Check the OPatch version

The opatch version should be 12.2.0.1.13 or higher as per the readme. Check the current version on the system:

$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.14

OPatch succeeded.

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 2/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

If the minimal required version is not present you have to download and install a new opatch version. This is explained in
another post on this website.

Step 4 Check if the OJVM Patch needs to be applied

Every Bundle patch always contains a Database Bundle Patch and a OJVM patch. OJVM is the Oracle Java Virtual Machine
which gives you the ability to execute JAVA code directly in the database. However, not every database contains the OJVM
component. So if you don’t have OJVM in the database, you can skip the OJVP patch altogether. We will check it here:

SQL> SELECT version, status FROM dba_registry WHERE comp_id='JAVAVM';

VERSION STATUS
------------------------------ -----------
12.1.0.2.0 VALID

So OJVM is installed in the database, so we need to patch it. 

Step 5 Check and save the current Oracle inventory information

$ $ORACLE_HOME/OPatch/opatch lsinventory|grep applied


Patch 27923320 : applied on Sat Aug 18 15:14:37 BST 2018
Patch 27547374 : applied on Sat Aug 18 14:51:02 BST 2018
Patch 20804826 : applied on Thu Apr 19 10:29:38 BST 2018

$ORACLE_HOME/OPatch/opatch lsinventory > inventory_before_PROD.log

Step 6 Check and save the current Oracle database registry information

SQL> @admin_patch_info.sql

PATCH_TIME ACTION STATUS DESCRIPTION VERSION PATCH_ID BUNDLE_SER


-------------------- ---------- ---------- ---------------------------------------- ---------- ---------- ----------
12-AUG-2017 11:45:25 APPLY SUCCESS DATABASE BUNDLE PATCH 12.1.0.2.170418 12.1.0.2 25397136 DBBP
28-MAR-2018 22:01:08 APPLY SUCCESS DATABASE BUNDLE PATCH 12.1.0.2.171017 12.1.0.2 26717470 DBBP
25-JUL-2018 09:04:13 APPLY SUCCESS DATABASE BUNDLE PATCH 12.1.0.2.180717 12.1.0.2 27547374 DBBP
27-JUL-2018 08:55:33 APPLY SUCCESS Database PSU 12.1.0.2.180717, Oracle Jav 12.1.0.2 27923320
aVM Component (JUL2018)

remark: reference to the script: admin_patch_info.sql

Step 7 Run the Bundle Patch conflict check

$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951
$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./26983807

Oracle Interim Patch Installer version 12.2.0.1.14


Copyright (c) 2018, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-11-27_14-37-44PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 3/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

Step 8 Run the Bundle Patch space check

First create the file that will be used for the space check:

$ echo /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/26983807 > /tmp/space_check.txt


$ echo /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/28259867 >> /tmp/space_check.txt
$ echo /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/28259914 >> /tmp/space_check.txt
$ echo /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/28259950 >> /tmp/space_check.txt
<pre>
Now run the space check:
<pre>
$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/space_check.txt
Oracle Interim Patch Installer version 12.2.0.1.14
Copyright (c) 2018, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-11-27_15-24-39PM_1.log

Invoking prereq "checksystemspace"

Prereq "checkSystemSpace" passed.

OPatch succeeded.

Step 9 Run the OJVM Patch conflict check

$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28440711

$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./


Oracle Interim Patch Installer version 12.2.0.1.14
Copyright (c) 2018, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-11-27_15-09-51PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

Apply the Database Bundle Patch


Step 1 Stop the database and listener (if running from that same Oracle Home)

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 4/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

SQL> shutdown immediate;


SQL> exit;

$ lsnrctl stop listener_PROD

Step 2 Run the patch SIMULATION

At this step we will just run a patch simulation, to see if it will run well:

$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/28259867

$ $ORACLE_HOME/Opatch/opatch apply -report

. . .
. . .
Skip patching component oracle.rdbms.dbscripts, 12.1.0.2.0 and its actions.
The actions are reported here, but are not performed.

ApplySession skipping inventory update.


Composite patch 28259867 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-07_15-06-52PM_1.log

OPatch succeeded.

Step 3 Apply the patch on the software binaries

This step took about 6 minutes ...

$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/28259867

$ $ORACLE_HOME/OPatch/opatch apply

Oracle Interim Patch Installer version 12.2.0.1.14


Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-08_15-32-07PM_1.log

Verifying environment and performing prerequisite checks...


OPatch continues with these patches: 28259867

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.1.0/PROD')

Is the local system ready for patching? [y|n]


y
User Responded with: Y
Backing up files...
Applying sub-patch '28259867' to OH '/u01/app/oracle/product/12.1.0/PROD'
ApplySession: Optional component(s) [ oracle.has.crs, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.

Patching component oracle.has.deconfig, 12.1.0.2.0...

Patching component oracle.rdbms.rman, 12.1.0.2.0...

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 5/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki
Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.crs, 12.1.0.2.0...

Patching component oracle.oracore.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...


Composite patch 28259867 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-08_15-32-07PM_1.log

OPatch succeeded.

Step 4 Check the Oracle inventory

$ $ORACLE_HOME/OPatch/opatch lsinventory

You should now see the following passage:

Interim patches (3) :

Patch 28259867 : applied on Sat Dec 08 15:34:26 GMT 2018


Unique Patch ID: 22499948
Patch description: "Database Bundle Patch : 12.1.0.2.181016 (28259867)"

Step 5 Apply the patch to the database

We need to start the database in order to apply the patch in the database.
This step took about 8 minutes...

$ sqlplus / as sysdba
SQL> startup;
SQL> exit;
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Sat Dec 8 16:10:50 2018
Copyright (c) 2012, 2017, Oracle. All rights reserved.

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

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:


Patch 27923320 (Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018)):
Installed in the binary registry and the SQL registry
Bundle series DBBP:
ID 181016 in the binary registry and ID 180717 in the SQL registry

Adding patches to installation queue and performing prereq checks...


Installation queue:
Nothing to roll back
The following patches will be applied:
28259867 (DATABASE BUNDLE PATCH 12.1.0.2.181016)

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

Validating logfiles...
Patch 28259867 apply: SUCCESS

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 6/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28259867/22499948/28259867_apply_LOADDEV_2018Dec08_16_12_17.log (no errors)
SQL Patching tool complete on Sat Dec 8 16:14:14 2018
LOADDEV:/u01/app/oracle/product/12.1.0/PROD/OPatch>./opatch version
OPatch Version: 12.2.0.1.14

OPatch succeeded.

Step 6 Check the database registry

SQL> @admin_patch_info.sql

Step 7 Restart the listener

$ lsnrctl start listener_PROD

Apply the OJVM Patch


Step 1 Stop the database and listener (if running from that same Oracle Home)

SQL> shutdown immediate;


SQL> exit;

$ lsnrctl stop listener_PROD

Step 2 Run the patch SIMULATION

At this step we will just run a patch simulation, to see if it will run well:

$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28440711

$ $ORACLE_HOME/OPatch/opatch apply -report

. . .
. . .
Skip patching component oracle.dbjava.jdbc, 12.1.0.2.0 and its actions..
The actions are reported here, but are not performed.

ApplySession skipping inventory update.


Patch 28440711 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0/LOADDEV/cfgtoollogs/opatch/opatch2018-12-08_18-38-35PM_1.log

OPatch succeeded.

Step 3 Apply the patch to the software binaries

This step took less than 5 minutes...

$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28440711
$ opatch apply

Oracle Interim Patch Installer version 12.2.0.1.14


Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 7/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki
Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-08_18-42-16PM_1.log

Verifying environment and performing prerequisite checks...


OPatch continues with these patches: 28440711

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.1.0/PROD')

Is the local system ready for patching? [y|n]


y
User Responded with: Y
Backing up files...
Applying interim patch '28440711' to OH '/u01/app/oracle/product/12.1.0/PROD'
ApplySession: Optional component(s) [ oracle.sqlj, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.

Patching component oracle.javavm.server, 12.1.0.2.0...

Patching component oracle.javavm.server.core, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.javavm.client, 12.1.0.2.0...

Patching component oracle.dbjava.jdbc, 12.1.0.2.0...

Patching component oracle.dbjava.ic, 12.1.0.2.0...


Patch 28440711 successfully applied.
Sub-set patch [27923320] has become inactive due to the application of a super-set patch [28440711].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-08_18-42-16PM_1.log

OPatch succeeded.

Step 4 Check the Oracle inventory

$ $ORACLE_HOME/OPatch/opatch lsinventory

. . .
Interim patches (3) :

Patch 28440711 : applied on Sat Dec 08 18:43:51 GMT 2018


Unique Patch ID: 22444907
Patch description: "Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)"
Created on 13 Sep 2018, 06:26:45 hrs PST8PDT
Bugs fixed:
28440711, 28502128, 28502113, 27923320, 27952584, 27952577, 27642235
27475603, 27461789, 27461842, 25649873, 27001733, 27000663, 27000690
26635845, 26637592, 26570171, 26027162, 26023002, 26023025, 25437695
25494413, 25494379, 24917972, 25067795, 24534298, 25076732, 25076756
24315824, 21659726, 24448240, 24448282, 23177536, 22675136, 23265914
23265965, 23727148, 22674709, 22670413, 22670385, 21188537, 22139226
22118835, 22118851, 21555660, 21811517, 19623450, 21566993, 21566944
19176885, 21068507, 21047803, 21047766, 20415564, 20408829, 20408866
19877336, 19855285, 19909862, 19895362, 19895326, 19153980, 19231857
19223010, 19245191, 19699946

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 8/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Step 5 Apply the patch to the database

We need to start the database in UPGRADE mode in order to apply the patch in the database.
This step took about 8 minutes...

$ sqlplus / as sysdba
SQL> startup upgrade
SQL> exit
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Sat Dec 8 18:55:15 2018
Copyright (c) 2012, 2017, Oracle. All rights reserved.

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

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:


Patch 27923320 (Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018)):
Installed in the SQL registry only
Patch 28440711 (Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)):
Installed in the binary registry only
Bundle series DBBP:
ID 181016 in the binary registry and ID 181016 in the SQL registry

Adding patches to installation queue and performing prereq checks...


Installation queue:
The following patches will be rolled back:
27923320 (Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018))
The following patches will be applied:
28440711 (Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018))

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

Validating logfiles...
Patch 27923320 rollback: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923320/22233913/27923320_rollback_PROD_2018Dec08_18_56_41.log (no errors)
Patch 28440711 apply: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28440711/22444907/28440711_apply_PROD_2018Dec08_19_01_17.log (no errors)
SQL Patching tool complete on Sat Dec 8 19:01:25 2018

Step 6 Check the database registry

SQL> @admin_patch_info.sql

Step 7 Restart the database in NORMAL mode and restart the listener

SQL> shutdown immediate;


SQL> startup;
SQL> exit
$ lsnrctl start listener_PROD

Post Patch Steps


Step 1 Save the inventory information

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 9/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

$ cd /home/oracle/dbadir/rob
$ $ORACLE_HOME/OPatch/opatch lsinventory > inventory_after_PROD_20181127.log
$ cat inventory_after_LOADDEV_20181127.log

Supplement 1: Rollback the OJVM Patch


Step 1 Stop the database and the listener

$ sqlplus / as sysdba
SQL> shutdown immediate
SQL> exit
$ lsnrctl stop listener_PROD

Step 2 Rollback the patch

$ $ORACLE_HOME/OPatch/opatch rollback -id 28440711

Oracle Interim Patch Installer version 12.2.0.1.14


Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-09_12-25-53PM_1.log

Patches will be rolled back in the following order:


28440711
The following patch(es) will be rolled back: 28440711

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

Is the local system ready for patching? [y|n]


y
User Responded with: Y

Rolling back patch 28440711...

RollbackSession rolling back interim patch '28440711' from OH '/u01/app/oracle/product/12.1.0/PROD'

Patching component oracle.javavm.server, 12.1.0.2.0...

Patching component oracle.javavm.server.core, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.javavm.client, 12.1.0.2.0...

Patching component oracle.dbjava.jdbc, 12.1.0.2.0...

Patching component oracle.dbjava.ic, 12.1.0.2.0...


RollbackSession removing interim patch '28440711' from inventory
Inactive sub-set patch [27923320] has become active due to the rolling back of a super-set patch [28440711].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/12.1.0/LOADDEV/cfgtoollogs/opatch/opatch2018-12-09_12-25-53PM_1.log

OPatch succeeded.

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 10/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Step 3 Verify the inventory

Verfiy that the OJVM Patch is no longer listed in the output. So you should NOT see the entry below in the output:

$ $ORACLE_HOME/OPatch/opatch lsinventory

Interim patches (3) :

Patch 28440711 : applied on Sat Dec 08 18:43:51 GMT 2018


Unique Patch ID: 22444907
Patch description: "Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)"
Created on 13 Sep 2018, 06:26:45 hrs PST8PDT
Bugs fixed:
28440711, 28502128, 28502113, 27923320, 27952584, 27952577, 27642235
27475603, 27461789, 27461842, 25649873, 27001733, 27000663, 27000690
26635845, 26637592, 26570171, 26027162, 26023002, 26023025, 25437695
25494413, 25494379, 24917972, 25067795, 24534298, 25076732, 25076756
24315824, 21659726, 24448240, 24448282, 23177536, 22675136, 23265914
23265965, 23727148, 22674709, 22670413, 22670385, 21188537, 22139226
22118835, 22118851, 21555660, 21811517, 19623450, 21566993, 21566944
19176885, 21068507, 21047803, 21047766, 20415564, 20408829, 20408866
19877336, 19855285, 19909862, 19895362, 19895326, 19153980, 19231857
19223010, 19245191, 19699946
. . .

Step 4 Rollback the OJVM patch from the database

$ sqlplus / as sysdba
SQL> startup upgrade
SQL> exit
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -verbose

SQL Patching tool version 12.1.0.2.0 Production on Sun Dec 9 12:36:47 2018
Copyright (c) 2012, 2017, Oracle. All rights reserved.

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

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:


Patch 27923320 (Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018)):
Installed in the binary registry only
Patch 28440711 (Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)):
Installed in the SQL registry only
Bundle series DBBP:
ID 181016 in the binary registry and ID 181016 in the SQL registry

Adding patches to installation queue and performing prereq checks...


Installation queue:
The following patches will be rolled back:
28440711 (Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018))
The following patches will be applied:
27923320 (Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018))

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

Validating logfiles...
Patch 28440711 rollback: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28440711/22444907/28440711_rollback_PROD_2018Dec09_12_38_17.log (no errors)
Patch 27923320 apply: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923320/22233913/27923320_apply_PROD_2018Dec09_12_43_16.log (no errors)
SQL Patching tool complete on Sun Dec 9 12:43:22 2018

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 11/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Step 5 Verify the rollback

SQL> @admin_patch_info.sql

Step 6 Restart the database in the normal mode and the listener

SQL> shutdown immedediate


SQL> exit
$ lsnrctl start listener_PROD

Supplement 2: Rollback the Database Bundle Patch


Step 1 Stop the database and the listener

$ sqlplus / as sysdba
SQL> shutdown immediate
SQL> exit
$ lsnrctl stop listener_PROD

Step 2 Rollback the patch

$ $ORACLE_HOME/OPatch/opatch rollback -id 28259867

Oracle Interim Patch Installer version 12.2.0.1.14


Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/PROD


Central Inventory : /home/oracle/oraInventory
from : /u01/app/oracle/product/12.1.0/PROD/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-09_15-46-30PM_1.log

Patches will be rolled back in the following order:


28259867
The following patch(es) will be rolled back: 28259867
Sub-patches of a composite series are being rolled back. The system will be returned to a state where 20243804,20415006,20594149,21125181,2
The following bug fixes will be removed: 16354467,17969866,18272672,18604692,18892426,18904062,19072979,19601762,19718981,19781326,19809171

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

Is the local system ready for patching? [y|n]


y
User Responded with: Y

Rolling back patch 28259867...

RollbackSession rolling back interim patch '28259867' from OH '/u01/app/oracle/product/12.1.0/LOADDEV'

Patching component oracle.has.deconfig, 12.1.0.2.0...

Patching component oracle.rdbms.rman, 12.1.0.2.0...

Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 12/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki
Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.crs, 12.1.0.2.0...

Patching component oracle.oracore.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...


RollbackSession removing interim patch '28259867' from inventory
Log file location: /u01/app/oracle/product/12.1.0/PROD/cfgtoollogs/opatch/opatch2018-12-09_15-46-30PM_1.log

OPatch succeeded.

Step 3 Check the rollback

Verfiy that the Database Bundle Patch is no longer listed in the output. So you should NOT see the entry below in the output:

$ $ORACLE_HOME/OPatch/opatch lsinventory

Interim patches (3) :

Patch 28259867 : applied on Sat Dec 08 15:34:26 GMT 2018


Unique Patch ID: 22499948
Patch description: "Database Bundle Patch : 12.1.0.2.181016 (28259867)"

Step 4 Rollback the patch from the database

$ sqlplus / as sysdba
SQL> startup
SQL> exit
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -verbose

SQL Patching tool version 12.1.0.2.0 Production on Sun Dec 9 16:06:02 2018
Copyright (c) 2012, 2017, Oracle. All rights reserved.

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

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:


Patch 27923320 (Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018)):
Installed in the binary registry and the SQL registry
Patch 28440711 (Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)):
Not installed in the binary or the SQL registry
Bundle series DBBP:
ID 180717 in the binary registry and ID 181016 in the SQL registry

Adding patches to installation queue and performing prereq checks...


Installation queue:
The following patches will be rolled back:
28259867 (DATABASE BUNDLE PATCH 12.1.0.2.181016)
Nothing to apply

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

Validating logfiles...
Patch 28259867 rollback: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28259867/22499948/28259867_rollback_PROD_2018Dec09_16_08_00.log (no errors)
SQL Patching tool complete on Sun Dec 9 16:09:55 2018

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 13/14
1/17/2020 Oracle Configuration : Apply a Database Bundle Patch - Robs_Wiki

Step 5 Check the database rollback

SQL> @admin_patch_info.sql

Step 6 Restart the listener

$ lsnrctl start listener_PROD

Supplement 3 Restore at the OS level


If for some reason the patching errored out and you can’t invoke opatch to perform the rollback you can proceed as follows:

$ cd /u01/app/oracle/product/12.1.0/PROD/.patch_storage/NApply/2018-12-06_11-42-16AM
$ /restore.sh
This script is going to restore the Oracle Home to the previous state.
It does not perform any of the following:
- Running init/pre/post scripts
- Oracle binary re-link
- Customized steps performed manually by user
Please use this script with supervision from Oracle Technical Support.
About to modify Oracle Home( /u01/app/oracle/product/12.1.0/TSTDB )
Do you want to proceed? [Y/N]
Y
User responded with : Y
Restore script completed.

Retrieved from "http://rob.lasonder.org/index.php?


title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch&oldid=1589"

This page was last modified on 10 December 2018, at 22:27.

rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 14/14

You might also like