Professional Documents
Culture Documents
Apply A Database Bundle Patch Robs - Wiki
Apply A Database Bundle Patch 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.
I downloaded the patch and staged the patch in: /rman/Software/Patches>cd CPU_20181016_Oracle
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>
|
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.
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:
VERSION STATUS
------------------------------ -----------
12.1.0.2.0 VALID
Step 6 Check and save the current Oracle database registry information
SQL> @admin_patch_info.sql
$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951
$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./26983807
PREREQ session
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
OPatch succeeded.
First create the file that will be used for the space check:
PREREQ session
OPatch succeeded.
$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28440711
PREREQ session
OPatch succeeded.
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
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
. . .
. . .
Skip patching component oracle.rdbms.dbscripts, 12.1.0.2.0 and its actions.
The actions are reported here, but are not performed.
OPatch succeeded.
$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28349951/28259867
$ $ORACLE_HOME/OPatch/opatch apply
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/PROD')
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...
OPatch succeeded.
$ $ORACLE_HOME/OPatch/opatch lsinventory
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.
Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done
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.
SQL> @admin_patch_info.sql
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
. . .
. . .
Skip patching component oracle.dbjava.jdbc, 12.1.0.2.0 and its actions..
The actions are reported here, but are not performed.
OPatch succeeded.
$ cd /rman/Software/Patches/CPU_20181016_Oracle/28689151/28440711
$ opatch apply
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/PROD')
OPatch succeeded.
$ $ORACLE_HOME/OPatch/opatch lsinventory
. . .
Interim patches (3) :
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
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.
Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done
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
SQL> @admin_patch_info.sql
Step 7 Restart the database in NORMAL mode and restart the listener
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
$ sqlplus / as sysdba
SQL> shutdown immediate
SQL> exit
$ lsnrctl stop listener_PROD
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/PROD')
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
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
$ 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.
Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done
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
SQL> @admin_patch_info.sql
Step 6 Restart the database in the normal mode and the listener
$ sqlplus / as sysdba
SQL> shutdown immediate
SQL> exit
$ lsnrctl stop listener_PROD
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/LOADDEV')
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...
OPatch succeeded.
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
$ 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.
Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done
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
SQL> @admin_patch_info.sql
$ 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.
rob.lasonder.org/index.php?title=Oracle_Configuration_:_Apply_a_Database_Bundle_Patch 14/14