https://docs.oracle.com/cd/F19136_01/sutil/oracle-data-pump-export-utility.html#GUID-079769D8-40F4-432F-88AD-E7264D7A2E2D
https://docs.oracle.com/cd/F19136_01/sutil/datapump-import-utility.html#GUID-E27D2DC9-A6D8-4F0B-AB72-6BF526B3AA18
PROD2→orcl:PDB17
-- orcl:PDB17, PROD2で作業
select * from all_directories;
create directory ORA_DIR as '/home/oracle';
grant all on directory ORA_DIR to public;
-- PROD2で作業
select * from dba_tablespaces;
select * from dba_data_files;
ALTER TABLESPACE USERS READ ONLY;
ALTER TABLESPACE USERTBS READ ONLY;
expdp system/oracle@PROD2 full=y dumpfile=expdat.dmp directory=ORA_DIR transportable=always logfile=export.log
mkdir /home/oracle/test
cp -p /home/oracle/expdat.dmp /home/oracle/test
cp -p /oradata/PROD2/users01.dbf /home/oracle/test
cp -p /oradata/PROD2/usertbs01.dbf /home/oracle/test
ALTER TABLESPACE USERS READ WRITE;
ALTER TABLESPACE USERTBS READ WRITE;
-- orcl:PDB17で作業
alter database default tablespace system;
drop tablespace users including contents and datafiles;
impdp system/oracle@mmm111:1523/pdb17.example.com full=Y dumpfile=expdat.dmp directory=ORA_DIR transport_datafiles='/home/oracle/test/users01.dbf','/home/oracle/test/usertbs01.dbf' logfile=import.log
select * from dba_tablespaces;
select * from dba_data_files;
alter database default tablespace users;
※transport_datafilesで指定した場所がそのままデータファイルの場所として使用される