Let me show you how to upgrade a non-CDB to Oracle AI Database 26ai. Since this release only supports the multitenant architecture, you must also convert it to a PDB.
To preserve the source database for rollback and to minimize downtime, I’ll use AutoUpgrade and refreshable clone PDBs.
How to Upgrade and Convert
AutoUpgrade and refreshable clone PDBs give you the option of moving the database to a different host. If you want to stay on the same host, just imagine source and target hosts are the same.
Start by familiarizing yourself with the restrictions on refreshable clone PDB for non-CDBs.
1. Preparations
I’ve already prepared my database.
I’ve also installed a new Oracle home and created a new CDB, or decided to use an existing one. The CDB can be on the same or a different system than the source non-CDB.
- In the source non-CDB, I create a user:
create user dblinkuser identified by ... ; grant create session, create pluggable database, select_catalog_role to dblinkuser; grant read on sys.enc$ to dblinkuser;- I need the user so I can connect from the CDB via a database link.
- I’ll drop it after the upgrade.
- In my target CDB, I create a database link connecting to my source non-CDB:
create database link clonepdb connect to dblinkuser identified by ... using 'source-db-alias'; - I create a config file on my target system. I call it
upgrade26.cfg:global.global_log_dir=/home/oracle/autoupgrade/upgrade26 upg1.source_home=/u01/app/oracle/product/19 upg1.target_home=/u01/app/oracle/product/26 upg1.sid=FTEX upg1.target_cdb=CDB26 upg1.source_dblink.FTEX=CLONEPDB 1800 upg1.target_pdb_name.FTEX=PDB1 upg1.start_time=19/01/2038 03:14:07 upg1.parallel_pdb_creation_clause.FTEX=2 upg1.target_pdb_copy_option.FTEX=file_name_convert=NONE upg1.drop_dblink=yes- If the source database is on a different system, set
source_hometo/tmp. sidis the database that I want to upgrade and convert.target_cdbis where the database ends up.source_dblink.<sid>is the name of the database link and the refresh rate in seconds.target_pdb_name.<sid>allows me to rename the database. I strongly recommend that you rename the database if your CDB is on the same system. Otherwise, you’ll have a service name collision to deal with.start_timeis when AutoUpgrade performs the final refresh and starts the upgrade/conversion. I set it far out in the future, so I can better control the final refresh using theproceedcommand. Leave a comment if you know what happens at the specified time. :-)parallel_pdb_creation_clause.<sid>limits the number of parallel processes used by the CDB to make the initial copy. Set it at a reasonable level that doesn’t overload the source database.target_pdb_copy_option.<sid>allows me to specify the location of the data files. I use OMF and let the database decide where to put the files.drop_dblinkinstructs AutoUpgrade to drop the database link when it’s no longer needed.
- If the source database is on a different system, set
- I start AutoUpgrade in deploy mode:
java -jar autoupgrade.jar -config upgrade26.cfg -mode deploy- AutoUpgrade copies the data files over the database link.
- Rolls the copies of the data files forward with redo from the source non-CDB.
- There’s no outage. The source database remains open.
- Leave the AutoUpgrade session running.
- Since the session might run for a while, better start it with tmux, screen, or similar.
- Don’t use nohop because you must be able to interact with AutoUpgrade.
- If your session disconnects, just restart AutoUpgrade with the same command.
2. Upgrade And Convert
The maintenance window has started, and users have left the database.
-
I create a new config file on the source system to run the pre-upgrade fixups. I call it
fixups26.cfg:global.global_log_dir=/home/oracle/autoupgrade/fixups26 upg1.source_home=/u01/app/oracle/product/19 upg1.target_home=/u01/app/oracle/product/26 upg1.sid=FTEX- If the
target_homedoesn’t exist because it’s on a remote system, you can usetarget_version=26instead.
- If the
-
I run the pre-upgrade fixups on the source database:
java -jar autoupgrade.jar -config fixups26.cfg -mode fixups -
Next, I switch to the target system. From the AutoUpgrade console, I instruct AutoUpgrade to proceed with the upgrade:
upg> proceed -job 100- AutoUpgrade performs a final refresh.
- Then, it disconnects the PDB from the source.
- Then, starts the upgrade and conversion.
-
While the job progresses, I monitor it:
upg> lsj -a 30- The
-a 30option automatically refreshes the information every 30 seconds. - I can also use
status -job 100 -a 30to get detailed information about a specific job.
- The
-
In the end, AutoUpgrade completes the upgrade:
Job 101 completed ------------------- Final Summary -------------------- Number of databases [ 1 ] Jobs finished [1] Jobs failed [0] Jobs restored [0] Jobs pending [0] Please check the summary report at: /home/oracle/autoupgrade/upgrade26/cfgtoollogs/upgrade/auto/status/status.html /home/oracle/autoupgrade/upgrade26/cfgtoollogs/upgrade/auto/status/status.log- This includes the post-upgrade checks and fixups.
-
I review the Autoupgrade Summary Report. The path is printed to the console:
vi /home/oracle/autoupgrade/upgrade26/cfgtoollogs/upgrade/auto/status/status.log -
I take care of the post-upgrade tasks.
-
I update any profiles or scripts that use the database.
-
I ensure that the source non-CDB is shut down.
- If source non-CDB and target CDB are on the same system, AutoUpgrade stops the source non-CDB. You can override this using the parameter
close_source. - When I’m sure I won’t need the source non-CDB anymore, I can delete it.
- If source non-CDB and target CDB are on the same system, AutoUpgrade stops the source non-CDB. You can override this using the parameter
-
I can remove the database link user:
drop user dblinkuser cascade; -
If you’ve configured Data Guard on your target CDB, you must restore the PDB on all standbys. Check the appendix for details.
That’s It!
With AutoUpgrade, you can easily upgrade your non-CDB and convert it to a PDB. For maximum protection, AutoUpgrade lets me preserve the source non-CDB in case I need to roll back.
Check the other blog posts related to upgrade to Oracle AI Database 26ai.
Happy upgrading!
Appendix
What If I Have Data Guard
Refreshable clone PDB doesn’t propagate fully to the standbys. The plug-in operation happens with deferred recovery.
After plug-in on the primary database, the standbys don’t protect the PDB. You must first restore the PDB to each standby database.
Also, check pages 210-221 in Move to Oracle Database 23ai – Everything you need to know about Oracle Multitenant – part 1.
Draining the Source Non-CDB
When your maintenance window starts, you must kick users off.
In a previous blog post, I gave an idea on how you can do that. Whatever you do, don’t restart the source database. It’ll break the refreshable clone PDB.
What If My Database Is Encrypted
AutoUpgrade fully supports encrypted databases. You must enter the source non-CDB keystore password into the AutoUpgrade keystore. You find the instructions here.
Does It Work Cross-Platform
Refreshable clone PDB does not work for cross-endian migrations (like AIX to Linux), but cross-platform should work fine (like Windows to Linux).
What If My Database Is A RAC Database?
There are no changes to the procedure if you have an Oracle RAC database.
Other Config File Parameters
The config file shown above is a basic one. Let me address some of the additional parameters you can use.
-
timezone_upg: AutoUpgrade upgrades the database time zone file after the actual upgrade. This requires an additional restart of the database and might take significant time if you have lots ofTIMESTAMP WITH TIME ZONEdata. If so, you can postpone the time zone file upgrade or perform it in a more time-efficient manner. -
raise_compatible: If you want to raise the initialization parameterCOMPATIBLEimmediately after the upgrade, you can use this parameter. Don’t use it if you have standby databases, because there’s a specific procedure for raisingCOMPATIBLEin a Data Guard configuration. Don’t use it if you want to keep the option of downgrading. -
before_action/after_action: Extend AutoUpgrade with your own functionality by using scripts before or after the job.






