oracle_multitenant_pdb_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oracle_multitenant_pdb_management [2021/11/13 18:35] andonovjoracle_multitenant_pdb_management [2021/11/14 08:31] (current) – [Unplug a PDB] andonovj
Line 37: Line 37:
 ==== Unplug a PDB ==== ==== Unplug a PDB ====
 In 12.1 we could unplug a PDB into .xml file and the migration of the PDB, would be the migration of that XML file AND the relevant database files.  In 12.1 we could unplug a PDB into .xml file and the migration of the PDB, would be the migration of that XML file AND the relevant database files. 
 +
 From 12.2 we can also unplug the PDB into a .pdb archive file, which contains information about the PDB AND the relevant database files. That will ease our migration. From 12.2 we can also unplug the PDB into a .pdb archive file, which contains information about the PDB AND the relevant database files. That will ease our migration.
  
Line 225: Line 226:
 Non-CDB in this case, refers to normal database, pre 12c Non-CDB in this case, refers to normal database, pre 12c
 So let's see how it will be done. As before we need to create a user and bring the whole database in read only mode: So let's see how it will be done. As before we need to create a user and bring the whole database in read only mode:
 +In fact there are multiple ways to be done:
 +
 +
 +{{:moving_noncdb_cdb.jpg?600|}}
 +
 +But let's do it cloning:
  
 ==On remote== ==On remote==
Line 305: Line 312:
  
 REMEMBER, as the cloned DB wasn't a PDB, we need to run the noncdb_to_pdb.sql. REMEMBER, as the cloned DB wasn't a PDB, we need to run the noncdb_to_pdb.sql.
 +
 +
 +==== Cross-Platform PDB Transport ====
 +We can perform also cross platform migration of PDB, however there are certain requirements:
 +
 +  * COMPATIBLE: Greater or Equal to 12.2
 +  * OPEN_MODE: MOUNTED
 +
 +
 +{{:cross_platform_move.jpg?600|}}
 +
 +This action is done either on the source server, when the backup is done, OR on the destination host, when the restore is done.
 +
 +=== Backup ====
 +We can transform the data either on the source or the destination server. Different situations call for different solutions.
 +
 +==On Source host==
 +
 +<Code:bash|Rman backup & Conversion>
 +RMAN> BACKUP TO PLATFORM 'Linux x86_64-bit'
 +      UNPLUG INTO /tmp/pdb2.xml' PLUGGABLE DATABASE pdb1
 +      FORMAT '/bkp_dir/transport_%U'
 +</Code>
 +
 +Bare in mind, as we backup to XML, that WILL NOT SAVE THE DATA, ONLY THE METADATA, you want the data, dump to .pdb file.
 +
 +==On destination host==
 +<Code:bash|Rman backup & Conversion>
 +RMAN> BACKUP FOR TRANSPORT UNPLUG INTO /tmp/pdb2.xml'
 +      PLUGGABLE DATABASE pdb1 FORMAT '/bkp_dir/transport_%U';
 +</Code>
 +
 +=== Restore ===
 +After we have moved the backup sets and the XML to the destination server. We can start an RMAN session and connect to the target CDB.
 +Also here, depending on where the conversation happened, we have two chocies.
 +
 +== If conversation was on source host ==
 +<Code:bash|RMAN Restore & Conversion>
 +RMAN> RESTORE USING '/tmp/pdb2.xml' FOREIGN PLUUGABLE DATABASE pdb1 to NEW 
 +      FROM BACKUPSET '.bkp_dir/transport_0gqoejqv_1_1';
 +</Code>
 +
 +== If conversation was on the destination host ==
 +<Code:bash|RMAN Restore & Conversation>
 +RMAN> ALTER SYSTEM SET DB_CREATE_FILE_DEST='/oradata/new_pdb';
 +RMAN> RESTORE FROM PLATFORM 'LINUX x86 64-bit' USING '/tmp/pdb2.xml'
 +      FOREIGN PLUGGABLE DATABASE pdb1 TO NEW
 +      FROM BACKUPSET '/bkp_dir/transport_0gqoejqv_1_1';
 +</Code>
 +
  
 ===== Hot clone ===== ===== Hot clone =====
  • oracle_multitenant_pdb_management.1636828528.txt.gz
  • Last modified: 2021/11/13 18:35
  • by andonovj