简单看一下达梦表空间使用-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3502421
  • 博文数量: 718
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7790
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(718)

文章存档

2024年(4)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客
相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: 数据库开发技术

2023-11-25 14:01:39


  1. set lineshow off
  2.   select tablespace_name,
  3.          ts_type,
  4.          trunc(ts_curr_total)as cur_size_mb,
  5.          trunc(ts_curr_total-used) as curr_free_mb,
  6.          trunc(used) as used_mb,
  7.          trunc(pct_curr_used) as curr_used_pct,
  8.          decode(status,
  9.                          0, 'online',
  10.                          'offline') as status,
  11.          trunc(ts_total) as max_size_mb,
  12.          trunc(ts_total-used) as free_mb,
  13.          trunc(pct_used) as used_pct
  14.     from ( select df.name as tablespace_name,
  15.                    'permanent' as ts_type,
  16.                    status$ as status,
  17.                    max_size as ts_total,
  18.                    curr_max_size as ts_curr_total,
  19.                    decode((max_size - used_size_t),
  20.                                     null, 0,
  21.                                     max_size - used_size_t) as free,
  22.                    decode((curr_max_size - used_size_t),
  23.                                     null, 0,
  24.                                     curr_max_size - used_size_t) as curr_free,
  25.                    decode(used_size_t,
  26.                                     null, 0,
  27.                                     used_size_t) as used,
  28.                    decode(used_size_t,
  29.                                     null, 0,
  30.                                     round(cast(used_size_t / curr_max_size as decimal) * 100)) as pct_curr_used,
  31.                    decode(used_size_t,
  32.                                     null, 0,
  33.                                     round(cast(used_size_t / max_size as decimal) * 100)) as pct_used
  34.               from (select a.name,
  35.                             a.id,
  36.                             a.status$,
  37.                             sum(cast(b.total_size - b.free_size as decimal) * page() / 1024 / 1024) as used_size_p,
  38.                             sum(case auto_extend when 0 then cast(b.total_size as decimal) * page() / 1024 / 1024 when 1 then b.max_size end) as max_size,
  39.                             sum(cast(b.total_size as decimal) * page() / 1024 / 1024) as curr_max_size
  40.                        from v$datafile b,
  41.                             v$tablespace a
  42.                       where b.group_id = a.id and a.name not in ('temp',
  43.                                                                  'roll')
  44.                    group by a.name,
  45.                             a.id,
  46.                             a.status$) df
  47.          left join (select ts_id,
  48.                             sum(n_full_extent n_free_extent n_frag_extent) * sf_get_extent_size() * page() / 1024 / 1024 as used_size_t
  49.                        from v$segment_infos
  50.                    group by ts_id) seg
  51.                 on seg.ts_id = df.id
  52.          union all
  53.          select tablespace_name,
  54.                 'undo' as ts_type,
  55.                 status,
  56.                 ts_total,
  57.                 total as ts_curr_total,
  58.                 free,
  59.                 free as curr_free,
  60.                 (total - free) as used,
  61.                 round(cast((total - free) as decimal) * 100 / total) pct_curr_used,
  62.                 round(cast((total - free) as decimal) * 100 / ts_total) pct_used
  63.            from (select t.name tablespace_name,
  64.                          t.status$ status,
  65.                          sum(cast(free_size as decimal) * page() / 1024 / 1024) as free,
  66.                          sum(cast(d.total_size as decimal) * page() / 1024 / 1024) as total,
  67.                          sum(case auto_extend when 0 then cast(d.total_size as decimal) * page() / 1024 / 1024 when 1 then d.max_size end) as ts_total
  68.                     from v$tablespace t,
  69.                          v$datafile d
  70.                    where t.id = d.group_id and t.name in ('roll')
  71.                 group by t.name,
  72.                          t.status$)
  73.          union all
  74.          select tablespace_name,
  75.                 'temporary' as ts_type,
  76.                 status,
  77.                 ts_total,
  78.                 total as ts_curr_total,
  79.                 free,
  80.                 free as curr_free,
  81.                 (total - free) used,
  82.                 round(cast((total - free) as decimal) * 100 / total) pct_curr_used,
  83.                 round(cast((total - free) as decimal) * 100 / ts_total) pct_used
  84.            from (select t.name tablespace_name,
  85.                         t.status$ status,
  86.                         cast(free_size as decimal) * page() / 1024 / 1024 as free,
  87.                         cast(d.total_size as decimal) * page() / 1024 / 1024 as total,
  88.                         case (select sys_value
  89.                                  from v$parameter
  90.                                 where name = 'temp_space_limit') when 0 then 99999999 else (select sys_value
  91.                                                                                                from v$parameter
  92.                                                                                               where name = 'temp_space_limit') end as ts_total
  93.                    from v$tablespace t,
  94.                         v$datafile d
  95.                   where t.id = d.group_id and t.name in ('temp')) )
  96. order by ts_type,
  97.          pct_curr_used desc;

阅读(68) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图