When you use the patching functionality in the cloud tooling, it will patch an entire Oracle home, including all databases, using in-place patching. This is a convenient option, but it extends the maintenance window on your database.
Let’s find out how to do it using out-of-place patching!
Benefits of Out-Of-Place Patching
You can patch the database with less downtime. You just shut down the database in the old Oracle home and immediately restart it in the new Oracle home.
With in-place patching, you need more downtime. While the database is down, you need time to roll off patches and apply the new ones. Depending on the number of patches you have, this can take 5, 10, or 20 minutes.
You prepare the new Oracle home in advance.
With in-place patching, all changes to the Oracle home occur during the maintenance window when the database is down.
There are fewer tasks in your downtime window, so less risk and less stress.
You can use a fresh, brand-new Oracle home to avoid issues with rolling off patches. Plus, a brand-new Oracle home means you don’t carry any old luggage in your Oracle home.
With in-place patching, your Oracle home will grow over time. You’ll see that disk space keeps increasing.
In the unlikely event that you need to roll back or fall back, that’s a lot easier. You just restart the database in the old Oracle home.
With in-place patching, you have to reverse the entire process. So, all that was cumbersome when you patched will be cumbersome when you roll back.
AutoUpgrade
In the workshop, I showed some cool demos of using AutoUpgrade for out-of-place patching. You can’t do that on Exadata Cloud@Customer. You must use the cloud tooling when you patch an entire CDB.
Alternatively, you can patch an individual PDB using AutoUpgrade and refreshable clone PDBs. I’ll have to write a blog post about that.
How to Patch Out-Of-Place on Exadata Cloud@Customer
Create a software image at the desired Release Update with any additional one-off patches. You can skip this if you want to use the Oracle-provided images.
Create a database home using the software image you just created, or use an Oracle-provided one.
If you want to script the process, you can also use the REST APIs or dbaascli.
This also works for Exadata Database Service.
There’s no way to use out-of-place patching on Grid Infrastructure.
Happy patching!
Appendix
Other Methods
You are free to use Exadata Fleet Update for your Exadata Cloud@Customer system. It can greatly reduce your workload and automate your patching operations. Check out these resources:
When you upgrade a PDB to Oracle Database 23ai, there is a new method for performing the upgrade. It’s called Replay Upgrade.
I would call it a convenience feature. You simply plug in to a higher release CDB and open the PDB. The CDB detects the lower-release PDB and performs the upgrade. You don’t have to invoke AutoUpgrade.
Here’s how to do it.
A Few Words on Replay Upgrade
In Oracle Database 23ai, you can upgrade the data dictionary in two ways:
Parallel Upgrade – Has been around for quite a few releases. It’s what you’ve used before and can still use.
Replay Upgrade – The new thing that enables you to upgrade the data dictionary by simplying plugging in a lower-release PDB and allowing the CDB to perform the upgrade – without using AutoUpgrade.
I suggest you watch this video about the fundamental differences between the two methods.
AutoUpgrade uses Parallel Upgrade. You can force AutoUpgrade to use Replay Upgrade in your config file:
upg1.replay=yes
How To Upgrade Using Replay Upgrade
You must perform the pre-upgrade tasks while the PDB is in the lower-release CDB.
One of such tasks is to analyze the PDB for upgrade readiness:
java -jar autoupgrade.jar ... -mode analyze
If needed, run the pre-upgrade fixups:
java -jar autoupgrade.jar ... -mode fixups
Plug in a lower-release PDB into a higher-release CDB. It doesn’t matter whether you plugged in from a manifest file, using refreshable clone PDBs or any other method.
Open the PDB:
alter pluggable database PDB1 open;
When you open the PDB in normal mode, Replay Upgrade starts.
The open command doesn’t complete until the upgrade completes. The command is not hanging; it’s simply upgrading in the background.
If you open the PDB in upgrade mode, Replay Upgrade does not start.
During the open command, you can see in the alert log that the CDB upgrades the PDB:
2025-03-31T14:02:37.955470+00:00
ORANGE(6):Starting Upgrade on PDB Open
When the open command completes, the PDB will be upgraded. But it will open in restricted mode until you run Datapatch. From alert.log:
ORANGE(6) Error Violation: SQL Patch, Cause: '23.5.0.24.07 Release_Update2407102158' is installed in the CDB but no release updates are installed in the PDB, Action: Call datapatch to install in the PDB or the CDB
2025-03-31T14:11:03.803899+00:00
ORANGE(6):Opening pdb with no Resource Manager plan active
Violations: Type: 1, Count: 1
Completed: Pluggable database ORANGE opened read write
Completed: alter pluggable database orange open
Run Datapatch:
$ORACLE_HOME/OPatch/datapatch -pdbs PDB1
Restart the PDB to remove restricted mode:
alter pluggable database PDB1 close immediate;
alter pluggable database PDB1 open;
You can still perform a Replay Upgrade if you want. I’ve created instructions in the appendix that you can use. The lab takes 15 minutes to complete.
My Database Is A Non-CDB
Replay Upgrade performs an upgrade-on-open. Interestingly, it can also perform a convert-on-open. The latter will run the same commands you’ll find in noncdb_to_pdb.sql, which you normally run to convert a non-CDB to a PDB.
So, you can simply plug a 19c non-CDB into a 23ai CDB. When you open the PDB, the CDB upgrades and converts to a PDB.
My Recommendation
I recommend using AutoUpgrade. It ensures that you run all the tasks and automates them completely, giving you the safest upgrade.
Replay Upgrade does look a lot easier at first glance, but you still need to remember all the pre-upgrade and post-upgrade tasks. When there’s something you must run manually, there’s always the risk that you forget one or two of the tasks.
For me, Replay Upgrade is a convenience feature you can use in a lab or demo environment or if you think it’s easier to incorporate in your automation. But even with automation, you can still use AutoUpgrade with the -noconsole command line option.
But the choice is yours.
Happy upgrading!
Appendix
Replay Upgrade Queries and Commands
Here’s how you can tell whether Replay Upgrade (Upgrade on Open and Convert On Open) is enabled:
select property_name, property_value
from database_properties
where property_name like '%OPEN%';
You can set the property in the root container and in the PDB.
Here’s how to disable Replay Update:
alter database upgrade sync off;
Hands-On Lab
Here are the instructions for trying a Replay Upgrade in our Hands-On Lab.
The below steps perform a Replay Upgrade of the ORANGE PDB from CDB19 to CDB23.
. cdb19
sqlplus / as sysdba<<EOF
alter pluggable database ORANGE close;
alter pluggable database ORANGE unplug into '/home/oracle/orange.xml';
drop pluggable database ORANGE keep datafiles;
EOF
Plug into the 23ai CDB and open ORANGE:
. cdb23
env | grep ORA
sqlplus / as sysdba<<EOF
set timing on
create pluggable database ORANGE using '/home/oracle/orange.xml' nocopy;
alter pluggable database orange open;
EOF
The open command upgrades the PDB. The command runs for several minutes.
In the end, the command completes but prints Warning: PDB altered with errors.
Run Datapatch on the ORANGE PDB:
$ORACLE_HOME/OPatch/datapatch -pdbs ORANGE
Restart ORANGE:
sqlplus / as sysdba<<EOF
alter pluggable database orange close;
alter pluggable database orange open;
select open_mode, restricted from v\$pdbs where name='ORANGE';
EOF
The PDB now opens normally (READ WRITE) and unrestricted.
sqlplus / as sysdba<<EOF
select open_mode, restricted from v\$pdbs where name='ORANGE';
alter session set container=ORANGE;
select version_full from v\$instance;
EOF
Running Oracle Database on Microsoft Windows is slightly different from running it on other platforms. So, of course, patching Oracle Database is also slightly different.
The Oracle Database runs as a Windows service. AutoUpgrade must re-create the service when you perform out-of-place patching so the service starts oracle.exe from the new Oracle home.
To recreate the service, you must specify the credentials of the user who runs the service. Windows allows you to store the credentials in a special file; AutoUpgrade can use that when it recreates the service.
For security purposes, AutoUpgrades deletes the credential file when it is no longer needed. For automation, however, that’s impractical because you would need to recreate the credential file every time you patch or upgrade.
AutoUpgrade now allows you to keep the file and reuse it. To do so, use the config file parameter delete_credential_file.
Staying even more up-to-date with Monthly Recommended Patches (MRP) is now easier when patching using AutoUpgrade.
MRP contains fixes from 555.1 conveniently bundled together in a single patch.
> To provide customers more frequent access to recommended and well-tested collections of patches, Oracle is pleased to introduce Monthly Recommended Patches (MRPs)
Run AutoUpgrade in analyze, download or deploy mode, and AutoUpgrade gets:
* RECOMMENDED – latest available Release Update, OPatch, Data Pump Bundle Patch and OJVM Bundle Patch
* MRP – latest available MRP matching the Release Update
Optionally, you can add one-off fixes that are not part of the Release Update or MRP:
patch1.patch=RECOMMENDED,MRP,34672698
You can add more one-off fixes using a comma-separated list
The other day, I found myself praising refreshable clone PDBs to a customer (which I often do because it’s a killer feature). They liked the feature too but asked:
> We are concerned about the impact on the source database. When AutoUpgrade connects to the source database and clones the database, can we offload the work to a standby database?
Refreshable clone PDBs can eat up your resources if you don’t constrain the target CDB. So, let’s see what we can do.
Mounted Standby Database
This won’t work, because you must be able to connect to the database via a regular database link. Further, AutoUpgrade and the cloning process must be able to execute queries in the source database, which is not possible on a mounted database.
Open Standby Database / Active Data Guard
What if you stop redo apply and open the standby database? Or if you have Active Data Guard?
In this case, the database would be open in read-only mode, and those queries would work. However, the refreshable clone PDB feature was developed to work in and require a read-write database, so this won’t work either – Not even if you enable automatic redirection of DML operations (ADG_REDIRECT_DML).
Even if this case would work, we wouldn’t recommend it. Because, we recommend that you run analyze and fixups mode on the source database, which wouldn’t be possible on a read-only database.
You could run analyze and fixups on the primary database. But is that really an option? If you’re worried about affecting your primary and want to offload to the standby, would running those commands on the primary be an option?
Snapshot Standby Database
What about a snapshot standby? That’s a read-write database. Let’s give it a try.
Convert the source standby to a snapshot standby:
DGMGRL> convert database '...' to snapshot standby;
The standby must remain a snapshot standby for the entire duration of the job. If you need to switch over or fail over to the standby, you must restart the entire operation.
Ensure the PDB is open on the source standby.
alter pluggable database ... open;
Otherwise, you will run into ORA-03150 when querying the source database over the database link.
In the source standby, create the user used by the database link and grant appropriate permissions:
create user dblinkuser identified by ...;
grant create session, create pluggable database, select_catalog_role to dblinkuser;
grant read on sys.enc$ to dblinkuser;
In the target CDB, create a database link that points to the PDB in source standby:
create database link clonepdb
connect to dblinkuser identified by ...
using '';
Convert the source standby back to a physical standby:
DGMGRL> convert database '...' to physical standby;
Is It Safe?
Using a standby database for anything else than your DR strategy, is sometimes perceived as risky. But it is not, as I explain in this blog post (section What Happens If I Need to Switch Over or Fail Over?).
Oracle just released new Release Updates, so it’s time to patch your Oracle Database again. As much as I love patching, the part about finding and downloading patches is not that much fun.
Luckily, I can use AutoUpgrade to download the Release Update and other patches with just a few commands.
How to Download Release Updates
I can do the following on any computer. I just need Java 8 or 11 to run AutoUpgrade.
I want to download 19.27 Release Update and supporting patches for Linux and I specify that using the platform parameter.
I’ve already used AutoUpgrade to download patches, so my My Oracle Support credentials are already stored in the AutoUpgrade keystore. If you’ve never used AutoUpgrade to download patches, follow the instructions below (see Creating an AutoUpgrade Keystore).
I download the patches by starting AutoUpgrade in download mode:
OPatch 12.2.0.1.46 for DB 19.0.0.0.0 (Apr 2025) – p6880880_190000_Linux-x86-64.zip
Is it really that easy? Yes, it is…
Happy patching!
What About the Other Platforms
At the time of writing, Oracle has only released the Linux patches. Once the other platforms are available, you can easily download them as well. Check the Patch Availability Document for details. Add the following to your config file:
AutoUpgrade prompts for a password to protect its keystore. AutoUpgrade uses the password to encrypt the keystore, which stores my My Oracle Support credentials.
This is not the database keystore password that you use for TDE Tablespace Encryption.
Processing config file ...
Starting AutoUpgrade Patching Password Loader - Type help for available options
Creating new AutoUpgrade Patching keystore - Password required
Enter password:
Enter password again:
I specify my MOS username. AutoUpgrade then prompts me for the MOS password:
MOS> add -user <mos-username-or-email>
Enter your secret/Password:
Re-enter your secret/Password:
I save the changes, and I choose to create an auto-login keystore so I don’t have to enter the AutoUpgrade keystore password every time AutoUpgrade starts:
MOS> save
Convert the AutoUpgrade Patching keystore to auto-login [YES|NO] ? YES
Suppose you need to connect through a proxy server to reach My Oracle Support and get the patches. AutoUpgrade now supports several ways to use a proxy.
Set https_proxy in lowercase. At least on Linux, environment variables are case-sensitive and although some programs can handle any case, it’s better to use the official case.
AutoUpgrade automatically picks up and uses the proxy.
Other Proxy Types
You can set https_proxy to a value matching this specification:
This error message indicates that you forgot to set the https_proxy environment variable or set it correctly:
There were conditions found preventing AutoUpgrade Patching from successfully running
*Downloading Oracle Patch files
Patch query failed
*login-ext.identity.oraclecloud.com*
This error message indicates that your proxy doesn’t allow connections to all the required servers:
There were conditions found preventing AutoUpgrade Patching from successfully running
*Downloading Oracle Patch files
Patch query failed
*Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden"*
Often, you need to make changes to the database or application to fit into an Autonomous Database. In part 2, we show you how to deal with the findings from the Cloud Premigration Advisor Tool (CPAT).
Part 3 is all about demos—demos on how to migrate to Autonomous Database using a number of different techniques.
Finally, how is the life of a DBA after migrating to an Autonomous Database? Is there anything left to do? We think there is, and we’ll show you the cool life of a DBA on an Autonomous Database.
Happy Migrating
We’re looking for customers to collaborate with. If you’re already working on a migration project, contact us today. You might be our next reference customer.
The source database is Oracle Database 19c. They configured AutoUpgrade to upgrade to Oracle Database 23ai using refreshable clone PDBs. However, this test measured only the initial copy of the data files – the CLONEDB stage in AutoUpgrade.
Parallel
Time
Throughput
Source CPU %
Default
269s
3,6 GB/s
3%
Parallel 4
2060
0,47 GB/s
1%
Parallel 8
850
1,14 GB/s
1%
Parallel 16
591
1,65 GB/s
2%
A few observations:
Cloning a 1 TB database in just 5 minutes.
Very little effect on CPU + I/O on source, entirely network-bound.
The throughput could scale almost up to the limit of the network.
By the way, this corresponds with reports we’ve received from other customers.
Learnings
The initial cloning of the database is very fast and efficient.
You should be prepared for the load on the source system. Especially since the network is a shared resource, it might affect other databases on the source system, too.
The target CDB determines the default parallel degree based on its own CPU_COUNT. If the target system is way more powerful than the source, this situation may worsen.
Use the AutoUpgrade config file entry parallel_pdb_creation_clause to select a specific parallel degree. Since the initial copy happens before the downtime, you might want to set it low enough to prevent overloading the source system.
A year and a half ago, Mike Dietrich and I ran the Real World Upgrade and Migrate to Oracle Database 19c and 23ai workshop in Belgium and The Netherlands. Now, we’re returning with…
Advanced Real World Oracle Database Upgrade and Migration to 19c and 23ai
Perhaps not the most creative title for a sequel. But what the title lacks in creativity, we will compensate tenfold in content.
If you’re interested in database tech, Mike and I invite you to join our workshops.
… a day full of technical best practices, tips, tricks and advices based on real world customer experience
The Agenda
Here are the topics that we will cover:
Release Strategy with Oracle Database 19c and 23ai
Oracle Database Patching – We are going to change the game!
New Features in AutoUpgrade
How to size, build and operate a Multitenant environment efficiently
Data Pump – The best new performance features and optimizations
Migrations for hands-on DBAs
Cross-platform migrations – Pushing the limits
Oracle Database 23ai Feature Update for DBAs and Developers
It’s all tech, no marketing!
When and Where
The workshops take place at the Oracle offices in Utrecht and Vilvoorde. We start at 09:00 and finish at 16:30 or when we’ve answered the last question.
The workshops are an in-person event. It’s not possible to join remotely.
Sign Up
The workshops are free, but registration is required.