alter table tb_name move tablespace tbs_name lob (col_lob1,col_lob2) store as(tablesapce tbs_name); 如果表特别多,可以生产一个执行的脚本。 select 'alter index '||OWNER||'.'||index_NAME||' rebuild tablespace tablespace_name;' from dba_indexes where OWNER='USERS'; select 'alter table ...
*LONG,LOB大字段类型move来进行测试和说明。 索引的move,我们通过rebuild来实现。 一:move普通表、索引基本语法: alter table tab_name move tablespace tbs_name; move过的普通表,在不用到失效的索引的操作语句中,语句执行正常,但如果操作的语句用到了索引(主键当做唯一索引),则此时报告用到的索引失效,语句执行失...
move操作时,会在表上添加exclusive lock,此时不允许其它DML操作,仅可以查询。 move操作时,需要目标tablespace中有1倍于表大小的空闲空间以供使用。 move操作后,数据的rowid发生了改变,所以表上的index是必须要rebuild的。 本案例中数据库版本为11.2.0.4,只在表的当前表空间中进行move 操作,本次不涉及lob字段。 一...
SQL> alter table app_xml_config move tablespace large_data lob(xml) store as lobsegment(tablespace large_data); Table altered. 对于上千张表来说,使用如下的sql能够自动生成move tablespace的语句。 --对表中的非lob列进行move tablespace操作 select 'alter table '|| table_name||' move tablespace larg...
分区表lob的move: alter table T_SEND_LOG move partition p2018 lob(MESSAGE) store as (tablespace DATALOB); 分区表move: alter table T_SEND_LOG move partition p2018; move表后记得rebuild索引。 批量生成语句参考: 针对表空间: select 'alter table '||a.owner||'.'||a.table_name||' move lob...
create tablespace "dbtest" datafile '/data/dmdata/DAMENG/DBTEST.DBF' size 2048; --创建表空间dbtest,数据文件为DBTEST.DBF,打开数据库文件自动扩展。 (2)创建 OT-DM 用户并授予权限,使用 dbtest 表空间。 create user "OT-DM" identified by "密码" --创建用户 default tablespace "dbtest"--指定用户...
清理CLOB字段及压缩CLOB空间 1、创建LOB字段存放表空间: create tablespace lob_test datafile '/oracle/data/lob_test.dbf' size 500m autoextend on next 10m maxsize unlimited 2、移动LOB字段到单独存放表空间: ALTER TABLE CENTER_ADMIN.NWS_NEWS MOVE LOB(ABSTRACT) STORE AS (TABLESPACE lob_test); ...
1、select * from user_indexes where index_name like 'SYS%';--通过这个语句查询出含有LOB字段相关的表格。 2、desc SCREENING_IWL_ENTITY; 3、ALTER TABLE 表名 MOVE LOB('含有LOB的字段名') STORE AS(TABLESPACE 索引表空间名);
lob类型的数据全部存储在表空间中,表中只存放指针,即使在建表时没指定表空间,数据也全部存入该数据库默认表空间中。 例如用alter table tb_name move tablespace tbs_name 来对表做空间迁移时只能移动非lob字段以外的数据。 创建lob字段表空间 \ create tablespace lob_data datafile ``'+DATA01' size 10G AUTOEX...
select 'alter table '|| table_name|| ' move tablespace new_tbsp;' from user_tables where tablespace_name = 'tbsp_name' --第2类:移动【索引】所在表空间:如将索引index_name 移动到新的new_tbsp表空间(LOB数据类型的字段需按如下第3类处理) ...