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:43] – [Clone a non-CDB] 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 312: Line 319:
   * COMPATIBLE: Greater or Equal to 12.2   * COMPATIBLE: Greater or Equal to 12.2
   * OPEN_MODE: MOUNTED   * 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. 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== ==On Source host==
  
-<Code:bash|Rman conversion>+<Code:bash|Rman backup & Conversion>
 RMAN> BACKUP TO PLATFORM 'Linux x86_64-bit' RMAN> BACKUP TO PLATFORM 'Linux x86_64-bit'
       UNPLUG INTO /tmp/pdb2.xml' PLUGGABLE DATABASE pdb1       UNPLUG INTO /tmp/pdb2.xml' PLUGGABLE DATABASE pdb1
Line 327: Line 339:
  
 ==On destination host== ==On destination host==
-<Code:bash|Rman conversion>+<Code:bash|Rman backup & Conversion>
 RMAN> BACKUP FOR TRANSPORT UNPLUG INTO /tmp/pdb2.xml' RMAN> BACKUP FOR TRANSPORT UNPLUG INTO /tmp/pdb2.xml'
       PLUGGABLE DATABASE pdb1 FORMAT '/bkp_dir/transport_%U';       PLUGGABLE DATABASE pdb1 FORMAT '/bkp_dir/transport_%U';
 </Code> </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>
  
  
  • oracle_multitenant_pdb_management.1636828987.txt.gz
  • Last modified: 2021/11/13 18:43
  • by andonovj