oracle按表空间迁移,表空间迁移(一)

blog 结构图:

26736162_1420523353n2Rt.png

1场景描述

源平台为:windows xp 32系统+ oracle 11.2.0.1.0  + ORACLE_SID=orcl

目标平台:rhel6.5 + oracle 11.2.0.1.0 + asm 64位+ ORACLE_SID=orclasm

目标:要实现将自定义的应用程序表空间app1tbs,app2tbs,idxtbs从源平台传递到目标平台

注:

①从linux到windows 下参考:http://blog.itpub.net/26736162/viewspace-1375260/

②source和target database的数据库版本最好一致,否则会因为db time zone不一致导致报如下错误,但是source如果大于target的话是可以的,向下兼容的ORA-39002: invalid operation

ORA-39322: Cannot use transportabletablespace with timestamp with timezone columns and different timezone version.

26736162_1420523354HdZZ.png

2环境准备

26736162_1420523354z2VX.png

2.1在源库上创建3个用户应用的表空间

C:\Users\Administrator>sqlplus lhr/lhr@orclxp

SQL*Plus: Release 11.2.0.1.0 Production on 星期一5 17:15:22 2015

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

连接到8行。

SQL>

SQL>

2.2在相应的表空间创建表和索引

SQL> create table scott.app1_tab tablespace app1tbs as select * from scott.emp;

Table created.

SQL> create table scott.app2_tab tablespace app2tbs as select * from scott.dept;

Table created.

SQL> create index scott.idx_emp_ename on scott.app1_tab(ename) tablespace idxtbs;

Index created.

SQL> create index scott.idx_dept_dname on scott.app2_tab(dname) tablespace idxtbs;

Index created.

SQL>

3判断平台支持并确定字节序

如果传输表空间集到不同的平台,则要确定对于源和目标平台这种跨平台表空间被支持,也要确定每个平台的字节序,如果平台具有相同的字节序,则不需要进行转化,否则必须做一个表空间集转化,在源端或目标端。3.1在源平台查询

SQL> col platform_name for a40

SQL> select d.platform_name,tp.endian_format from v$transportable_platform tp,v$database d

2  where tp.platform_name=d.platform_name;

PLATFORM_NAME                            ENDIAN_FORMAT

---------------------------------------- --------------

Microsoft Windows IA (32-bit)            Little

结论:当前的系统平台支持跨平台表空间传输(因为上面的查询有记录返回)

3.2在目标平台查询

SQL> col platform_name for a40

SQL> select d.platform_name,tp.endian_format from v$transportable_platform tp,v$database d

2  where tp.platform_name=d.platform_name;

PLATFORM_NAMEENDIAN_FORMAT

---------------------------------------- --------------

Linux x86 64-bitLittle

SQL>

结论: 当前的平台支持跨平台的表空间传输源平台和目标平台的Endian_format 相同(均为Little),不需要进行表空间集转换

4选择自包含的表空间集(目前要传输app1tbs和idxtbs这2个表空间)4.1进行检查

Indicates whether a full or partial dependency check is required. If TRUE, treats all IN and OUT pointers(dependencies) and captures them as violations if they are not self-contained in the transportable set.

SQL> execute sys.dbms_tts.transport_set_check('app1tbs,idxtbs',true);

PL/SQL procedure successfully completed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值