您的位置:首页 > 其它

将索引移动到别的表空间

2015-01-18 20:40 162 查看
alter index index_name rebuild tablespace tablespace_name online nologging parallel;

SQL> select segment_name,segment_type,tablespace_name from user_segments where segment_name='EMP_DEPTNO';

SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME

--------------------------------------------------------------------------------- ------------------ ----------------------------

EMP_DEPTNO INDEX MY_INDEX

SQL> alter index emp_deptno rebuild online tablespace users nologging parallel 4 ;

索引已更改。

SQL> select segment_name,segment_type,tablespace_name from user_segments where segment_name='EMP_DEPTNO';

SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME

--------------------------------------------------------------------------------- ------------------ -------------------

EMP_DEPTNO INDEX USERS

online表示重建索引时不对原表的dml操作产生影响,

nologging只是为了加速索引的创建速度,

parallel也是为了加快索引创建速度,不过使用parallel时要小心,不能在资源不足的情况下使用,否者产生direct path read /write等待事件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: