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
DOWNGRADEmode. 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
dbdowngradeutility, or by runningcatdwgrdmanually, usingcatcon.pl.In each of these options, the PDB that you are downgrading is
PDB1.-
Downgrading with
dbdowngradeutility.Downgrade the PDB using the
dbdowngradescript as follows:cd $ORACLE_HOME/bin ./dbdowngrade -c 'PDB1' -
Manually downgrading with
catdwgrd, usingcatcon.pl.Run
catdwgrdas follows, whereoutput-directoryis the output directory, andcatdwgrdis 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.sqlIn the example,
catdwgrdis run withcatcon.pl. The-dparameter tellscatcon.plwhere to findcatdwgrd. The-lparameter specifies the output directory for log files, instead of writing to therdbms/admindirectory). You must use the-rparameter 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 AI Database 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
pathwith 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
catrelodin the PDB:SQL> @$ORACLE_HOME/rdbms/admin/catrelod.sql
The
catrelod.sqlscript reloads the appropriate version for each of the database components in the downgraded database. -
Run
utlrpin the PDB:SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
The
utlrp.sqlscript recompiles all existing PL/SQL modules that were previously in anINVALIDstate, such as packages, procedures, types, and so on.
Related Topics
Parent topic: Downgrading Oracle Database to an Earlier Release