时间:2021-07-01 10:21:17 帮助过:4人阅读
查看表空间使用率
- <span style="color: #0000ff;">SELECT</span> a.tablespace_name,total,free, (total<span style="color: #808080;">-</span>free),total<span style="color: #808080;">/</span>(<span style="color: #800000; font-weight: bold;">1024</span><span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">1024</span><span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">1024</span>),free<span style="color: #808080;">/</span>(<span style="color: #800000; font-weight: bold;">1024</span><span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">1024</span><span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">1024</span>) "free(G)",(total<span style="color: #808080;">-</span>free)<span style="color: #808080;">/</span>(<span style="color: #800000; font-weight: bold;">1024</span><span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">1024</span><span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">1024</span>) "(total<span style="color: #808080;">-</span>free)(G)",<span style="color: #ff00ff;">round</span>((total<span style="color: #808080;">-</span>free)<span style="color: #808080;">/</span>total,<span style="color: #800000; font-weight: bold;">4</span>)<span style="color: #808080;">*</span><span style="color: #800000; font-weight: bold;">100</span> "ratio <span style="color: #808080;">%</span>" <span style="color: #0000ff;">FROM</span> (<span style="color: #0000ff;">SELECT</span> tablespace_name, <span style="color: #ff00ff;">SUM</span>(bytes) free <span style="color: #0000ff;">FROM</span> dba_free_space <span style="color: #0000ff;">GROUP</span> <span style="color: #0000ff;">BY</span> tablespace_name) a,(<span style="color: #0000ff;">SELECT</span> tablespace_name,<span style="color: #ff00ff;">SUM</span>(bytes) total <span style="color: #0000ff;">FROM</span> dba_data_files <span style="color: #0000ff;">GROUP</span> <span style="color: #0000ff;">BY</span> tablespace_name) b <span style="color: #0000ff;">WHERE</span> a.tablespace_name <span style="color: #808080;">=</span> b.tablespace_name ;
oracle 查看表空间使用率
标签: