看了一下doc里面的表空间传输相关内容,自己做了9i的
测试,基本成功,不过由于开始对一些
概念不理解。所以有些不是很明白。经过一些挫折,后来还是成功了,这个功能很不错。建议大家在实际的业务生产中可以使用。
C:\>sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 1月 9 19:44:45 2008
Copyright (c) 1982, 2002,
Oracle Corporation. All rights reserved.
连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> CREATE TABLESPACE "TEST" LOGGING DATAFILE 'D:\ORACLE\ORADATA\ZERO\TEST.ora'
2 SIZE 50M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
3 /
表空间已创建。
SQL> alter tablespace test read only;
表空间已更改。
SQL> execute dbms_tts.transport_set_check('TEST',TRUE);
PL/SQL 过程已成功完成。
SQL> host exp tablespaces=test transport_tablespace=y file=exp_ts_users.dmp
Export: Release 9.2.0.1.0 - Production on 星期三 1月 9 19:48:07 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
用户名: sys/sys as sysdba
连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
注: 将不会导出表数据(行)
关于导出可传输的表空间元数据...
用于表空间 TEST...
. 正在导出群集定义
. 正在导出表定义
. 正在导出引用完整性约束条件
. 正在导出触发器
. 结束导出可传输的表空间元数据
在没有警告的情况下成功终止导出。
SQL> drop tablespace including contents;
drop tablespace including contents
*
ERROR 位于第 1 行:
ORA-02173: 无效的 DROP TABLESPACE 选项
SQL> drop tablespace test including contents;
表空间已丢弃。
SQL> host imp tablespaces=test transport_tablespace=y file=exp_ts_users.dmp datafiles='D:\oracle\oradata\zero\TEST.ORA'
Import: Release 9.2.0.1.0 - Production on 星期三 1月 9 19:51:10 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
用户名: sys/sys as sysdba
连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
经由常规路径导出由EXPORT:V09.02.00创建的文件
关于导入可传输表空间元数据...
已经完成ZHS16GBK字符集和AL16UTF16 NCHAR 字符集中的导入
. 正在将SYS的对象导入到 SYS
成功终止导入,但出现警告。
SQL> set autotrace off
SQL> select file#,name from v$datafile;
FILE#
----------
NAME
----------------------------------------------------------------------------------------------------
1
D:\ORACLE\ORADATA\ZERO\SYSTEM01.DBF
2
D:\ORACLE\ORADATA\ZERO\UNDOTBS01.DBF
3
D:\ORACLE\ORADATA\ZERO\DRSYS01.DBF
4
D:\ORACLE\ORADATA\ZERO\INDX01.DBF
5
D:\ORACLE\ORADATA\ZERO\TOOLS01.DBF
6
D:\ORACLE\ORADATA\ZERO\USERS01.DBF
7
D:\ORACLE\ORADATA\ZERO\XDB01.DBF
8
D:\ORACLE\ORADATA\ZERO\MOF.ORA
9
D:\ORACLE\ORADATA\ZERO\TEST.ORA