Database Performance After Patching or Upgrade can sometimes take a hit — even when the update was supposed to improve stability and speed.
You install the latest Oracle patch or upgrade to a new version, but suddenly things slow down. Reports lag, queries consume more CPU, and users start asking:
“What changed? It was faster before!”
This is one of the most common DBA challenges — and the good news is, it’s fixable.
Let’s explore why performance drops after a patch or upgrade and how to diagnose and restore it step-by-step using real-world Oracle DBA techniques.
Why Performance Drops After a Patch or Upgrade
Here are the most common reasons DBAs encounter slowdowns post-upgrade or patch:
- Optimizer changes:
Oracle’s cost-based optimizer evolves with each release — new algorithms, hints, and plan evaluation methods can generate different execution plans. - Outdated or incompatible statistics:
After a patch or upgrade, statistics may no longer match the optimizer’s expectations, leading to bad plan choices. - Plan baselines invalidated:
SQL Plan Baselines from an earlier version might not migrate properly or may need manual reloading. - Parameter changes or defaults reset:
Some initialization parameters can reset to default values during upgrade. - Environment mismatches:
Hidden differences between test and production (optimizer features, memory settings, indexes) often cause surprises post-deployment.
Step-by-Step Troubleshooting Guide
Let’s take a practical approach to get your performance back on track.
Step 1: Identify Performance Regression Scope
Determine whether the issue is:
- System-wide (CPU, I/O, waits high)
- SQL-specific (certain queries slow)
- Module-specific (e.g., one app or report only)
Run an AWR or ASH report for before and after the patch window.
Look at:
- “Top SQL by Elapsed Time”
- “Top Timed Events”
- “Load Profile”
👉 If one SQL suddenly jumps to the top — that’s your starting point.
Step 2: Compare Execution Plans Before and After
Use Automatic Workload Repository (AWR) or SQL Plan Management (SPM) to compare old vs. new execution plans.
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID', NULL, NULL, 'ALLSTATS LAST'));
If the plan hash value has changed after the patch — that’s a clue.
To see plan changes over time:
SELECT sql_id, plan_hash_value, executions, last_active_time
FROM dba_hist_sqlstat
WHERE sql_id='&SQL_ID';
Step 3: Check Optimizer Parameters and Version
Sometimes, patches change the optimizer behavior subtly.
Run this to confirm optimizer compatibility level:
SHOW PARAMETER optimizer_features_enable;
If it changed (for example, from 19.1.0 to 23.1.0), you can temporarily test old behavior:
ALTER SESSION SET optimizer_features_enable='19.1.0';
If performance improves — your issue is optimizer-driven.
Step 4: Use SQL Plan Baselines to Lock Old Plans
If a query performs well before the patch but poorly afterward, use SQL Plan Baselines to force the old plan.
BEGIN
DBMS_SPM.LOAD_PLANS_FROM_AWR(
begin_snap => 1001,
end_snap => 1002,
basic_filter => 'sql_id = ''&SQL_ID'''
);
END;
/
Then fix the good plan as the default baseline:
ALTER SQL PLAN BASELINE 'SQL_PLAN_XXXXXXX' ENABLED = TRUE;
ALTER SQL PLAN BASELINE 'SQL_PLAN_XXXXXXX' FIXED = TRUE;
💡 Tip: Always capture AWR snapshots before patching — they’re your safety net.
Step 5: Validate and Refresh Statistics
After an upgrade, stale or outdated statistics can throw the optimizer off.
EXEC DBMS_STATS.GATHER_DATABASE_STATS(estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE, cascade=>TRUE);
If performance still drops, compare statistics:
SELECT table_name, last_analyzed FROM dba_tables WHERE owner='HR' ORDER BY last_analyzed DESC;
Sometimes refreshing just one schema’s stats restores the old performance balance.
Step 6: Check for Parameter Changes
Compare key parameters before and after the patch using AWR:
SELECT name, value
FROM dba_hist_parameter
WHERE name IN ('pga_aggregate_target', 'sga_target', 'optimizer_mode')
ORDER BY snapshot_id DESC;
If memory or optimizer-related parameters changed, revert and retest.
Step 7: Check Wait Events and OS Metrics
Use AWR or v$system_event to identify bottlenecks:
- CPU waits → Tune SQLs or adjust optimizer plans.
- I/O waits → Recheck ASM or storage performance.
- “Cursor: pin S wait” → Check parsing and shared pool usage.
At the OS level:
top, vmstat, iostat -x 2 5
ee if patch processes increased background workload (e.g., new threads or processes).
Example: Real Case from the Field
After upgrading a 19c database to Oracle 23ai, a financial reporting system slowed down drastically.
AWR comparison showed a plan hash change for one SQL — it was no longer using the materialized view index.
Using SQL Plan Baseline from pre-upgrade AWR restored the old plan immediately:
EXEC DBMS_SPM.LOAD_PLANS_FROM_AWR(begin_snap=>7021, end_snap=>7022, basic_filter=>'sql_id=''1v5c0qxn6n5wz''');
The result? Query performance dropped from 28 seconds to 4 seconds — back to normal.
Best Practices to Prevent Post-Patch Slowdowns
- Always take AWR snapshots before patching.
- Save SQL Plan Baselines for critical queries.
- Keep test and production environments identical in optimizer settings.
- Regather statistics immediately after upgrade.
- Use SQL Plan Management (SPM) to preserve performance stability.
- Document all parameter differences between versions.
Related Articles
- Oracle Grid Infrastructure 19c Restart Home Installation — Complete Step-by-Step Guide
- How To Download And Install The Latest OPatch
- How to Fix “ORA-01111: Name for Data File Is Unknown” in Oracle Standby Databases
Final Thoughts
Performance issues after patching or upgrading don’t mean the patch was “bad” — it usually means something changed underneath: plans, stats, or optimizer behavior.
With careful AWR comparisons, SPM usage, and parameter validation, you can restore and even improve performance beyond pre-upgrade levels.
The best DBAs aren’t the ones who avoid changes — they’re the ones who control and optimize them.



