Downgrading a Single Pluggable Oracle Database (PDB)
If you are downgrading Oracle Database, then you can downgrade one PDB without downgrading the whole CDB.
You can downgrade individual PDBs. For example, you can unplug a PDB from an upgraded CDB, downgrade the PDB, and then plug it in to an earlier release CDB, or you can convert the PDB database to a standalone database.
Downgrade the PDB
In this procedure example, you downgrade the PDB to release 19c:
-
Start up the PDB in
DOWNGRADE
mode. The CDB can be in normal mode when you do this.SQL> alter pluggable database CDB1_PDB1 open downgrade;
-
Downgrade the PDB, either by using the
dbdowngrade
utility, or by runningcatdwgrd
manually, usingcatcon.pl
.In each of these options, the PDB that you are downgrading is
PDB1
.-
Downgrading with
dbdowngrade
utility.Downgrade the PDB using the
dbdowngrade
script as follows:cd $ORACLE_HOME/bin ./dbdowngrade -c 'PDB1'
-
Manually downgrading with
catdwgrd
, usingcatcon.pl
.Run
catdwgrd
as follows, whereoutput-directory
is the output directory, andcatdwgrd
is the log file base:$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -d $ORACLE_HOME/rdbms/admin -n 1 -l output-directory -e -b catdwgrd -c 'PDB1' catdwgrd.sql
In the example,
catdwgrd
is run withcatcon.pl
. The-d
parameter tellscatcon.pl
where to findcatdwgrd
. The-l
parameter specifies the output directory for log files, instead of writing to therdbms/admin
directory). You must use the-r
parameter to run the two scripts together at the same time.The log files for the downgrade are placed in the Oracle base home (the Oracle base identified by the commands
orabasehome
, ororabase
, or the Oracle home identified by the commandoracle_home
, in that order.
-
-
Close the PDB.
Unplug the PDB from the CDB
In this step you unplug the downgraded PDB from the Oracle Database 23ai CDB:
-
Connect to the upgraded CDB.
-
Close the PDB that you want to unplug.
SQL> alter pluggable database PDB1 close;
-
Unplug the downgraded 19c PDB, replacing the variable
path
with the path on your system:SQL> alter pluggable database PDB1 unplug into 'path/pdb1.xml';
You receive the following response when the unplug is completed:
Pluggable database altered
Plug in the Downgraded 19c PDB
In this step you plug the downgraded 19c PDB into the 19c CDB. To do this, you must create the PDB in this CDB. The following example shows how to create a pluggable database called PDB1:
-
Connect to the 19c CDB.
-
Plug in the 19c PDB.
SQL> create pluggable database PDB1 using 'path/pdb1.xml';
This command returns
Pluggable database created
. -
Open the PDB in upgrade mode:
SQL> alter pluggable database PDB1 open upgrade;
-
Connect to the PDB:
SQL> alter session set container=PDB1;
-
Run
catrelod
in the PDB:SQL> @$ORACLE_HOME/rdbms/admin/catrelod.sql
The
catrelod.sql
script reloads the appropriate version for each of the database components in the downgraded database. -
Run
utlrp
in the PDB:SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
The
utlrp.sql
script recompiles all existing PL/SQL modules that were previously in anINVALID
state, such as packages, procedures, types, and so on.
Related Topics
Parent topic: Downgrading Oracle Database to an Earlier Release