zoukankan      html  css  js  c++  java
  • Oracle-降低表的高水位线

    在应用中存在一系列的表,对表的操作是批量插入又批量删除,最终导致表的水位线很高。高水位线影响全索引扫描的SQL。即影响系统的性能。

    现有方法降低表的水位线:

    1、降低表的高水位线
    select 'alter table '||TABLE_NAME||' move tablespace '||TABLESPACE_NAME||';' from user_tables where table_name='&TABLE_NAME';
    2、重建表上的索引
    select 'alter index '||index_name||' rebuild online;' from user_indexes where table_name='&TABLE_NAME';
    3、收集表上的统计信息
    select 'analyze table '||TABLE_NAME||' compute statistics;' from user_tables where table_name='&TABLE_NAME';
    4、收集索引上的统计信息
    select 'analyze index '||index_name||' compute statistics;' from user_indexes where table_name='&TABLE_NAME';

    注意:

    1、需将对应的表名替换'&TABLE_NAME',表名要大写,依次执行上述步骤的“查询结果”;

    2、需停服务执行,否则脚本报错;

  • 相关阅读:
    sed命令
    python常用库
    python标准库
    从 Python 打包到 CLI 工具
    pip
    python包自我理解
    docker常用命令
    chattr命令
    xmss
    live2d-widget.js
  • 原文地址:https://www.cnblogs.com/handhead/p/13158177.html
Copyright © 2011-2022 走看看