Steps to migrate the non cdb to pdb database

 This blogs explains a simple process to migrate your non cdb database to pdb database after 12 upgrade 


We have different methods to perform the migration

  • Export/import 
  • DBMS_PDB
  • GG replication 

  1. shutdown the database 
  2. start the database in read only mode 
  3. Now we need to create a metadata xml file using DBMS_PDB package
BEGIN
  DBMS_PDB.DESCRIBE(pdb_descr_file =>'/u01/app/oracle/backup/ora12c.xml');
END;

     4. shutdown the non-cdb database  and login to CDB database as sys user 
     5. Let us assume we don't have CDB database , if so we need to create CDB database 
     6. use DBCA -silent installation to create the CDB database 
     

export ORACLE_SID=CDB
sqlplus / as sysdba
CREATE PLUGGABLE DATABASE PDBORCL USING '/u01/app/oracle/backup/ora12c.xml'
  COPY
  FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/orcl/', '/u01/app/oracle/oradata/cdb/pdborcl/');

Switch to the PDB container and run the "$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql" script to clean up the new PDB, removing any items that should not be present in a PDB. 

ALTER SESSION SET CONTAINER=pdborcl;
@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
Startup the PDB and check the open mode.

ALTER SESSION SET CONTAINER=pdborcl;
ALTER PLUGGABLE DATABASE OPEN;

SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
pdborcl                           READ WRITE

1 row selected.

The non-CDB has now been converted to a PDB. You should backup the PDB before you start to use


Another method is you use export / import TTS ,make sure you create a new pdb database in the container database

Similarly we use golden gate replication tool to migrate from source to destination  




Comments

Popular posts from this blog

My query is picking a bad execution plan , how to fix it ?

ZDLRA

DB Wait events