How to Upgrade OCI BaseDB (DBCS) from 19c to 23c

Share on:


Recently there was a requirement to upgrade DBCS PDB from 19c to 23c. There might be other ways to do that but I found the best and easiest way is to create a new 23c DBCS and then move 19c PDB using the Refreshable clone method and then use Auto upgrade to upgrade it.

I will show you how to do that in this blog post.

Pre-requisite: I already have all the networking setup and have 2 DBCS, one 19c and one 23c.


Benefits of this approach:

1. We already have 23c DBCS with the latest Grid/ASM software. so we just need to move the PDB to this DBCS and upgrade it. It will shorten the downtime

2. Another thing is when we use the refreshable clone method, there is no downtime when files are copied over, and the copies of the data files forward with redo from the source. Downtime only starts at the time of upgrade

3. Another benefit is the rollback scenario, we already have our source 19c PDB, if anything wrong happens during the process you can just open and use the source PDB as a rollback plan

So let’s start…

Source: 19c DBCS with CDB name DB122 and PDB name Db19c

Target: 23c DBCS with CDB name DB1229 and PDB name Db23c (This is existing PDB on 23c DBCS)


By default, every Oracle Home has the AutoUpgrade jar file. I copied the autoupgrade.jar from 23c DBCS home to 19c DBCS home.

To use auto upgrade I created a config file called upgrade.cfg, which I store on both DBCS systems.

[oracle@source admin]$ cat upgrade.cfg
upg1.source_dblink.DB19C=CLONEPDB 600
upg1.start_time=28/12/2023 22:00:00
[oracle@source admin]$


global.autoupg_log_dir = is the location where auto-upgrade logs will be collected

global.keystore = This is the auto-upgrade keystore where we store TDE passwords for source and target PDBs

Source and Target Homes where specify the source and target CDB homes

sid and PDB is the source CDB and source PDB respectively

target_CDB is the target CDB name

source_dblink has the name of the db link (clonepdb) and the rate at which the redo transfer

target_pdb_copy_option = I am using ASM and OMF

start_time : This is a very important parameter to specify because this parameter decides when downtime starts. At this point, AutoUpgrade refreshes the PDB for the last time and then moves on with the upgrade.

start_time is optional, if you don’t specify, it right away starts upgrade after the refresh.

Now we have to create a dblink that we used in the above config file:

Connect to source DBCS PDB create a user for Db link and grant privileges.

[oracle@source ~]$ . oraenv
ORACLE_SID = [DB122] ?
The Oracle base has been set to /u01/app/oracle
[oracle@source ~]$ echo $ORACLE_SID
[oracle@source ~]$ sqlplus / as sysdba

SQL*Plus: Release - Production on Thu Dec 28 20:28:52 2023

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c EE High Perf Release - Production
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DB19C                          READ WRITE NO
SQL> alter session set container= DB19C;

Session altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 DB19C                          READ WRITE NO
SQL> create user test identified by XXXXXXXXXXXXXXX;

User created.

SQL> grant create session, create pluggable database, select_catalog_role to test;

Grant succeeded.

SQL> grant read on sys.enc$ to test;

Grant succeeded.


Now connect to Target DBCS CDB and create a db link:

SQL> create database link clonepdb connect to test identified by XXXXXXXXXXX using 'DB19C';

Database link created.

SQL> select * from dual@clonepdb;


Now we can analyze and execute pre-upgrade fixups on source PDB

[oracle@source admin]$ java -jar autoupgrade.jar -config upgrade.cfg -mode analyze


[oracle@source admin]$ java -jar autoupgrade.jar -config upgrade.cfg -mode fixups

We will see the below error when analyzing and doing fixups

Error Message: The following checks have ERROR severity and no fixup is available or

the fixup failed to resolve the issue. Fix them manually before continuing:



For now, we can safely ignore these as we will fix them on the target side.

On target DBCS:

Since our PDB is encrypted, we have to add the source (db122) and target CDB(db1229) TDE password to the Auto Upgrade keystore that we defined in the config file.

[oracle@target admin]$ java -jar autoupgrade.jar -config upgrade.cfg -load_password
Processing config file ...
Starting AutoUpgrade Password Loader - Type help for available options
Creating new AutoUpgrade keystore - Password required
Enter password:
Enter password again:
AutoUpgrade keystore was successfully created
TDE> add DB122
Enter your secret/Password:
Re-enter your secret/Password:
TDE> add DB1229
Enter your secret/Password:
Re-enter your secret/Password:
TDE> save
Convert the AutoUpgrade keystore to auto-login [YES|NO] ? yes
TDE> exit
AutoUpgrade Password Loader finished - Exiting AutoUpgrade
[oracle@target admin]$

Now we are ready to start the Auto Upgrade in deploy mode.

[oracle@target admin]$ java -jar autoupgrade.jar -config upgrade.cfg -mode deploy
AutoUpgrade 23.3.230728 launched with default internal options
Processing config file ...
Loading AutoUpgrade keystore
AutoUpgrade keystore was successfully loaded
| Starting AutoUpgrade execution |
1 PDB(s) will be processed
Type 'help' to list console commands
upg> Copying remote database 'DB19C' as 'DB19C' for job 100
Remote database 'DB19C' created as PDB 'DB19C' for job 100
Job 100 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:
[oracle@target admin]$


So what this deploy command will do:

1. Copies the data files to target DBCS over the DB link

2. Refresh the data files using source redo

3. As per the start_time parameter in the config file, it will do the final refresh and disconnect the PDB from the source, downtime starts here.

4. Upgrade the PDB

Now let’s check the target CDB for our new PDB

[oracle@target postchecks]$ sqlplus / as sysdba

SQL*Plus: Release - Production on Fri Dec 29 04:58:32 2023

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

Connected to:
Oracle Database 23c Enterprise Edition Release - Production
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DB23C                          READ WRITE NO
         5 DB19C                          READ WRITE NO

We can see that PDB is there in read-write mode

So Upgrade is done and now we have upgraded PDB on 23c DBCS 🙂

The last thing to check is whether we have this PDB on the OCI console in 23c DBCS CDB. let’s check


Share on:

More from this Author

How to Import Custom Visualization in Oracle Analytics Cloud to See Images

In this blog, I will show you how to download and import the Image Gallery Plugin into OCI Oracle Analytics Cloud. using this plugin we can see ... Read More

Analyze Invoices with Oracle Analytics and AI Document Understanding

OCI Document Understanding is an AI service that enables developers to extract text, tables, and other key data from document files through APIs and ... Read More

Back to Top