zoukankan      html  css  js  c++  java
  • Oracle 11g R2 alter index rebuild online

    索引因历史原因都放在初始的索引表空间里,导致索引表空间不断添加数据文件。

    再加上历史数据的归档,索引从来没维护过。

    就想把大的索引维护下。

    后来alter index rebuild online的时候,报临时表空间无法分配extent,然后alter index rebuild online就结束了。

    个人理解:alter index rebuild online会在临时表空间中创建索引,创建完成后再去替换以前的索引。

    所以如果alter index rebuild online创建的索引,临时表空间容纳不下就会失败。但不会影响以前的索引。

    如何评估alter index rebuild online之后索引的大小呢?

    使用oracle段顾问,会告诉你会收缩多少空间。

    假如我一个索引100G(通过dba_segments查询),我临时表空间是20G,我使用段顾问得出的结果是可以收缩60G,那我alter index rebuild online后索引的大小在40G左右,所以我临时表空间要大于40G。

    alter index rebuild onlie的过程中,可以通过dba_temp_free_space查看临时表空间剩余大小。

    如果我不想调整临时表空间的大小,我可以创建新的临时表空间,并设置为默认临时表空间,等alter index rebuild online完成之后,再把以前的临时表空间设置为默认临时表空间,把后来创建的临时表空间drop掉。

    索引多大需要rebuild?这个应该没有定论,主要看松散程度吧

    一般索引高度大于4就建议rebuild(从书上看的LCLFP8HNRUT0200)[E(TP]2

  • 相关阅读:
    Codeforces Beta Round #92 (Div. 2 Only) B. Permutations 模拟
    POJ 3281 Dining 最大流 Dinic算法
    POJ 2441 Arrange the BUlls 状压DP
    URAL 1152 Faise Mirrors 状压DP 简单题
    URAL 1039 Anniversary Party 树形DP 水题
    URAL 1018 Binary Apple Tree 树形DP 好题 经典
    pytorch中的forward前向传播机制
    .data()与.detach()的区别
    Argparse模块
    pytorch代码调试工具
  • 原文地址:https://www.cnblogs.com/cnmarkao/p/9113319.html
Copyright © 2011-2022 走看看