Practice - Upgrading Oracle Grid Infrastructure P a g e |1
Practice
Upgrading Oracle Grid Infrastructure
Practice Target
In this practice, you will upgrade the Oracle Grid Infrastructure configured in srv1-asm from 19c to
21c.
Assumption
The practice assumes that you have srv1-asm in VirtualBox up and running.
Reference
The reference for upgrading Oracle Grid Infrastructure is the following documentation:
"Grid Infrastructure Installation and Upgrade Guide"
Introduction
AutoUpgrade upgrades Oracle databases but not Oracle Grid Infrastructure. If Oracle databases is
running in a system with Oracle Grid Infrastructure (as is the case with Oracle Restart, RAC, and RAC
One Node), and you want to upgrade the entire system, you need to upgrade the Grid Infrastructure
first then upgrade the database. You learnt in the previous lecture about upgrading Oracle databases.
In this lecture, you will learn about upgrading the Oracle Gird Infrastructure.
Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka
Practice - Upgrading Oracle Grid Infrastructure P a g e |2
Upgrading Oracle Grid Infrastructure
In this section of the practice, you will perform upgrade Oracle Grid Infrastructure in srv1-asm from
release 19c to 21c.
1. Download Oracle Grid Infrastructure 21c software for Linux x86-64. You can download it from
this link or this link. The file name is LINUX.X64_213000_grid_home.zip and its size is nearly
2.3G.
2. Copy or move the downloaded file to the sharing folder.
3. In OracleVritualBox, create a snapshot for the srv1-asm. Give it a name like "before upgrading
to 21c"
4. Open Putty and login to srv1 as grid
su - grid
5. Create Oracle new grid home directory.
mkdir -p /u01/app/21.0.0/grid
6. Extract the installation zip file into the new Oracle grid home directory.
unzip /media/sf_staging/LINUX.X64_213000_grid_home.zip -d /u01/app/21.0.0/grid
>/dev/null
7. Change the current directory to the new Grid home.
cd /u01/app/21.0.0/grid/
8. Run the following command to verify that the system is ready for upgrading.
The runcluvfy.sh script is called CVU. We use it over here to verify that all the requirements for
upgrade apply in our environment.
The utility should report only one issue. That is about the insufficient Physical Memory in the
system. In our case, we can ignore this issue because it requires 8G RAM and the amount of
memory seen by the system is very close to this figure. The utility should not report another
issue in our case.
./runcluvfy.sh stage -pre crsinst -upgrade -rolling -src_crshome
/u01/app/19.0.0/grid -dest_crshome /u01/app/21.0.0/grid -dest_version 21.0.0.0.0
-fixup -verbose
Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka
Practice - Upgrading Oracle Grid Infrastructure P a g e |3
As the Grid Infrastructure is ready for the upgrade, we need to shut down the databases that are
registered in the Grid Infrastructure software. Observe that we shut down the database but not the
Grid resources.
9. Shutdown the database.
srvctl stop database -d oradb -o immediate
10. In the VirtualBox window of the vm, login to the vm as grid user. Open a terminal window.
11. Unset the Grid environment variables.
unset ORACLE_HOME
unset ORACLE_BASE
unset ORACLE_SID
12. Run the installer from the new Grid home directory.
cd /u01/app/21.0.0/grid
./gridSetup.sh
13. Respond to the installer as follows:
Window Response
Configuration Option Upgrade Oracle Grid Infrastructure
Management Options Click on Next button
Installation Location The shown base and home directories should be correct.
Click on Next button
Root Script Execution Mark the checkbox "Automatically Run Configuration Scripts"
Enter the root password
Prerequisites Checks It should complain about the memory size only.
Mark the checkbox "Ignore All" and click on Next button
Summary click on Submit button
Install Product At 11%, you will prompted to run root scripts, click on Yes button
Finish Click on Close button
14. Verify the Clusterware resources are online.
crsctl status resource -t
Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka
Practice - Upgrading Oracle Grid Infrastructure P a g e |4
Now the Grid Infrastructure is upgraded and running. We need to take some post-upgrade actions.
15. Open the .bash_profile file and fix the ORACLE_HOME value variable in it.
vi ~/.bash_profile
export ORACLE_HOME=/u01/app/21.0.0/grid
16. Source the .bash_profile file so that the changes take effect.
source ~/.bash_profile
# to verify:
echo $ORACLE_HOME
17. As the old Gird Infrastructure is no longer needed, we can detach it from the Oracle Inventory
file. Run the following command to achieve this task.
$ORACLE_HOME/oui/bin/runInstaller -detachHome -silent
ORACLE_HOME=/u01/app/19.0.0/grid
# verify:
cat /u01/app/oraInventory/ContentsXML/inventory.xml |grep grid
18. Upgrade the COMPATIBLE attribute of the disk groups to 21.
sqlplus / as sysasm
ALTER DISKGROUP data SET ATTRIBUTE 'compatible.asm' = '21.0.0.0.0';
ALTER DISKGROUP ocrdisk SET ATTRIBUTE 'compatible.asm' = '21.0.0.0.0';
Now the Grid Infrastructure is fully upgraded. Technically speaking, we do not have to upgrade Oracle
database. It should work fine with the upgraded version of Grid Infrastructure. However, Oracle
recommends to have the same release and patch release numbers for both the database and the Grid
Infrastructure.
19. Start the database.
The database should successfully start.
srvctl start database -d oradb
After upgrading the Grid Infrastructure, we can now proceed with upgrading the Oracle database using
the same procedure that you learnt in the previous lecture. You can go ahead and implement the
database upgrade or stop this practice at this stage.
20. Shutdown the vm
21. Restore the vm from the snapshot taken in the beginning of the lecture. Delete the snapshot
afterwards.
Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka
Practice - Upgrading Oracle Grid Infrastructure P a g e |5
Summary
Oracle Grid Infrastructure can be upgraded using the installer itself. The procedure is easy and
straightforward.
Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka