How to migrate an existing pre12c database(nonCDB) to 12c CDB database
By antonyro on Dec 06, 2013
Migrate to 12c Pluggable database is very simple and easy. You can evaluate and adopt which one best suit for you.
a).Provision empty PDBs per database that need to consolidated
b).Use datapump or golden gate replication to migrate a Database into a PDB
a)Upgrade an existing pre 12.1 database to 12.1(non-CDB)
You can use dbua or manual method to upgrade a pre 12.1 database to a 12.1 non-CDB database
Complete Checklist for Manual Upgrades to Oracle Database 12c Release 1 (12.1) [ID 1503653.1]
Complete Checklist to Upgrade the Database to 12c Release 1 using DBUA [ID 1516557.1]
b)Plug-in the database post upgrade into a CDB
* This note explain the details how to plug-in the upgraded/created non12c database into CDB
Set the ORACLE_SID variable to noncdb.
Connect to the noncdb instance.
sqlplus / as sysdba
If the instance is up, shut it down first.
Start up the database in mount exclusive mode.
Open the database in read-only mode.
* Generate a Pluggable Database Manifest File for the Non-Container Database
Execute the dbms_pdb.describe procedure to generate the manifest file.
Shutdown the noncdb instance, in preparation for copying the data files in the next section.
Connect to cdb. If it's down, start it up.
Create a new pluggable database(exnoncdb) using the noncdb manifest file. The file_name_convert parameter allows you to place the copied data files into a different location.
Finalize the plug-in by opening the new pluggable database, closing it, and then re-opening it.
* Convert to Pluggable Database Data Dictionary (Optional)
At this point, the new pluggable database cloned from the non-container database will work fine. However, if you need to upgrade the container database at some later point, then you should run the noncdb_to_pdb.sql script to remove superfluous data from the pluggable database's data dictionary (data from its original incarnation as a non-container database). This is an optional step in this lab, but is recommended in a production environment.
Connect to the new pluggable database exnoncdb.
Run $ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql. This script can take quite a long time to run (more than 20 minutes).