Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
oracle_multitenant_pdb_management [2021/11/13 18:35] – andonovj | oracle_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: | ||
+ | |||
+ | |||
+ | {{: | ||
+ | |||
+ | 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 | ||
+ | |||
+ | |||
+ | {{: | ||
+ | |||
+ | 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== | ||
+ | |||
+ | < | ||
+ | RMAN> BACKUP TO PLATFORM 'Linux x86_64-bit' | ||
+ | UNPLUG INTO / | ||
+ | FORMAT '/ | ||
+ | </ | ||
+ | |||
+ | 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== | ||
+ | < | ||
+ | RMAN> BACKUP FOR TRANSPORT UNPLUG INTO / | ||
+ | PLUGGABLE DATABASE pdb1 FORMAT '/ | ||
+ | </ | ||
+ | |||
+ | === 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 == | ||
+ | < | ||
+ | RMAN> RESTORE USING '/ | ||
+ | FROM BACKUPSET ' | ||
+ | </ | ||
+ | |||
+ | == If conversation was on the destination host == | ||
+ | < | ||
+ | RMAN> ALTER SYSTEM SET DB_CREATE_FILE_DEST='/ | ||
+ | RMAN> RESTORE FROM PLATFORM 'LINUX x86 64-bit' | ||
+ | FOREIGN PLUGGABLE DATABASE pdb1 TO NEW | ||
+ | FROM BACKUPSET '/ | ||
+ | </ | ||
+ | |||
===== Hot clone ===== | ===== Hot clone ===== |