0% found this document useful (0 votes)
75 views6 pages

Practice - Applying RU Patches On Oracle Restart

This document outlines the process of applying Release Update (RU) patches on Oracle databases configured with Oracle Restart. Key steps include upgrading the OPatch utility, decompressing patch files, and using the opatchauto utility to apply the patches without shutting down services. The practice assumes an Oracle database with ASM is available in Oracle VirtualBox and provides detailed instructions for each step involved in the patching process.

Uploaded by

石泽森
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views6 pages

Practice - Applying RU Patches On Oracle Restart

This document outlines the process of applying Release Update (RU) patches on Oracle databases configured with Oracle Restart. Key steps include upgrading the OPatch utility, decompressing patch files, and using the opatchauto utility to apply the patches without shutting down services. The practice assumes an Oracle database with ASM is available in Oracle VirtualBox and provides detailed instructions for each step involved in the patching process.

Uploaded by

石泽森
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Practice - Applying RU Patches on Oracle Databases with Oracle Restart P a g e |1

Practice

Applying RU Patches on Oracle Databases with


Oracle Restart Configuration

Practice Target
In this practice, you will apply a Release Update (RU) patch on the Oracle database with ASM.

In high level, you will perform the following:


o Upgrade OPatch utility in database and Grid homes
o Apply RU on the database and Grid Homes

Assumption
The practice assumes that the Oracle database with ASM is available in Oracle VirtualBox. In Oracle
VirtualBox, you named the machine as srv1-asm.

Note: When Oracle Grid Infrastructure is installed with a standalone Oracle database, this
configuration is called Oracle Restart.

About Applying Patches on Oracle Restart Configuration


With Oracle Restart Configuration, Oracle database needs to communicate with Oracle grid
infrastructure. This is similar to RAC configuration. That is why there are similarities between the
applying patching on Oracle Restart configuration and Oracle RAC.

The easiest tool to apply patches on Oracle Restart is to use opatchauto utility. This utility automates
applying the patch on both the Grid Infrastructure home and the database home. This obviously
simplifies the procedure to apply patches on an Oracle Restart configuration.

The most important requirement for this utility is to have the GI home and the database home of the
same version.

Also, the user who should invoke this utility is the root user (it is not oracle, nor grid).

The utility does not require to shutdown the database or the grid resources. It automatically shuts
down the services and start them up on the right time.

Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka


Practice - Applying RU Patches on Oracle Databases with Oracle Restart P a g e |2

Upgrading OPatch Utility in Database and Grid Homes


In this section of the practice, you will upgrade the OPatch utility to its most recent version in Oracle
database and grid homes.

1. In Oracle VirtualBox, take a snapshot for the vm.

2. Open Putty and login to srv1 as root

3. As oracle, retrieve the current OPatch version


su - oracle
$ORACLE_HOME/OPatch/opatch version

4. Copy the OPatch upgrade patch to the sharing folder.


You downloaded the file in an earlier practice. If you lost it, you can download it from this link.
The file name is p6880880_190000_Linux-x86-64.zip

5. Upgrade OPatch in Oracle database home.


rm -fr $ORACLE_HOME/OPatch/*
unzip /media/sf_staging/p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch version
# the following command should succeed:
$ORACLE_HOME/OPatch/opatch lsinventory

6. Change the current user to grid


exit
su – grid

7. Upgrade OPatch in grid home.


rm -fr $ORACLE_HOME/OPatch/*
unzip /media/sf_staging/p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch version
# the following command should succeed:
$ORACLE_HOME/OPatch/opatch lsinventory

8. Exit from grid shell so that the current user becomes root
exit

Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka


Practice - Applying RU Patches on Oracle Databases with Oracle Restart P a g e |3

Applying RU on the Database and Grid Homes


In this section of the practice, you will apply RU 16 patch on both the grid and database homes.

9. Download the GI Release Update 19.16.0.0.220719 from Oracle support or link. Its size is nearly
2.7G. The file name is p34130714_190000_Linux-x86-64.zip

10. Copy or move the downloaded file to the staging directory.

11. In the Putty session, create a staging directory to extract the patch files into it.
mkdir /media/sf_staging/patch

12. Decompress the RU file into the patching staging directory.


unzip /media/sf_staging/p34130714_190000_Linux-x86-64.zip -d
/media/sf_staging/patch >/dev/null

13. Open the README.html file in the patch directory in your favorite browser.
Consider the section "Patch Numbers Installed as Part of this Bundle Patch". Observe the
following:
o The RU is composed of 5 patches. One for the database only, one for both the database and
the grid, and three for grid home only.
o The database RU is the same RU that we applied earlier in the course on the non-ASM
database. This means, after we apply this RU on the database home, there is no need to apply
the same RU again on the database home.
/media/sf_staging/patch/34130714/README.html

14. Check the sub-directories under the staging patch location.


You must see 5 directories matching the sub-patches included in this patch.
ls -al /media/sf_staging/patch/34130714/

Because we have a few patches to apply on the system, lets check if we have free space to apply all
those patches.

15. As grid, create the file patch_list_gihome.txt as follows.


su – grid

cat << EOF > /tmp/patch_list_gihome.txt


/media/sf_staging/patch/34130714/34133642
/media/sf_staging/patch/34130714/34160635
/media/sf_staging/patch/34130714/34139601
/media/sf_staging/patch/34130714/34318175
/media/sf_staging/patch/34130714/33575402
EOF

Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka


Practice - Applying RU Patches on Oracle Databases with Oracle Restart P a g e |4

16. Run the OPatch command to check if enough free space is available to apply the patches on the
grid home.
If the command passed the check, this means we have enough free space to apply the patches
on the grid home.
/u01/app/19.0.0/grid/OPatch/opatch prereq CheckSystemSpace -phBaseFile
/tmp/patch_list_gihome.txt

17. Verify that the database is up and running.


opatchauto script automatically shuts down any up and running services running from Oracle
homes.
ps -ef | grep pmong

18. In the README.HTML file, refer to the section "6 Patch Installation". Observe that for the
instructions to apply the patches on an Oracle Restart configuration, it asks to refer to MOS note
2246888.1. In that note, you need to refer to section "Case 4: Patching Oracle Restart
Home".

19. Exit from the current user shell so that the current user becomes the root
exit

20. Add the OPatch path in the GI grid to the PATH variable.
export PATH=$PATH:/u01/app/19.0.0/grid/OPatch

21. Check for patch conflicts.


This command checks for any conflicts between the patch and any one-off applied patches. The
apply command should succeed.
cd /media/sf_staging/patch/34130714
opatchauto apply -analyze

22. Apply the RU patches using the opatchauto command.


opatchauto apply

If Opatch fails, it stops with error and saves details about the error in a log file. If this happens to
you, consider performing the following:
a. Look into the log file reported by the Opatch.
b. Fix the root cause of the reported issue.
c. Resume the Opatch using the following command:
opatchauto apply resume

23. Verify the RU patch is fully installed.


su - oracle

Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka


Practice - Applying RU Patches on Oracle Databases with Oracle Restart P a g e |5

$ORACLE_HOME/OPatch/opatch lsinventory | grep "Database Release Update"


exit

su - grid
# those are the patch numbers applied by the RU
$ORACLE_HOME/OPatch/opatch lsinventory | grep 34160635
$ORACLE_HOME/OPatch/opatch lsinventory | grep 34139601
$ORACLE_HOME/OPatch/opatch lsinventory | grep 34318175
$ORACLE_HOME/OPatch/opatch lsinventory | grep 33575402
exit

24. Run the following query to retrieve the patches applied on the database.
su - oracle
sqlplus / as sysdba

set linesize 180


col DESCRIPTION for a20
col STATUS for a10

SELECT INSTALL_ID, PATCH_ID, PATCH_TYPE, STATUS, SOURCE_BUILD_DESCRIPTION


DESCRIPTION
FROM DBA_REGISTRY_SQLPATCH
ORDER BY INSTALL_ID DESC ;

quit

Note: Observe that the RU does not apply the RU patch on the OJVM. If you want to apply a RU on
OJVM, refer to the designated practice.

Cleanup

25. Delete the RU installation files from the sharing folder.

26. Shutdown the srv1.

27. In Oracle VirtualBox, delete the existing snapshot.

28. Delete the RU staging files:


rm -fr /media/sf_staging/patch

Note: Do not delete the vm. You will need it for a future practice.

Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka


Practice - Applying RU Patches on Oracle Databases with Oracle Restart P a g e |6

Summary
In high level, applying RU patches on Oracle Restart, involve the following steps:
o Decompressing the patch files into staging directories
o Preparing the environment for applying the patches
o Applying the patches to update GI and Oracle database homes using opatchauto utility

Oracle Database Administration from Zero to Hero, a course by Ahmed Baraka

You might also like