日期:2014-05-16  浏览次数:20460 次

transport tablespace基本用法
C:>sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on 星期六 9月 17 20:07:36 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect sys as sysdba
请输入口令:
已连接。
SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
test

SQL> create tablespace test datafile 'D:oracleoradatatesttest.dbf' size 1m;

表空间已创建。

SQL> connect xys/manager
已连接。
SQL> create table t(id int);

表已创建。

SQL> insert into t values(1);

已创建 1 行。

SQL> commit;

提交完成。

SQL> select default_tablespace from dba_users where username='XYS';

DEFAULT_TABLESPACE
------------------------------
USERS

SQL> create index t_idx on t(id) tablespace test;

索引已创建。

SQL> exec dbms_tts.transport_set_check('test' , true);
BEGIN dbms_tts.transport_set_check('test' , true); END;

*
ERROR 位于第 1 行:
ORA-06550: 第 1 行, 第 7 列:
PLS-00201: 必须说明标识符 'DBMS_TTS.TRANSPORT_SET_CHECK'
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored


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

PL/SQL 过程已成功完成。

SQL> select * from transport_set_violations;
select * from transport_set_violations
*
ERROR 位于第 1 行:
ORA-00942: 表或视图不存在


SQL> connect sys as sysdba
请输入口令:
已连接。
SQL> select * from transport_set_violations;

未选定行

SQL> alter tablespace test read only;

表空间已更改。

SQL> host exp transport_tablespace=y tablespace=test file=d:test.dmp;
LRM-00101: 未知的参数名 'tablespace'

EXP-00019: 处理参数失败,有关帮助请键入 'EXP HELP=Y'
EXP-00000: 导出终止失败

SQL> host exp transport_tablespace=y tablespaces=test file=d:test.dmp;

Export: Release 9.2.0.1.0 - Production on 星期六 9月 17 20:14:30 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


用户名: / 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 字符集
注: 将不会导出表数据(行)
关于导出可传输的表空间元数据...
EXP-00008: 遇到 ORACLE 错误 29341
ORA-29341: 可传送集不是自包含的
ORA-06512: 在"SYS.DBMS_PLUGTS", line 1093
ORA-06512: 在line 1
EXP-00000: 导出终止失败

SQL> drop index xys.t_idx;

索引已丢弃。

SQL> create table xys.tt(id int) tablespace test;
create table xys.tt(id int) tablespace test
*
ERROR 位于第 1 行:
ORA-00955: 名称已由现有对象使用


SQL> create table xys.t_t(id int) tablespace test;
create table xys.t_t(id int) tablespace test
*
ERROR 位于第 1 行:
ORA-01647: 表空间'TEST'是只读,无法在其中分配空间


SQL> alter tablespace test read write;

表空间已更改。

SQL> create table xys.t_t(id int) tablespace test;

表已创建。

SQL> insert into xys.t_t values(1);

已创建 1 行。

SQL> commit;

提交完成。

SQL> select * from transport_set_violations;

未选定行

SQL> show user
USER 为"SYS"
SQL> alter tablespace test read only;

表空间已更改。

SQL> host exp transport_tablespace=y tablespace=test file=d:test.dmp;
LRM-00101: 未知的参数名 'tablespace'

EXP-00019: 处理参数失败,有关帮助请键入 'EXP HELP=Y'
EXP-00000: 导出终止失败

SQL> host exp transport_tablespace=y tablespaces=test file=d:test.dmp;

Export: Release 9.2.0.1.0 - Production on 星期六 9月 17 20:17:09 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


用户名: / as sysdba

连接到: Oracle9i Enterprise Edition Rel