Tag Archives: example 12.1.0.2 to 12.1.0.1

Downgrade unplug and plug the Pluggable Oracle Database

Downgrade unplug and plug the Pluggable Oracle Database in lower version

You can downgrade the PDB database from upper version to lower version by unplug the PDB from higher version to plug in a lower version CDB by downgrade process

Note: Database must be upgraded from PDB smaller version otherwise it will throw following error during executing catdwgd.sql

SELECT version_script AS file_name FROM DUAL
*
ERROR at line 1:
ORA-20000: Downgrade not supported - database has not been upgraded
ORA-06512: at "SYS.VERSION_SCRIPT", line 13

Steps as follows:
1. Downgrade the PDB database
2. Unplug from upper version
3. Plug it in lower version

Example
You are downgrade the PDB from 12.1.0.2 to 12.1.0.1 Version of Oracle.

Downgrade the PDB

1. Start up the PDB database(12.1.0.2) in DOWNGRADE mode. CDB can be in normal mode:

alter pluggable database PDB1 open downgrade;

2. Run catdwgrd script on PDB1 database as follows:

%ORACLE_HOME%/perl/bin/perl %ORACLE_HOME%/rdbms/admin/catcon.pl -d %ORACLE_HOME%/rdbms/admin -l C:\script -e -b catdwgrd -c 'PDB1' catdwgrd.sql

Note: Catcon command explain in link: Catcon.pl

3. Shutdown the PDB

alter pluggable database PDB1 close;

Unplug the PDB from the CDB

1. Connect to the 12.1.0.2 CDB.

Sqlplus / as sysdba

2. Close the PDB for unplug.

alter pluggable database PDB1 close;

3. Unplug the downgraded 12.1.0.1 PDB

alter pluggable database PDB1 unplug into 'path/PDB1.xml';

Plug the PDB1 database to version 12.1.0.1

1. Connect to the 12.1.0.1 CDB.

sqlplus / as sysdba

2. Plug in the 12.1.0.1 PDB.

create pluggable database PDB1 using 'path/PDB1.xml';

3. Open the PDB1 in upgrade mode.

alter pluggable database PDB1 open upgrade;

4. Connect to the PDB.

alter session set container=PDB1;

5. Run catrelod in the PDB1.
Note: catrelod.sql script reloads the appropriate version for each of the database components

@$ORACLE_HOME/rdbms/admin/catrelod.sql

6. Recompile the invalid object during downgrade operation.

@$ORACLE_HOME/rdbms/admin/utlrp.sql;

Advertisements