Unplug PDB from 12c and Plug into 19c CDB
Move PDBs across Oracle versions with this guide.
In this activity, we will be unplugging PDB from Oracle 12c CDB and plug it into Oracle 19c CDB. All the steps of unplugging and plugging PDB remain the same except we need to perform PDB upgrade.
Unplug PDB from 12c CDB
Run dbca command. Select Manage Pluggable Database
Select Unplug a Pluggable database then click the next button Select
Select the container database which pluggable database we need to unplug and click the next button
We need to select the Pluggable database name from the drop-down box and then click the next button
It will show the unpluggable database details
Transfer file to 19c CDB Server
Now transfer database file set from 12c to 19c using SCP or WINSCP. PDB database file sets
/u01/app/oracle/product/12.2.0.1/db_1/assistants/dbca/templates/{DB_UNIQUE_NAME}_{PDB_NAME}.dfb
/u01/app/oracle/product/12.2.0.1/db_1/assistants/dbca/templates/{DB_UNIQUE_NAME}_{PDB_NAME}.xml
Plug the PDB into 19c CDB
Run dbca command from 19c CDB. Choose the Manage Pluggable Databases option in it then click the next button
Select Create a Pluggable database Choose
Choose the container database on which we are planning to plug the HR_PDB, we have only 1 container so we will click NEXT to proceed
Select Create Pluggable database from an unplugged PDB and select the transferred database file set from the 12c and click NEXT
We need to provide the required Pluggable Database name then click the next button. If required we can lock all other PDB users and can create a new administrator option too
It will automatically choose the storage type and location if exists already
At the end of the process, you will receive a warning as PDB is in upgrade mode
Upgrade PDB
Run dbupgrade -c HR_PDB as the PDB is in Migrate mode
dbupgrade -c HR_PDB
After completion of the upgrade process, log in to the database and run open pdb to bring the PDB from Mount to open
ALTER PLUGGABLE DATABASE HR_PDB OPEN;