zoukankan      html  css  js  c++  java
  • 统计信息脚本

    ------------------表统计信息---------------------------------------------------------------------
    select t.owner,t.table_name,t.tablespace_name,t.last_analyzed,t.num_rows,t.blocks,t.avg_row_len from dba_tables t;
    select t.table_owner,t.table_name,t.partition_name,t.tablespace_name,t.last_analyzed,t.num_rows,t.blocks,t.avg_row_len from dba_tab_partitions t;
    select t.table_owner,t.table_name,t.partition_name,t.subpartition_name,t.tablespace_name,t.last_analyzed,t.num_rows,t.blocks,t.avg_row_len from dba_tab_subpartitions t;
    ------------------索引统计信息---------------------------------------------------------------------
    select t.owner,t.index_name,t.table_name,t.tablespace_name,t.last_analyzed,t.blevel,t.leaf_blocks,t.clustering_factor,t.distinct_keys,t.avg_leaf_blocks_per_key,t.avg_data_blocks_per_key,t.num_rows from dba_indexes t;
    select t.index_owner,t.index_name,t.partition_name,t.last_analyzed,t.blevel,t.leaf_blocks,t.clustering_factor,t.distinct_keys,t.avg_leaf_blocks_per_key,t.avg_data_blocks_per_key,t.num_rows from dba_ind_partitions t;
    select t.index_owner,t.index_name,t.partition_name,t.subpartition_name,t.tablespace_name,t.last_analyzed,t.blevel,t.leaf_blocks,t.clustering_factor,t.distinct_keys,t.avg_leaf_blocks_per_key,t.avg_data_blocks_per_key,t.num_rows from dba_ind_subpartitions t;
    ------------------列统计信息---------------------------------------------------------------------
    select t.owner,t.table_name,t.column_name,t.last_analyzed,t.num_distinct,t.num_nulls,t.low_value,t.high_value,t.density,t.num_buckets from dba_tab_col_statistics t;
    select t.owner,t.table_name,t.partition_name,t.t.num_distinct,t.num_nulls,t.low_value,t.high_value,t.density,t.num_buckets from dba_part_col_statistics t;
    select t.num_distinct,t.num_nulls,t.low_value,t.last_analyzed,high_value,t.density,t.num_buckets from dba_subpart_col_statistics t;
    ------------------直方图统计信息----------------------------------------------------------------------
    select * from dba_tab_histograms t;
    select * from dba_part_histograms t;
    select * from dba_subpart_histograms t;
    ------------------全局统计信息---------------------------------------------------------------------
    select t.table_name,t.last_analyzed,t.global_stats from dba_tables t;
    select t.table_name,t.partition_name,t.last_analyzed,t.global_stats from dba_tab_partitions t;
    select t.table_name,t.partition_name,t.subpartition_name,t.last_analyzed,t.global_stats from dba_tab_subpartitions t;
    select t.table_name,t.column_name,t.last_analyzed,t.global_stats from dba_tab_col_statistics t;
    select t.table_name,t.partition_name,t.column_name,t.last_analyzed,t.global_stats from dba_part_col_statistics t;
    select t.index_name,t.table_name,t.last_analyzed,t.global_stats from dba_indexes t;
    select t.index_name,t.partition_name,t.last_analyzed,t.global_stats from dba_ind_partitions t;
    select t.index_name,t.partition_name,t.subpartition_name,t.last_analyzed,t.global_stats from dba_ind_subpartitions t;

  • 相关阅读:
    CPU和Memory压力测试方法
    WIN 系统怎么样查看EXpressCache功能
    OGG 源端与目标端 约束不一致
    oracle 查询角色具有的权限
    Mysql 主从一致校验工具------Maatkit工具包
    从库找不到对应的被删除的记录
    python安装包是出现错误解决
    mysql5.7用户密码策略问题
    Centos7上安装docker
    SQL通过身份证获取信息
  • 原文地址:https://www.cnblogs.com/wcwen1990/p/6660454.html
Copyright © 2011-2022 走看看