zoukankan      html  css  js  c++  java
  • 计算表空间可以收缩的大小

     1 select a.file#,a.name,a.bytes/1024/1024 CurrentMB,
     2      ceil(HWM * a.block_size)/1024/1024 ResizeTo,
     3        (a.bytes - HWM * a.block_size)/1024/1024 ReleaseMB,
     4        'alter database datafile '''||a.name||''' resize '||
     5        ceil(HWM * a.block_size/1024/1024) || 'M;' ResizeCMD
     6 from v$datafile a,
     7      (select file_id,max(block_id+blocks-1) HWM
     8        from dba_extents e 
     9        where exists(select 1 From dba_data_files
    10                              where tablespace_name='LMPS_USERS_201307' and file_id=e.file_id)
    11        group by file_id) b
    12 where a.file# = b.file_id(+)
    13 and (a.bytes - HWM *block_size)>0
    14 order by 5
  • 相关阅读:
    2017年3月9日上午学习
    3.17上午
    3.16上午
    3.16下午
    3.15
    2017.3.14
    3.14
    217.3.13上午
    2017.4.7-morning
    2017.4.6-afternoon
  • 原文地址:https://www.cnblogs.com/wangxingc/p/5182346.html
Copyright © 2011-2022 走看看