Tuesday, April 20, 2021

Upgrade old release of PDB to new - by using the database link instead of plug/unplug

Although this information is not provided in the documentation, I tried to implement it when performed and upgrade of 12.1 PDB to 19.10; and in my case all works fine aftermath. I do not encourage you to do this, just consider it as another unofficial way to act.

The main sequence of steps :

1. run preupgrade.jar on the source PDB, resolve the issues etc.

2. create common user on the source and target CDBs, grant create pluggable database container=all to it, and create database link from the dest CDB to the source CDB.

3. open source PDB (12.1) in read only mode (you can use local undo mode when performing upgrade from 12.2 and upper, and thus no need to open source PDB in read only mode).

4. on the dest CDB create pluggable database using newly created database link.

5. alter pluggable database <new_pdb> open upgrade ;

6. to perform upgrade run catctl.pl (or dbupgrade) only on newly created PDB. catctl.pl must run catupgrd.sql script, or you can manually run catupgrd.sql being connected to new PDB.

7. open new PDB (it was closed after finishing catupgrd.sql) and apply postupgrade_fixups (script generated from preupgrade.jar utility)

8. compile all invalid objects on new PDB (utlrp.sql)

9. upgrade database time zone if needed

10. do not forget about backup at every step. do not increase compatible of destination CDB in order to make in possible to fail back to the source CDB.

Good luck !