When we launched AutoUpgrade, it could upgrade non-CDBs and CDBs with all PDBs. Soon after, it learned to upgrade a non-CDB and plug it into an existing CDB as a new PDB. And then, as next step, we added Unplug / Plug / Upgrade with AutoUpgrade. In this case you have a PDB (or hopefully more than one), and you’d like to upgrade one or many PDBs by moving them to a new CDB with a higher database version.

Photo by Kelly Sikkema on Unsplash
Test Setup
As test setup I use our Hands-On Lab.
I will let AutoUpgrade unplug PDB3 from CDB1 in Oracle 12.2.0.1, and plug it into CDB2 with Oracle 19.11.0 and upgrade it. And trust me, it’s as simple as writing this sentence. You will find the “old” way in the Hands-On Lab instructions right now. But now it’s time to do it with AutoUpgrade.
SQL> select CDB, CON_ID, NAME from V$DATABASE; CDB CON_ID NAME --- ---------- --------- YES 0 CDB1 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB3 READ WRITE NO
Always download the newest AutoUpgrade Utility at first and move it into your 19c ?/rdbms/admin directory.
Unplug / Plug / Upgrade
This technique gives you a lot of flexibility with upgrades in a Multitenant environment. We differ between two techniques:
- Everything at Once
- Unplug / Plug / Upgrade
You can complete the latter approach with one or many PDBs at the same time.

Unplug / Plug / Upgrade of a PDB between two different CDB releases
Especially when you have different downtime requirements between your PDBs, or in case one application is ready for upgrade while the other hosted in another PDB isn’t, this is the right technique for you.
Please be aware that the default AutoUpgrade will chose is the NOCOPY option. Your files will remain in place and won’t be moved.
AutoUpgrade Config File
Every AutoUpgrade exercise usually starts with a config file. AU works now without a config file but instead using environment variables only. But here I’d like to share the config file I will use:
global.autoupg_log_dir=/home/oracle/logs upg1.source_home=/u01/app/oracle/product/12.2.0.1 upg1.target_home=/u01/app/oracle/product/19 upg1.sid=CDB1 upg1.pdbs=PDB3 upg1.target_cdb=CDB2 upg1.log_dir=/home/oracle/logs
So I advice AutoUpgrade to tackle PDB3 (upg1.pdbs=PDB3) in CDB1 (upg1.sid=CDB1) and move it to CDB2 (upg1.target_cdb=CDB2).
Analyze Phase
It is always best practice to run an “analyze” at first to check whether there will be any issues you should fix at first.
$ java -jar $OH19/rdbms/admin/autoupgrade.jar -mode analyze -config CDB1PDB3.cfg AutoUpgrade tool launched with default options Processing config file ... +--------------------------------+ | Starting AutoUpgrade execution | +--------------------------------+ 1 databases will be analyzed Type 'help' to list console commands upg> lsj +----+-------+---------+---------+-------+--------------+--------+----------------------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+-------+--------------+--------+----------------------------+ | 100| CDB1|PRECHECKS|PREPARING|RUNNING|21/06/07 14:07|14:07:09|Loading database information| +----+-------+---------+---------+-------+--------------+--------+----------------------------+ Total jobs 1 upg> Job 100 completed ------------------- Final Summary -------------------- Number of databases [ 1 ] Jobs finished [1] Jobs failed [0] Jobs pending [0] Please check the summary report at: /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.html /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
Let’s have a quick look at the status report, and especially the important parts of it:
In my particular case, AutoUpgrade finds nothing to worry about and displays one important WARNING:
Hence, in case I have no proper and proven backup and recovery strategy, I’d rather should use the COPY option. My config file will need one additional entry, upg1.target_pdb_copy_option as this will advice AutoUpgrade to COPY my PDB.
global.autoupg_log_dir=/home/oracle/logs upg1.source_home=/u01/app/oracle/product/12.2.0.1 upg1.target_home=/u01/app/oracle/product/19 upg1.sid=CDB1 upg1.pdbs=PDB3 upg1.target_cdb=CDB2 upg1.target_pdb_copy_option=file_name_convert=('CDB1', 'CDB2') upg1.log_dir=/home/oracle/logs
It will then move the PDB3 from its current location /u02/oradata/CDB1/pdb3 to /u02/oradata/CDB2/pdb3. As you can see, the “covert” algorithm is working in a very simple way. It just replaces the differing parts of the path, here CDB1 with CDB2, and leaves the rest as-is.
Deploy Phase
Now let AutoUpgrade do the Unplug / Plug / Upgrade.
$ java -jar $OH19/rdbms/admin/autoupgrade.jar -mode deploy -config CDB1PDB3.cfg AutoUpgrade tool launched with default options Processing config file ... +--------------------------------+ | Starting AutoUpgrade execution | +--------------------------------+ 1 databases will be processed Type 'help' to list console commands upg>
I will monitor it from the command prompt every 10 minutes or so.
upg> lsj -r +----+-------+---------+---------+-------+--------------+--------+----------------------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+-------+--------------+--------+----------------------------+ | 101| CDB1|PREFIXUPS|EXECUTING|RUNNING|21/06/07 14:17|14:18:34|Loading database information| +----+-------+---------+---------+-------+--------------+--------+----------------------------+ Total jobs 1 upg> lsj -r +----+-------+---------+---------+-------+--------------+--------+----------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+-------+--------------+--------+----------------+ | 101| CDB1|DBUPGRADE|EXECUTING|RUNNING|21/06/07 14:17|14:22:00|18%Upgraded PDB3| +----+-------+---------+---------+-------+--------------+--------+----------------+ Total jobs 1 upg> lsj -r +----+-------+---------+---------+-------+--------------+--------+----------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+-------+--------------+--------+----------------+ | 101| CDB1|DBUPGRADE|EXECUTING|RUNNING|21/06/07 14:17|14:28:01|39%Upgraded PDB3| +----+-------+---------+---------+-------+--------------+--------+----------------+ Total jobs 1 upg> lsj -r +----+-------+----------+---------+-------+--------------+--------+-------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+----------+---------+-------+--------------+--------+-------------+ | 101| CDB1|POSTFIXUPS|EXECUTING|RUNNING|21/06/07 14:17|14:35:53|Remaining 1/4| +----+-------+----------+---------+-------+--------------+--------+-------------+ Total jobs 1 upg> Job 101 completed ------------------- Final Summary -------------------- Number of databases [ 1 ] Jobs finished [1] Jobs failed [0] Jobs pending [0] Please check the summary report at: /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.html /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
Actually, if you weren’t aware already, you will get a pretty decent summary at the end of the upgrade, at first for AutoUpgrade and the different stages:
So you can see that the actual upgrade of the PDB took 13 minutes 49 seconds in my case.
Final check:
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jun 7 15:26:22 2021 Version 19.11.0.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.11.0.0.0 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 READ WRITE NO 4 PDB3 READ WRITE NO
PDB3 has been successfully plugged in and upgrade to Oracle 19.11.0.
Plugin the “old” PDB3 back into Source?
And in my 12.2.0.1 CDB1, it has been removed:
SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 7 15:28:12 2021 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO
That is expected. But the files remain still in the previous place.
$ cd PDB3 [CDB1] oracle@hol:/u02/oradata/CDB1/PDB3 $ ls sysaux01.dbf system01.dbf undotbs01.dbf users01.dbf
If needed, I could plugin the PDB3 again into CDB1. In case you’d like to plugin PDB3 now again into the source CDB1, you will find the XML manifest file in the AutoUpgrade log directory:
~/logs/CDB1/101/drain/PDB3.xml
It exists only in the log tree created by the “deploy” command – and there in the drain subdirectory.
With this file, I can logon to my CDB1 and plugin again:
SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 7 15:38:47 2021 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> create pluggable database PDB3 using '/home/oracle/logs/CDB1/101/drain/PDB3.xml' NOCOPY TEMPFILE REUSE; Pluggable database created. SQL> alter pluggable database PDB3 open; Pluggable database altered. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB3 READ WRITE NO
Not bad 🙂
Summary
As you see, using AutoUpgrade to move one or many PDBs to a higher release CDB version is simple and straight forward. Just keep in mind that you will need an additional AU parameter in order to use the more safer COPY option instead of the default, NOCOPY. Still, NOCOPY may be the best solution in case you have a very large database to move.
This approach gives you a lot of flexibility. And AutoUpgrade does all the checks for you, too.
Further Information and Links
- Upgrade and Plugin with AutoUpgrade
- Hands-On Lab 19c – Unplug / Plug / Upgrade
- Upgrade PDBs – One at a time (2014)
- Download the newest AutoUpgrade Utility
- Upgrade PDBs with RELOCATE – does it work?
- More information on TARGET_PDB_COPY_OPTION
–Mike
Wow… That’s so cool…
Hi, Mike.
Could you please describe case then source and target CBD have physical standbys. Because in this case not to simple just unplug and plug, also it requires to fix standby.
May be you have some automatization for this case?
Hi Alex,
see from here on:
https://videohub.oracle.com/media/Upgrade+to+19c+Virtual+Classroom+SeriesA+Migrate+to+the+Multitenant+Architecture/1_izx15u3d?st=3735
We describe all the cases when you have a standby in the backend.
Slides are here (click on the picture for Virtual Classroom Seminar 4):
https://mikedietrichde.com/videos/
Cheers,
Mike
I tried this for a pdb that uses TDE and received the following errors in the drain log:
alter pluggable database GOLDDBTEST_PDB unplug into ‘/home/oracle/upgrade/autoupgrade/CBNP01/101/drain/GOLDDBTEST_PDB.xml’
*
ERROR at line 1:
ORA-46680: master keys of the container database must be exported
drop pluggable database GOLDDBTEST_PDB keep datafiles
*
ERROR at line 1:
ORA-65179: cannot keep datafiles for a pluggable database that is not unplugged
This is the version I’m using:
$ORACLE_HOME/jdk/bin/java -jar /home/oracle/upgrade/autoupgrade.jar -version
build.hash 57ab246
build.version 21.1.3
build.date 2021/04/21 13:32:13
build.max_target_version 21
build.supported_target_versions 12.2,18,19,21
build.type production
It’s quite possible I’m overlooking something but it seems that the alter pluggable database…unplug command doesn’t have the “encrypt using” clause required when TDE is in use. Is there an additional parameter(s) to handle this?
Thanks,
Stan
Hi Stan,
that does not work in an automated fashion yet. Simple reason: AU does not have the password. But we are working on a mechanism for such cases.
There is this parameter:
SKIP_IMPORT_TDE_KEYS
in AutoUpgrade.
Which does:
(Optional) The default is NO. You can use this option for nonCDB-to-PDB and unplug/plug operations. When set to YES, the import of the source database KeyStore import into the target database is skipped, without raising an error. AutoUpgrade will leave the PDB open in upgrade mode, so that you can import the keys manually yourself.
This allows you the manual steps needed.
Hope this helps – cheers,
Mike
Mike thanks. I have also been testing this and have found that at this time AU does not support TDE. The wallet has to be imported at the PDB level after the AU completes (use option skip_tde_key_import else AU will fail).
It will be very nice if you can also provide the steps needed to handle the standby. I have been going through the following MOS note Reusing the Source Standby Database Files When Plugging a non-CDB as a PDB into the Primary Database of a Data Guard Configuration (Doc ID 2273304.1).
Hi Sreedhar,
we covered the “you have a standby” cases all here:
https://videohub.oracle.com/media/Upgrade+to+19c+Virtual+Classroom+SeriesA+Migrate+to+the+Multitenant+Architecture/1_izx15u3d?st=3735
And regarding TDE and unplug/plug/upgrade, I’m checking with the developers right now.
Cheers,
Mike
Hi Mike
Using the latest version (20210421) I attempted this and found that upg1.pdb=PDB1 needed to be upg1.pdbs=PDB1
Seemed it did not like the parameter without the ‘s’
Sorry Luke – and thanks for the correction. I’d bet that it worked in my env with upg1.pdb as I only copy&pasted the config file contents – no idea why it worked for me.
Anyhow, thanks again – and I corrected (hopefully) every occurrence of upg1.pdb to upg1.pdbs 🙂
Thanks,
Mike
Hi Mike, during last update I had an issue like unplug PDB took 18 minutes. This is very first time I faced with such long unplug. Usually i takes 2-10 seconds. Any idea what caused the issue?
Hi Mateusz,
no idea – but I’ve had some strange waits as well.
Actually to things you need to check:
alert.log
awr snapshot
This may reveal what has happened (or potentially trace files written).
Cheers,
Mike
Hello Mike.
I attended your February 2021 Webinar on AutoUpgrade and have successfully used it to upgrade all my 12c CDB/PDB Databases to 19c.
I am now trying to follow the Unplug-Plug method with AutoUpgrade to Upgrade/Convert my dozens of 11.2.0.4 Non-Container Databases to 19c PBDs in new/empty CDBs on VMs.
An empty 19c CDB was created and patched, then the 11g Non-CDB database was upgraded and plugged into the 19c CDB.
The Unplug-Plug from an 11g Non-Container database to a 19c PDB was successful, but I have a couple of questions resulting from Post-Upgrade/Migration issues.
1.) How can I convert the existing Privileged Users (that are now only found in the upgraded PDB), to Common (C##) Users at the Root (CDB) level and PDBs, without dropping them from the now PDB and recreating them afresh in the Root CDB? Or is there a way for AutoUpgrade to Automate this?
2.) Secondly, after we download and patch the 19c ORACLE_HOME, AutoUpgrade takes care of upgrading/migrating the database from the 12c CDB/PDB Home to the 19c CDB/PDB Home and everything is automated in the background. After successful AutoUpgrade, OEM Agent on the server seems to update OEM automatically, such that the Target Details of the upgraded Database are reflected in OEM, showing the change from the 12c version to the new 19c version, as well as the new (19c) ORACLE _HOME or that upgraded target Database, and no Manual Intervention is required in OEM after the upgrade.
Similarly, our Scheduled Backups to Tape that were paused before upgrade, when Resumed after the upgrade, continue normally as well for the 12c CDB/PDB to 19c CDB/PDB upgrades.
After our first Unplug-Plug AutoUpgrade from 11g Non-Container to 19c CDB/PDB, OEM continues to complain about missing/wrong config details about the upgraded database and incorrect ORACLE_HOME/SID. Resumed tape backups are also failing for similar reasons.
Is there a way to automate the Update in OEM and/or Tape Backups during the upgrade process, or are there any other Post-Upgrade tasks to be done to address these, without manually dropping/re-adding the target in OEM or removing/aading the Backup Configs anew?
AutoUpgrade has so far been my best method to upgrade my CDB/PBDs from 12c to 19c, and I would like it to be the only method (as you recommend 🙂 ) to upgrade our 11g Non-CDB databases to 19c CDB/PDB with minimal issues.
Those are three the issues so far experienced after successful upgrade and conversion from 11.2.0.4 non-container to 19c CDB/PBD and we need your advice to proactively address these, unless these must be done manually after the upgrade.
I created SR with these questions, but got no satisfactory response, and the question keeps being split and sent to different departments.
Would appreciate your input/advice.
Kindest Regards
Walters
Hi Walters,
1) AutoUpgrade can’t automate this – you need to do this manually unfortunately
2) I guess, the problem of OEM and RMAN are the SID. Now the jobs need to connect to a new SID, and in case you want to explore the PDB, the service name setup needs to be done. But autoupgrade can’t automate this either. For OEM, you may need to discover the target again. Not sure about RMAN/B&R software.
Cheers,
Mike
Hi Mike,
Does this support even if Source PDB has TDE Enabled .
We need to upgrade 12.10.2. to 19.11 (PDB has TDE Enabled) and would like to use Unplug/Plug approach with Auto upgrade
Please see here:
https://docs.oracle.com/en/database/oracle/oracle-database/19/upgrd/autoupgrade-configuration-file-examples.html#GUID-941F8A45-C3E8-445A-A5C9-85799A285DEC
https://dohdatabase.com/2021/04/09/future-proof-your-encrypted-database-during-upgrade/
and
https://dohdatabase.com/2021/01/07/how-to-upgrade-a-single-pdb/
“You Are Using TDE Tablespace Encryption?
For now, don’t use AutoUpgrade to perform unplug-plug upgrades, if any tablespace in the PDB is encrypted with TDE Tablespace Encryption. We are working on making AutoUpgrade capable of better interacting with the TDE keystore, so keep an eye out for coming versions.
If TDE Tablespace Encryption is enabled in the target CDB, you can still use AutoUpgrade. The PDB will be plugged in as an unencrypted PDB.”
It’s coming very soon – I have the “beta” running on my system already.
Cheers,
Mike
I presume AU still do not work if TDE is enabled on the source pdb. If it works, please advise
See my other reply please 🙂
Thanks,
Mike
Hi Mike,
First of all, compliments to your blog and this Upgrade Articles. They are a great help.
We are trying to upgrade an 12.1.0.2 EE database on AIX to 19C, using the unplug/plug method you describe above.
We have an 12.1.0.2 CDB called HISCDBT with a PDB called HISPRD.
This PDB is to be upgraded and plugged into a 19c CDB called HIST01C
The config file looks like:
upg1.sid=HISCDBT
upg1.target_cdb=HIST01C
upg1.pdbs=HISPRD
upg1.source_home=/opt/hist01/ora/12.1.0.2
upg1.target_home=/opt/hist01/ora/19.0.0.0
upg1.run_utlrp=yes
Now when running the analyze step, it throws an error saying:
“The source database, HISCDBT, must not use the CDB architecture when the target_cdb parameter is defined for entry upg1”
I do not understand what the error is telling me. Can you explain ?
Thank you
Hi,
which version of AutoUpgrade are you using?
It is very hard doing diagnosis without seeing the logs.
Did you open an SR?
Thanks,
Mike
Hi Mike,
Thanks for the reaction. Currently we’re using the below Auto upgrade version:
build.hash 680914c
build.version 21.2.210721
build.date 2021/07/21 11:14:54
build.max_target_version 21
build.supported_target_versions 12.2,18,19,21
build.type production
That solved the problem.
The previous version :
build.hash 3b51369
build.version 19.9.1
build.date 2020/07/10 11:20:49
build.max_target_version 19
build.supported_target_versions 12.2,18,19
build.type production
Did have the above problem.
For now we are good. We can continue working the pre-upgrade checks
Thanks for the update!
Cheers,
Mike