表空间传输数据文件转换
1.表空间转换(源库执行)
表空间转换在源数据库端进行
convert tablespace TPS_TSG to platform 'Linux x86 64-bit' db_file_name_convert '/u01/app/oracle/oradata/slnngkdg','/u01/dumpdir' parallelism 4;
to platform是指向目标库,表空间需要首先置于只读模式
例子1(db_file_name_convert):
SQL> alter tablespace TPS_HXL read only;
RMAN> CONVERT TABLESPACE TPS_HXL TO PLATFORM 'Linux IA (64-bit)' db_file_name_convert '/u01/app/oracle/oradata/ora11g','/tmp/transport_linux';
Starting conversion at source at 13-DEC-23
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00005 name=/u01/app/oracle/oradata/ora11g/tps_hxl01.dbf
converted datafile=/tmp/transport_linux/tps_hxl01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
Finished conversion at source at 13-DEC-23
例子2(%b):
RMAN> CONVERT TABLESPACE TPS_HXL TO PLATFORM 'Linux IA (64-bit)' FORMAT '/tmp/transport_linux/%b';
Starting conversion at source at 13-DEC-23
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00005 name=/u01/app/oracle/oradata/ora11g/tps_hxl01.dbf
converted datafile=/tmp/transport_linux/tps_hxl01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
Finished conversion at source at 13-DEC-23
例子3(转windows):
CONVERT TABLESPACE TPS_HXL TO PLATFORM 'Microsoft Windows IA (64-bit)' FORMAT '/tmp/transport_linux/%b';
CONVERT TABLESPACE TPS_HXL TO PLATFORM 'Microsoft Windows x86 64-bit' FORMAT '/tmp/transport_linux/%b';
2.数据文件转换
convert datafile '/u01/dumpdir/tps_cat01.dbf','/u01/dumpdir/tps_cat02.dbf' to platform='Linux x86 64-bit' from platform='AIX-Based Systems (64-bit)' db_file_name_convert= '/u01/dumpdir','/u01/app/oracle/oradata/ora12c/ora12cpdb1';
数据文件转换必须在目标端进行,首先将源端的数据文件直接拷贝到目标库,然后再目标库进行转换