Introduction and Pre-requisites
Using RMAN, Pluggable database (PDBs) can be transported and plugged into a destination multitenant container database (CDB) which is on a different platform than the source CDB. In addition to the 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)
Migration Steps
1. Close the source pdb:
SQL> alter pluggable database PDB1 close immediate;
2. Backup the source PDB:
RMAN> backup for transport 2> unplug into '/bugmnt7/ap/celcsol2/SR1.12121212121/oradata/backup/PDB1_Metadata.xml' 3> format '/bugmnt7/ap/celcsol2/SR1.12121212121/oradata/backup/PDB1_BKP_%U' 4> pluggable database PDB1;
3. SCP the backup-piece and PDB metadata files to the destination.
4. Check on destination whether the PDB can be plugged in using dbms_pdb.check_plug_compatibility.
set serveroutput on declare c boolean; begin c:=dbms_pdb.check_plug_compatibility('/home/bugmnt/oradata/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 '/home/bugmnt/oradata/backup/PDB1_Metadata.xml' 2> foreign pluggable database PDB1 3> format '/home/bugmnt/oradata/DEST122/%U' 4> from backupset '/home/bugmnt/oradata/backup/PDB1_BKP_02s9sj0u_1_1';
6. Open the pluggable database PDB1 on destination:
SQL> alter pluggable database PDB1 open;
Conclusion
This post 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.