zoukankan      html  css  js  c++  java
  • 05396

    Examine the following command:
    SQL> ALTER TABLE booking SHRINK SPACE COMPACT;
    Which activity is performed when the preceding command is executed?
    A. The shrink operation touches every block in the BOOKING table
    B. The high-water mark (HWM) for the BOOKING table is shifted from its original position
    C. The progress of the shrink operation is saved in the bitmap blocks of the BOOKING table
    D. The data manipulation language (DML) triggers on the BOOKING table are executed because the shrink operation is internally handled by the INSERT/DELETE operation

      SHRINK SPACE 可以作用在表,组织索引表,索引,分区,子分区,物化视图或物化视图日志上。如果并不想释放这些未使用的空间,可以使用 coalesce。还可以增加 cascade 来对所有相关的段对象进操作。
    --需要自动段管理和开启行迁移,并且关闭基于 rowid 的触发器。
      如果有长时间运行的查询,而且这些查询可能跨越收缩操作,并尝试从已回收的块中读取数据,则COMPACT 子句会很有用。指定 SHRINK SPACE COMPACT 子句时,碎片整理和压缩结果保存到了磁盘(表中的位图块中)。 这样就将一个长的操作,分为 2 个短操作,首先使用 compact,进行整理和压缩,然后再在业务低峰期运行 shrink space,此时数据不必再重新移动,将进行空间的重新分配和重置高位。
    还可以使用 DEALLOCATE UNUSED 来释放未使用的空间 (回收高水位之上的未使用块)
    ALTER TABLE table DEALLOCATE UNUSED KEEP integer;
    ALTER INDEX index DEALLOCATE UNUSED KEEP integer;
    ALTER CLUSTER cluster DEALLOCATE UNUSED KEEP integer;
    keep 后面的数值是 检查 DBA_FREE_SPACE 视图中的数值

  • 相关阅读:
    logstash 收集nginx 日志 linux
    logstash 收集nginx 日志 windows
    记一次大坑,淘宝联盟百川登录授权方式
    Python常用库
    这个 MySQL bug 让我大开眼界
    备胎是这样转正的---浅谈keepalived工作原理
    vite首次启动加载慢
    frpc启动时提示:login to server failed: EOF
    OSCP整理笔记
    HikariCP连接池监控指标实战
  • 原文地址:https://www.cnblogs.com/Babylon/p/7839134.html
Copyright © 2011-2022 走看看