table/index/LOBINDEX迁移表空间

来源:这里教程网 时间:2026-03-03 16:40:58 作者:

1、alter table tablename move tablespace tbs_name 2、select 'alter index '||index_name||' rebuild tablespace $lts;' from user_indexes; 3、当我们建立一个含有lob字段的表时,oracle会自动为lob字段建立两个单独的segment,一个用来存放数据(LOBSEGMENT),另一个用来存放索引(LOBINDEX),并且它们都会存储在对应表指定的表空间中。但是当我们用alter table tablename move tablespace tbs_name 来对表做空间迁移时,只能移动非lob字段以外的数据。而如果我们要同时移动lob相关字段的数据,我们就必需用如下的含有特殊参数据的文句来完成,它就是: alter table tablename move lob(columeName) store as (tablespace newTableSpaceName); 这样,就将这两个对象从老的表空间移至新的表空间 。

4、LOB索引的特殊性使得REBUILD是不可行的。 要移动LOB索引到其他表空间,需要将相应的LOB对象移动到其他表空间。 CREATE TABLE TEST(ID INT,NAME VARCHAR2(20),CONTENTS CLOB); ALTER INDEX "SYS_IL0000052966C00003$$" REBUILD;

第 1 行出现错误: ORA-02327: 无法以数据类型 LOB 的表达式创建索引 ORA-14133: ALTER TABLE MOVE cannot be combined with other operations

desc TEST ALTER TABLE TEST MOVE LOB(CONTENTS) STORE AS (TABLESPACE TS1);

相关推荐