0 Votes

Patching

Last modified by Jeff McDonald on 2024/05/14 11:02

Tips on patching Oracle Database...

Download the Latest OPatch

It never hurts to download and install the latest version of OPatch from Oracle:

https://updates.oracle.com/download/6880880.html

To install, simply unzip and replace the existing OPatch directory.

mv $ORACLE_HOME/OPatch ~/OPatchBackup
unzip p6880880_180000_Linux-x86-64.zip -d $ORACLE_HOME

Cleanup Old Patches

To make room for the new patches, let's remove any old, inactive ones.

Determine size of old patches:

$ du -sh $ORACLE_HOME/.patch_storage
3.1G /ora/app/oracle/database/19c/.patch_storage

Delete inactive patches: 

./opatch util deleteiactivepatches

Perform cleanup (of OPatch itself):

opatch util cleanup

Determine size saved:

$ du -sh $ORACLE_HOME/.patch_storage
2.0G /ora/app/oracle/database/19c/.patch_storage

Download Database Patches

Login to Oracle Support.

Select what you think is the correct patch.

Before downloading, click the "Aanalyze for Conflict..." button.

Upload the "inventory text file", which is generated by:

opatch lsinventory

If all is good, use the WGET Options instead of downloading to your desktop.

WGET Options

To download the patches directly to the server, use the WGET Options generated script:

chmod +x wget.sh
./wget.sh

Enter support.oracle.com username.

Enter password (no prompt for password).

If it appears to hang, it's downloading. You can tail on the generated log file to verify.

Apply the Patches

Unzip the downloaded patch.

Stop the database.

CD into the unzipped patch folder (more patches inside).

Apply each patch individually:

opatch apply 31305087

Start the database.