Oracle DB- Day13
Oracle DB- Day13
Patching and upgrading an Oracle Database are essential activities for maintaining a secure, stable,
and high-performing database environment. Here’s a detailed breakdown of both processes with
practical scenarios.
Oracle provides regular patches to fix bugs, address security vulnerabilities, and enhance database
features. These patches are applied using tools like opatch and opatchauto.
Types of Patches
2. Patch Set Updates (PSUs): Includes critical fixes and security updates.
3. Release Updates (RUs): Includes functional enhancements, fixes, and security patches.
1. Pre-requisites:
$ $ORACLE_HOME/OPatch/opatch version
$ $ORACLE_HOME/OPatch/opatch apply
1
$ $ORACLE_HOME/OPatch/opatch lsinventory
OPatchAuto automates the patching of Oracle Grid Infrastructure (GI) and databases.
1. Pre-requisites:
• Problem: Airline customers report slower response times during ticket booking.
• Solution:
o Download and apply a one-off patch addressing the bug using opatch.
Upgrading involves transitioning to a newer database version to leverage new features and improve
performance.
Upgrade Paths
1. Pre-upgrade Steps:
2
$ORACLE_HOME/jdk/bin/java -jar preupgrd.jar
o Gather Statistics:
EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
o Install 19c Software: Install the Oracle 19c binaries in a new Oracle Home directory.
$ORACLE_HOME/bin/dbua
STARTUP UPGRADE;
@?/rdbms/admin/catctl.pl -n 4 -d . catupgrd.sql
3. Post-upgrade Steps:
o Recompile Objects:
@$ORACLE_HOME/rdbms/admin/utlrp.sql
o Update Compatibility:
• Problem: An airline's booking system uses Oracle 12c, which is nearing the end of support.
• Solution:
o Upgrade the database to 19c to ensure continued support, better security, and
improved query performance.
3
Real-Time Challenges and Solutions
o Use AWR to identify slow queries and resolve them with SQL Tuning Advisor.
Best Practices
1. For Patching:
2. For Upgrading:
By following these detailed steps and addressing potential challenges, you can ensure a smooth
patching or upgrading process for Oracle Databases.