Thursday, March 07, 2019

Easy Way To Unplug and Plug PDB After 12.2

After Oracle DB 12.2 , it is much easier to move data or migrate DB to different places. 2 simple sqls can achieve that.

Unplug

ALTER PLUGGABLE DATABASE TESTDB CLOSE;
ALTER PLUGGABLE DATABASE TESTDB UNPLUG INTO '/u02/databak/testdb.pdb';

Copy the .pdb file to the target place......

Plug

CREATE PLUGGABLE DATABASE TESTDBNEW USING '/u110/datatarget/testdb.pdb'
create_file_dest='/opt/oracle/oradata/testdbnew/'
file_name_convert =('/u110/datatarget/','/opt/oracle/oradata/testnew/DATAFILE/');

ALTER PLUGGABLE DATABASE TESTDBNEW OPEN READ WRITE;

No comments: