zoukankan      html  css  js  c++  java
  • oracle 表空间大小

    今天有个项目由于数据量太大,系统性能降低,要做数据归档,提高系统性能,在归档前先调查数据库中各个表数据量大小为数据归档做准备。

    1、创建统计表

    create table statistics_all_tables
    (
    table_name varchar2(100),
    data_nums number(16),
    table_size number(16,4)
    )

    2、填充表数据

    1)获取表名称英文大写以及表记录数量

    insert into statistics_all_tables
    (table_name, data_nums, table_size)
    select table_name,num_rows, 0 from user_tables;

    注:重复统计时需要先删除统计表数据。

    2)统计表空间大小

    merge into statistics_all_tables t
    using (select sum(bytes) / (1024 * 1024) table_size,segment_name
    from user_segments
    where segment_type = 'TABLE'
    group by segment_name) s
    on (s.segment_name = t.table_name)
    when matched then
    update set t.table_size = s.table_size;

     注:表空间大小只能作为参考。

  • 相关阅读:
    python爬虫如何提高效率
    对 js加密数据进行爬取和解密
    爬虫之数据解析
    requests模块的基本使用
    python的零碎知识
    Django中多表关联的展示问题:
    ModelForm的基本用法:
    websocket的应用---Django
    DOM
    BOM
  • 原文地址:https://www.cnblogs.com/huanlingjisi/p/13140076.html
Copyright © 2011-2022 走看看