zoukankan      html  css  js  c++  java
  • 将索引移动到别的表空间

    最开始以为index也可以使用move命令来移动表空间,结果想法错了

    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 ;

    索引已更改。

    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 ,nologigng ,parallel 可以省略 online表示重建索引时不对原表的dml操作产生影响,nologging只是为了加速索引的创建速度,

    parallel也是为了加快索引创建速度,不过使用parallel时要小心,不能在资源不足的情况下使用,否者产生direct path read /write等待事件。

  • 相关阅读:
    实现ls(课上作业)
    20181217 (2)
    20181217 (1)
    ubuntu开启远程ssh登陆本机功能
    解决ubuntu下Could not get lock的问题
    博客园生成目录结构
    np.mean以及np.std用法
    解决 Could not find a version that satisfies the requirement torch==1.4.0
    github下载ocr模型 windows直接解压出问题
    centos7 连接不上网络解决办法
  • 原文地址:https://www.cnblogs.com/hehe520/p/6330658.html
Copyright © 2011-2022 走看看