oracle 10g 传输表空间的测试

第一:同一平台传输表空间测试

F:\oracle\product\10.2.0\db_1\BIN>sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:10:54 2008

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


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> create tablespace paul datafile 'd:\paul01.dbf'  size 50M;

SQL> create user paul identified by paul default tablespace paul;

用户已创建。

SQL> grant connect,resource,dba to paul;

授权成功。

SQL> conn paul/paul
已连接。

SQL> create table paultable (a int);

表已创建。

SQL> insert into paultable values(100);

已创建 1 行。

SQL> commit;

提交完成。

SQL> select * from paultable;

         A
----------
       100

SQL> alter tablespace paul read only;

表空间已更改。

SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

导出表空间

F:\oracle\product\10.2.0\db_1\BIN>exp userid='sys/abcdefg as sysdba' tablespaces
=paul transport_tablespace=y file=c:\exp_ts_paul.dmp

Export: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:13:54 2008

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
注: 将不导出表数据 (行)
即将导出可传输的表空间元数据...
对于表空间 PAUL...
. 正在导出簇定义
. 正在导出表定义
. . 正在导出表                       PAULTABLE
. 正在导出引用完整性约束条件
. 正在导出触发器
. 结束导出可传输的表空间元数据
成功终止导出, 没有出现警告。

拷贝

exp_ts_paul.dmp和数据文件paul01.dbf 到另外同平台数据库的D盘上

在另外同平台服务器进行传输表空间导入:

C:\Documents and Settings\paul>imp userid='sys/abcdefg as sysdba' file='d:\exp_t
s_paul.dmp' transport_tablespace=y datafiles='d:\paul01.dbf'

Import: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:44:08 2008

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

经由常规路径由 EXPORT:V10.02.01 创建的导出文件
即将导入可传输的表空间元数据...
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. 正在将 SYS 的对象导入到 SYS
. 正在将 SYS 的对象导入到 SYS
. 正在将 PAUL 的对象导入到 PAUL
. . 正在导入表                     "PAULTABLE"
. 正在将 SYS 的对象导入到 SYS
成功终止导入, 没有出现警告。


SQL> select * from paultable;

         A
----------
       100

 

注意地方:

  1.只能新建个用户默认所属表空间为需要导出的表空间 不能建立在sys或system用户下

     例如 在sys或system用户下 

    create table  paultable  (a int) tablespace paul;  会报以下错误

  F:\oracle\product\10.2.0\db_1\BIN>exp userid='sys/abcdefg as sysdba' tablespaces
=paul transport_tablespace=y file=c:\exp_ts_paul.dmp

Export: Release 10.2.0.1.0 - Production on 星期一 6月 2 09:09:47 2008

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
注: 将不导出表数据 (行)
即将导出可传输的表空间元数据...
EXP-00008: 遇到 ORACLE 错误 29341
ORA-29341: 可传送集不是自包含的
ORA-06512: 在 "SYS.DBMS_PLUGTS", line 1387
ORA-06512: 在 line 1
EXP-00000: 导出终止失败

2.目标数据库必须建立对应的用户 要不导入时会报对应用户不存在 而导致导入失败

请使用浏览器的分享功能分享到微信等