Practice 12 Upgrading Oracle RAC Database
Practice 12 Upgrading Oracle RAC Database
Practice 12
Practice Overview
In this practice, you will upgrade the Oracle RAC database from release 12.1.0.2 to release 12.2.0.1.
Note: In the previous practice you have taken a backup of all the Virtualbox appliance files. If you
have not done that, it is recommended to do it now. Shutdown the appliances and exit Oracle
Virtualbox then take backup of all the virtual appliance files including the shred disk files.
Note: This practice is a long practice. It may take three hours to implement it all.
Note: Do not consider this document as a reference to upgrade a production database. The following
should be your references:
o Oracle Grid Infrastructure Installation and Upgrade Guide 12c Release 2 (12.2) for Linux
o Doc ID 2189854.1: Complete Checklist for Upgrading to Oracle Database 12c Release 2
(12.2) using DBUA
Practice Assumptions
• A database backup has been taken on rac database. You have taken this backup in the previous
practice.
o Oracle Database 12c R2 Grid Infrastructure (12.2.0.1.0) for Linux x86-64 ( link )
2. Add a new fixed-size sharable disk to srv1. Give it the name DISK4 and set its size to 40 GB.
In Oracle VirtualBox, click on srv1 | click on Settings | click on Storage in the right pane | click
on Controller: SATA | click on Add Hardisk | click on Add a New Disk | select VDI option |
make it fixed-size | enter the full-path filename of the disk | set its size to 40 GB
6. Start Putty and login to srv1 as root user. Format the added disk.
10. Scan the ASM disks and make sure DISK4 is seen by srv2.
oracleasm scandisks
oracleasm listdisks
12. Start asmca utility and add DISK4 to the CRS disk group.
Right-click on the CRS disk group | select Add Disks | select DISK4 then click on OK button
You should see the CRS disk group size increased to nearly 50GB, as shown in the following
screenshot:
14. Copy the Oracle 12.2 Grid Infrastructure installation file locally in the shared folder in your
hosting machine.
We mean by the shared folder, the folder that is shared by the Oracle Virtualbox machines and
which you used to install Oracle 12.1 and apply PSU on it.
15. Extract the Oracle 12.2 database installation zip file locally into the shared folder.
In this section of the practice, you will upgrade Oracle Grid Infrastructure. Oracle Grid Infrastructure
supports rolling upgrade. When nodes are being upgraded in a batch, the nodes in the other batches
remain in operation.
Note: In real life scenario, it is recommended to perform RAC check Upgrade Readiness Assessment.
This involves downloading an automated upgrade-specific health check for upgrades to Oracle Grid
Infrastructure from Oracle Support (Doc ID 1457357.1). Because upgrading Grid Infrastructure on the
practice environment has already be tested and for the sake of minimizing the practice time, I have
skipped this step from this practice document.
Note: Oracle Grid Infrastructure upgrade required patch number 21255373. This patch was already
included in the PSU that you applied in the previous lecture.
16. Make sure you have Putty sessions connected to srv1 and srv2 as root.
17. In srv1, create the directory of the new Oracle Grid home. Make grid the owner of the home
directory.
mkdir -p /u01/app/12.2.0/grid
chown grid:oinstall /u01/app/12.2.0/grid
20. Open a terminal window and change the current directory to the directory where the Oracle Grid
Infrastructure installation file was copied.
cd /media/sf_staging/12.2/grid/
[grid@srv1 grid]$ ls
linuxx64_12201_grid_home.zip
21. Unzip the linuxx64_12201_grid_home.zip file to the new Grid home directory.
22. Install the new Oracle Grid Infrastructure software. The procedure that you follow will upgrade
the running Oracle Grid instance.
a) In the terminal window, change the current directory to the new Oracle Grid directory.
cd /u01/app/12.2.0/grid
b) Set the ORACLE_HOME variable to the new Oracle Grid home directory then run gridSetup.sh
export ORACLE_HOME=/u01/app/12.2.0/grid
./gridSetup.sh
c) Follow the installer windows to install and upgrade the Oracle Grid software. Make your
responses to the installer windows are as follows:
Operating System Groups Make sure asmadmin and asmdba are selected.
Root Script execution Mark the check box "Automatically run configuration
scripts"
Enter the root password
Oracle Cluster Verification Just click on OK, Next and Close buttons.
Utility failed
23. In the Putty window, verify the upgrade has been successfully concluded:
/u01/app/12.2.0/grid/bin/crsctl check cluster -all
/u01/app/12.2.0/grid/bin/crsctl query crs activeversion
In this section of the practice, you will install Oracle Database 12.2 software. You will not upgrade the
RAC database yet at this stage.
26. Open a terminal window and change the current directory to the directory where the Oracle
Database installation files were extracted.
cd /media/sf_staging/12.2/database/
27. Set the ORACLE_HOME variable to the new Oracle Database home directory then invoke the OUI
utility.
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1
./runInstaller
28. Follow the installer windows to install the Oracle Database software only. Make your responses to
the installer windows as follows:
Configuration Security Unmark the checkbox " I wish to receive security… "
Updates
Database Installation Options select the option "Oracle Real Application Clusters …"
Operating System Groups Make sure dba is selected as the group for all the
mandatory options
Execute Configuration Scripts Run the configuration scripts as root on srv1 then on
srv2.
29. In the Putty session, switch the current user to oracle then run the Pre-Upgrade Information
Tool (preupgrade.jar) by issuing the following command. This is a single-line command. Make
sure you copy it all before you paste it in the Putty window.
/u01/app/oracle/product/12.1.0/db_1/jdk/bin/java -jar
/u01/app/oracle/product/12.2.0/db_1/rdbms/admin/preupgrade.jar FILE TEXT DIR
/home/oracle/scripts
30. Examine the contents of the generated log file. It included recommendations on the steps to
perform before you start upgrading the database.
sqlplus / as sysdba
@/home/oracle/scripts/preupgrade_fixups.sql
32. Gather the optimizer statistics on the dictionary objects. Run the following command as sys user.
This is recommended action to reduce the upgrade time.
EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
In this section of the practice, you will use the DBUA to upgrade rac database to release 12.2.
35. In the VirtualBox window of srv1, make sure you are logged in as oracle user and that you have
a terminal window opened.
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
cd $ORACLE_HOME/bin
./dbua
Select Recovery Options select "I have my own backup and restore strategy"
When the upgrade finishes (it took one hour in my case), it should display a message like the
following screenshot:
Post-upgrade Tasks
In this section of the practice, you will perform tasks that should be performed after the upgrade is
finished.
38. In the Putty window, switch current user to oracle and fix the ORACLE_HOME variable setting in
.bash_profile.
vi .bash_profile
...
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1; export ORACLE_HOME
...
source .bash_profile
40. Test connecting to rac database using the SQL*Plus in the upgraded Oracle home
sqlplus / as sysdba
41. Copy the tnsnames.ora file from the old Oracle home directory to the upgraded Oracle home
directory.
cp /u01/app/oracle/product/12.1.0/db_1/network/admin/*.ora
/u01/app/oracle/product/12.2.0/db_1/network/admin
ssh srv2
# fix the ORACLE_HOME variable setting
vi .bash_profile
exit
43. In srv1 and srv2, switch to grid user and fix the ORACLE_HOME variable settings and copy the
network configuration files.
su - grid
ssh srv2
# perform the same steps.
44. Run rman and delete the archivelog files (just to save the disk space). Plenty of archive logs must
have been generated by the upgrade process.
rman target /
delete archivelog all;
45. Switch the current user to oracle then start SQL*Plus and execute the postupgrade_fixups.sql
script:
su - oracle
sqlplus / as sysdba
@/home/oracle/scripts/postupgrade_fixups.sql
46. While srv1 is still in operation, restart srv2. You will restart the instances just to make sure
everything goes well after upgrade even after restarting the nodes.
47. Wait until srv2 is fully restarted and allow a few minutes for its instance to startup.
50. Wait until srv1 is fully restarted and allow a few minutes for its instance to startup.
52. Delete the existing database rac backupset files and take a new database backup.
# delete existing backup sets (just to avoid running out of free disk space)
rman target /
DELETE BACKUPSET;
# perform backup:
/home/oracle/scripts/rman_script.sh
Summary
• Upgrading an Oracle RAC environment includes upgrading first Oracle Grid Infrastructure and
then upgrading Oracle database.