RMAN跨小版本跨平台与字节序传输表空间(一)

2015-04-07 14:09:45 · 作者: · 浏览: 90

将Linux平台上的源数据库中的tspitr与test表空间传输到AIX平台上。并在源主机上使用目录/u02/transport来存储被转换的数据文件。操作步骤如下:


1.将要被传输的表空间tspitr与test设置为只读
SQL> alter tablespace tspitr read only;


Tablespace altered.


SQL> alter tablespace test read only;


Tablespace altered.



2.检查源平台与目标平台信息支不支持传输操作
?数据库所支持的平台信息:
SQL> select platform_name,endian_format from v$transportable_platform;


PLATFORM_NAME? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ENDIAN_FORMAT
-------------------------------------------------------------------------------- --------------
Solaris[tm] OE (32-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
Solaris[tm] OE (64-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
Microsoft Windows IA (32-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
Linux IA (32-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
AIX-Based Systems (64-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
HP-UX (64-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
HP Tru64 UNIX? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
HP-UX IA (64-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
Linux IA (64-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
HP Open VMS? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
Microsoft Windows IA (64-bit)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
IBM zSeries Based Linux? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
Linux x86 64-bit? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
Apple Mac OS? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
Microsoft Windows x86 64-bit? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
Solaris Operating System (x86)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
IBM Power Based Linux? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Big
Solaris Operating System (x86-64)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little
HP IA Open VMS? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little



源平台:
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 64-bit for AMD? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Little


?


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


?


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


PL/SQL procedure successfully completed.



SQL> exec sys.dbms_tts.transport_set_check('TEST',true);


PL/SQL procedure successfully completed.


SQL> select * from sys.transport_set_violations;


no rows selected



如果没有行选择,表示该表空间只包含表数据,可以传输。


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


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


SQL> select count(*) from test.test;


? COUNT(*)
----------
? ? 50316


Recovery Manager: Release 10.2.0.5.0 - Production on Mon Mar 30 10:35:41 2015


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


connected to target database: TEST (DBID=2168949517)



RMAN> convert tablespace "TSPITR","TEST"
2> to platform 'AIX-Based Systems (64-bit)'
3> format ='/u02/transport/%U';


Starting backup at 2015-03-30 10:37:27
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
channe