在oracle10g之前,数据文件是不能跨平台传输使用的,从oracle 10g开始,oracle支持跨平台表空间传输(transport tablespace)。
数据文件不能跨平台的原因是:不同平台操作系统的字、字节存储顺序不同
如果将4567这个数据存储到不同的系统中,那么就会出现如下的顺序:
little-endian:存储的顺序是7654,小数在前(windows平台,LINUX平台)
big-endian:存储的顺序是4567,大数在前(solaris及aix平台)
本文主要描述采用oracle的transport tablespace技术,实现不同字节序跨平台迁移。
注意:传输表空间技术不能应用于system表空间或sys用户拥有的对象
源平台(AIX6.1+ oracle 11.2.0.4.0)相关信息如下
SQL> select * from v$version where rownum=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SQL> set lines 200
SQL> col platform_name for a30;
SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d where tp.platform_name=d.platform_name;
PLATFORM_NAME ENDIAN_FORMAT
------------------------------ --------------
AIX-Based Systems (64-bit) Big
目的平台(linux5.8+ oracle 11.2.0.4.0)相关信息如下
SQL> select * from v$version where rownum=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d where tp.platform_name=d.platform_name;
PLATFORM_NAME ENDIAN_FORMAT
------------------------------ --------------
Linux x86 64-bit Little
从上面的输出可以看到字节顺序是不同的, Linux平台是 低位 (Little),aix 平台是高位(Big)
实施如下; 前提条件: a,在源和目标库构建directory(以sysdba用户) b,以system用户在源和目标库进行expdp/impdp c,在源库