How to migrate an existing pre12c database(nonCDB) to 12c CDB database

Migrate to 12c Pluggable database is very simple and easy. You can evaluate and adopt which one best suit for you.

Plan A.

a).Provision empty PDBs per database that need to consolidated
b).Use datapump or golden gate replication to migrate a Database into a PDB

Plan B.

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.

shutdown immediate

 Start up the database in mount exclusive mode.

startup mount exclusive

Open the database in read-only mode.

alter database open read only;


* Generate a Pluggable Database Manifest File for the Non-Container Database

 Execute the dbms_pdb.describe procedure to generate the manifest file.

exec dbms_pdb.describe(pdb_descr_file=>'/opt/oracle/oradata/noncdb/noncdb.xml');

Shutdown the noncdb instance, in preparation for copying the data files in the next section.

shutdown immediate
* Create and Plug-In a Pluggable Database into cdb Using the noncdb Manifest File

Connect to cdb. If it's down, start it up.

sqlplus / as sysdba

 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.

create pluggable database exnoncdb
as clone
using '/opt/oracle/oradata/noncdb/noncdb.xml'
file_name_convert=('/opt/oracle/oradata/noncdb','/stage/oradata/exnoncdb')
copy;


Finalize the plug-in by opening the new pluggable database, closing it, and then re-opening it.

alter pluggable database exnoncdb open;

alter pluggable database exnoncdb close;

alter pluggable database exnoncdb open;


* 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.

sqlplus sys/oracle@hol/exnoncdb as sysdba

Run $ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql. This script can take quite a long time to run (more than 20 minutes).

@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Robin is a Senior support Analyst in global database support

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today