[oracle试验]跨渠道传输表空间 winITeyealibaba - 牛牛娱乐

[oracle试验]跨渠道传输表空间 winITeyealibaba

2018-11-22 07:38:49 | 作者: 语海 | 标签: 空间,传输,方针 | 浏览: 4401

从11g开端,oracle支撑跨渠道传输表空间。
检查支撑渠道列表,假如源库和方针库的endian format不一致,需求convert

SQL col platform_name for a32;
SQL select * from v$transportable_platform;
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
-  
 1 Solaris[tm] OE (32-bit) Big
 2 Solaris[tm] OE (64-bit) Big
 7 Microsoft Windows IA (32-bit) Little
 10 Linux IA (32-bit) Little
 6 AIX-Based Systems (64-bit) Big
 3 HP-UX (64-bit) Big
 5 HP Tru64 UNIX Little
 4 HP-UX IA (64-bit) Big
 11 Linux IA (64-bit) Little
 15 HP Open VMS Little
 8 Microsoft Windows IA (64-bit) Little
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
-  
 9 IBM zSeries Based Linux Big
 13 Linux x86 64-bit Little
 16 Apple Mac OS Big
 12 Microsoft Windows x86 64-bit Little
 17 Solaris Operating System (x86) Little
 18 IBM Power Based Linux Big
 19 HP IA Open VMS Little
 20 Solaris Operating System (x86-64 Little
 21 Apple Mac OS (x86-64) Little
20 rows selected.
运用传输表空间的约束:

1.源库和方针库有必要是相同的字符集和国家字符集 

SQL col parameter for a32;
SQL col value for a30;
SQL select * from nls_database_parameters;
PARAMETER VALUE
 
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET AL32UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.3.0
...... ......

2.一切要传输的表空间方针有必要是self-contained.意为:A表空间里的方针有引证B表空间的方针,那么表空间A和B都有必要包含在transpotable set里。 
不过不必忧虑,有DBMS_TTS包帮咱们检查

下面开端试验吧: 
source : windows oracle 11203 64bit
target : OEL 6.3   oracle 11203 64bit
platform,endian检查:
source:

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
 -
Microsoft Windows x86 64-bit Little

target:

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
 
Linux x86 64-bit Little

检查表空间是否是self-cotained:

SQL EXEC DBMS_TTS.TRANSPORT_SET_CHECK(ERM,TRUE);
PL/SQL procedure successfully completed.

在TRANSPORT_SET_VIOLATIONS视图检查履行成果,假如有依靠方针不在供给的tablespace里,会给出具体提示

SQL SELECT * FROM TRANSPORT_SET_VIOLATIONS;
no rows selected

生成传输表空间集:

SQL ALTER TABLESPACE ERM READ ONLY;
Tablespace altered.
SQL create directory erm_dump_dir as E:\app\susu\dumpdir\;
Directory created.
SQL grant read,write on directory erm_dump_dir to szpdc;
Grant succeeded.
SQL host
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32 expdp system/password dumpfile=erm_tts.dmp directory=erm_dum
p_dir transport_tablespaces=ERM

运用RMAN convert转化文件格局:

C:\Windows\system32 rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Fri May 24 14:41:32 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ERMDB (DBID=1977612728)
RMAN convert tablespace ERM to platform Linux x86 64-bit format e:\%N%f;
Starting conversion at source at 24-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=194 device type=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00006 name=E:\APP\SUSU\ORADATA\ERMDB\ERM01.DBF
converted datafile=E:\ERM6
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
Finished conversion at source at 24-MAY-13

将RMAN CONVERT生成的transport tablespace set和 expdp导出的文件 copy到方针数据库
我这儿复制到了 

[oracle@db1 dumpdir]$ pwd
/s01/app/oracle/dumpdir
[oracle@db1 dumpdir]$ ls
ERM6 ERM_TTS.DMP import.log

接下来,在方针数据库操作:

RMAN convert datafile /s01/app/oracle/dumpdir/ERM6 db_file_name_convert /s01/app/oracle/dumpdir/ERM6,/s01/app/oracle/oradata/DB11G/erm01w.dbf;
Starting conversion at target at 24-MAY-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile conversion
input file name=/s01/app/oracle/dumpdir/ERM6
converted datafile=/s01/app/oracle/oradata/DB11G/erm01w.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
Finished conversion at target at 24-MAY-13
Starting Control File and SPFILE Autobackup at 24-MAY-13
piece handle=/s01/app/oracle/fast_recovery_area/DB11G/autobackup/2013_05_24/o1_mf_s_816275177_8sy4cc2w_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 24-MAY-13
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表牛牛娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章