Oracle跨版本与平台执行传输表空间(2)

源平台:
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

目标平台:
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

3.确认要被传输的表空间是否是自包含表空间(TSPITR):
SQL> exec sys.dbms_tts.transport_set_check('TSPITR',true);

PL/SQL procedure successfully completed.

SQL> select * from sys.transport_set_violations;

no rows selected


没有记录,表示该表空间只包含表数据,可以传输。

4.记录表空间传输前表tspitr中的记录:
SQL> select count(*) from tspitr.tspitr;

COUNT(*)
----------
    50315


5.使用RMAN将源数据库中的表空间tspitrt转换为目标平台字节序格式,使用format参数来控制被转换后数据文件的文件名和存储目录.
[IBMP740-1:Oracle:/yb_oradata/transport]$export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
[IBMP740-1:oracle:/yb_oradata/transport]$rman target/

Recovery Manager: Release 10.2.0.4.0 - Production on Mon Oct 24 17:07:59 2016

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: RLZY (DBID=1589671076)

RMAN> convert tablespace "TSPITR" to platform 'Linux x86 64-bit'  format ='/yb_oradata/transport/%U';

Starting backup at 2016-10-24 17:09:31
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1265 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00021 name=/yb_oradata/transport_after/TSPITR01.DBF
converted datafile=/yb_oradata/transport/data_D-RLZY_I-1589671076_TS-TSPITR_FNO-21_orrj67ic
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
Finished backup at 2016-10-24 17:09:35

[IBMP740-1:oracle:/yb_oradata/transport]$ls -lrt
total 102416
-rw-r-----    1 oracle  dba        52436992 Oct 24 17:09 data_D-RLZY_I-1589671076_TS-TSPITR_FNO-21_orrj67ic


6.使用导出工具创建传输表空间元数据dump文件
SQL> create or replace directory test_dump as '/yb_oradata/transport';

Directory created.

SQL> grant read,write on directory test_dump to public;

Grant succeeded.

-rw-r-----    1 oracle  dba        52436992 Oct 24 17:09 data_D-RLZY_I-1589671076_TS-TSPITR_FNO-21_orrj67ic
[IBMP740-1:oracle:/yb_oradata/transport]$ expdp \'sys/admin_7817600@RLZY as sysdba\' directory=test_dump dumpfile=tspitr.dmp logfile=tspitr.log

transport_tablespaces=TSPITR                                                      < Export: Release 10.2.0.4.0 - 64bit Production on Monday, 24 October, 2016 17:12:42

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/eb70c6943d0564a04149e4b339bb64c6.html