zoukankan      html  css  js  c++  java
  • Oracle分区表range单分区

    分区类型:rang、list、hash

    sql语句:select partitioning_type, subpartitioning_type,partition_count from user_part_tables  where table_name ='RANGE_PART_TAB';

    子分区:range-range、list-list、list-hash、list-range

    分区总数:select partition_count from user_part_tables where table_name='表名';

     在哪一个列上建分区:

     select column_name, object_type, column_position from user_part_key_columns where name='RANGE_PART_TAB';

    分区到底有多大:

    select sum(bytes)/1024/1024 from user_segments where segment_name='RANGE_PART_TAB';

    有多少个分区:

    select partition_name,segment_type,bytes from user_segments where segment_name='RANGE_PART_TAB';

    分区表的统计信息收集情况:

    select table_name,partition_name,last_analyzed,partition_position,num_rows from user_tab_statistics t where table_name='RANGE_PART_TAB';

    查该分区表有无索引,分别什么类型,全局索引是否失效,此外还可看统计信息收集情况:

    select table_name,index_name,last_analyzed,blevel,num_rows,leaf_blocks,distinct_keys,status from user_indexes where table_name='RANGE_PART_TAB';

    (N/A代表局部索引,否则就是全局索引)

    分区表在哪些列上建了索引:

    select index_name,column_name,column_position from user_ind_columns where table_name='RANGE_PART_TAB';

    该分区表上的各索引分别有多大:

    SQL> select segment_type,sum(bytes)/1024/1024 M  from user_segments where segment_name in (select index_name from user_indexes where table_name='RANGE_PART_TAB') group by segment_name,segment_type;

    该分区表的索引段的分配情况:

    select segment_name,partition_name,segment_type,bytes

      from user_segments

     where segment in (

       select index_name from user_indexes where table_name='RANGE_PART_TAB');

    分区索引相关信息及统计信息、是否失效查看:

    select t2.table_name,
              t1.index_name,
              t1.partition_name,
              t1.last_analyzed,
              t1.blevel,
              t1.num_rows,
              t1.leaf_blocks,
              t1.status
    from user_ind_partitions t1, user_indexes t2
    where t1.index_name = t2.index_name
    and t2.table_name='RANGE_PART_TAB';

    下一篇:range联合分区

  • 相关阅读:
    四天玩转 Windows Phone 开发教学视频
    DZNT REST API doc
    【译著】Code First :使用Entity. Framework编程(1)
    如何关闭ReSharper中的[ Use 'var' ]提示How to Disable C# “var” Recommendation in ReSharper
    查看域名txt记录
    VS文本编辑器vssettings下载站
    .net 开发windows服务
    .net 简单图表控件 (之总结篇 源代码及测试示例) [c/s桌面应用程序控件] IV
    c# 算节气
    js 自定义title提示框
  • 原文地址:https://www.cnblogs.com/yangyanhao/p/7867269.html
Copyright © 2011-2022 走看看