The other day, I helped a customer with an interesting case:
We have a 19c CDB with 100 PDBs running on old hardware. We need to upgrade and move the PDBs to a new server with Oracle Database 23ai. We would like to move the PDBs in batches.
Here’s how I would do that using AutoUpgrade and refreshable clone PDBs.
How To
- In each PDB, you must create a user that you can use for the database link:
create user dblinkuser identified by dblinkuser; grant create session to dblinkuser; grant select_catalog_role to dblinkuser; grant create pluggable database to dblinkuser; grant read on sys.enc$ to dblinkuser;- Repeat this process for every source PDB.
- In the target CDB, create a database link in the root container for every PDB:
create database link clonepdb1 connect to dblinkuser identified by dblinkuser using 'sourcehost/pdb1';- Repeat this process for each PDB and assign a unique name to the database link.
- Create an AutoUpgrade config that upgrades a batch of the PDBs. In this case, PDBs 1-4:
global.global_log_dir=/home/oracle/logs global.keystore=/home/oracle/keystore upg1.sid=CDB19 upg1.target_cdb=CDB23 upg1.source_home=/u01/app/oracle/product/19 upg1.target_home=/u01/app/oracle/product/23 upg1.pdbs=PDB1,PDB2,PDB3,PDB4 upg1.source_dblink.PDB1=CLONEPDB1 1800 upg1.source_dblink.PDB2=CLONEPDB2 1800 upg1.source_dblink.PDB3=CLONEPDB3 1800 upg1.source_dblink.PDB4=CLONEPDB4 1800 upg1.target_pdb_copy_option.PDB1=FILE_NAME_CONVERT=NONE upg1.target_pdb_copy_option.PDB2=FILE_NAME_CONVERT=NONE upg1.target_pdb_copy_option.PDB3=FILE_NAME_CONVERT=NONE upg1.target_pdb_copy_option.PDB4=FILE_NAME_CONVERT=NONE upg1.target_pdb_name.PDB1=PDBNEW1 upg1.target_pdb_name.PDB2=PDBNEW2 upg1.target_pdb_name.PDB3=PDBNEW3 upg1.target_pdb_name.PDB4=PDBNEW4 upg1.parallel_pdb_creation_clause.PDB1=2 upg1.parallel_pdb_creation_clause.PDB2=2 upg1.parallel_pdb_creation_clause.PDB3=2 upg1.parallel_pdb_creation_clause.PDB4=2 upg1.start_time=01/10/2026 02:30:00- In
source_dblinkyou specify the name of the database link that you previously created. You must assign the right database link to the right PDB. The following number (1800) is the refresh rate in seconds. You can adjust that accordingly. - In this example, you’re using Oracle Managed Files, and
FILE_NAME_CONVERT=NONEallows the target CDB to automatically generate new file names. - I recommend renaming the PDB to avoid any confusion. You can do that with
target_pdb_name. - Also, limit the number of parallel processes that the target CDB can use to copy the PDB over the network. The file copy happens for all PDBs at the same time, so in this case, the target CDB should have at least 8 CPUs. Also, take the resources of the source CDB into consideration.
- In
- Run AutoUpgrade in analyze mode on the source database host. This checks the PDBs for upgrade readiness:
java -jar autoupgrade.jar -config upgrade.cfg -mode analyze - Run AutoUpgrade in deploy mode on the target database host:
java -jar autoupgrade.jar -config upgrade.cfg -mode deploy- The target CDB now starts to copy the PDBs over.
- After that, it periodically refreshes the PDBs with redo from the source database.
- It doesn’t proceed with the actual upgrade.
- Instead, it waits until you reach the time specified by the
start_timeparameter.
- Downtime starts now
- Run AutoUpgrade in fixups mode on the source database host. This runs recommended and required pre-upgrade fixups in the PDBs:
java -jar autoupgrade.jar -config upgrade.cfg -mode fixups - Instruct AutoUpgrade to move on with the upgrade even though the
start_timehasn’t been reached yet:upg> proceed -job <job-number> - AutoUpgrade now performs a final refresh to bring over the latest changes. Then, it upgrades the PDBs concurrently. It will upgrade
CPU_COUNT/2 at the same time. You can tweak that usingcatctl_options. - Be sure to stop the source PDBs that are running in the 19c CDB.
That’s it! You’ve now moved and upgraded the first batch of PDBs. You can repeat the process with the next batch.
In One Batch
Technically, you can put all PDBs into the same configuration file and move/upgrade them all at the same time.
However, you might as well use Data Guard to build a standby database and then perform an upgrade of the entire CDB.
However, if possible, I would recommend moving/upgrading the PDBs in batches.
Final Words
AutoUpgrade and refreshable clones are a perfect match.
What would you recommend? Leave a comment and let me know what you would suggest.

