RMAN Cross-Platform Transport of PDB into Destination CDB
Example
For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:
Database names: SRC122, DEST122
Pluggable database name: PDB1
New container database name: DEST_DB
********
Using RMAN, Pluggable database (PDBs) can be transported and plugged in to a destination multitenant container database (CDB) which is on a different platform than the source CDB. In addition to backup of the PDB, RMAN also copies the metadata required to plug the PDB into the destination CDB. The source CDB and the destination CDB must use the same endian format.
Below steps show migration of closed PDB from source platform Solaris (Big Endian) to AIX (Big Endian)
SQL> select name,open_mode,platform_name from v$database;
Source:NAME OPEN_MODE PLATFORM_NAME
——— ————- ————————
SRC122 READ WRITE Solaris[tm] OE (64-bit)
Destination:
NAME OPEN_MODE PLATFORM_NAME
——— ———— —————————
DEST122 READ WRITE AIX-Based Systems (64-bit)
SOLUTION
1. Close the source pdb:SQL> alter pluggable database PDB1 close immediate;
2. Backup the source PDB:RMAN> backup for transport
2> unplug into ‘/<path>/backup/PDB1_Metadata.xml’
3> format ‘/<path>/backup/PDB1_BKP_%U’
4> pluggable database PDB1;
3. SCP the backup-piece and PDB metadata files to destination
4. Check on destination whether the PDB can be plugged in using dbms_pdb.check_plug_compatibilityset serveroutput on
declare
c boolean;
begin
c:=dbms_pdb.check_plug_compatibility(‘/<path>/backup/PDB1_Metadata.xml’,’PDB1′);
if (c) then dbms_output.put_line(‘True’);
else dbms_output.put_line(‘False’);
end if;
end;
/
5. Restore the PDB on destination:RMAN> restore using ‘/<path>/backup/PDB1_Metadata.xml’
2> foreign pluggable database PDB1
3> format ‘/<path>/oradata/DEST_DB/%U’
4> from backupset ‘/<path>/backup/PDB1_BKP_02s9sj0u_1_1’;
6. Open the pluggable database PDB1 on destination:SQL> alter pluggable database PDB1 open;NOTE: This document covers PDB cross platform migration strategy using consistent backups i.e. the PDB is closed prior to backup. To reduce downtime, migration can also be achieved using inconsistent backups where, PDB level 0 backup is taken using clauses FOR TRANSPORT and ALLOW INCONSISTENT while the PDB is open in READ WRITE mode. Thereafter, PDB can be closed and a level 1 backup can be performed using FROM SCN clause and UNPLUG INTO (new in 12.2) clause to perform a final level 1 and also get the PDB metadata.