Oracle 中对表空间使用情况进行查询
生活随笔
收集整理的這篇文章主要介紹了
Oracle 中对表空间使用情况进行查询
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1 --1G=1024MB
2 --1M=1024KB
3 --1K=1024Bytes
4 --1M=11048576Bytes
5 --1G=1024*11048576Bytes=11313741824Bytes
6 SELECT a.tablespace_name "表空間名",
7 total "表空間大小",
8 free "表空間剩余大小",
9 (total - free) "表空間使用大小",
10 total / (1024 * 1024 * 1024) "表空間大小(G)",
11 free / (1024 * 1024 * 1024) "表空間剩余大小(G)",
12 (total - free) / (1024 * 1024 * 1024) "表空間使用大小(G)",
13 round((total - free) / total, 4) * 100 "使用率 %"
14 FROM (SELECT tablespace_name, SUM(bytes) free
15 FROM dba_free_space
16 GROUP BY tablespace_name) a,
17 (SELECT tablespace_name, SUM(bytes) total
18 FROM dba_data_files
19 GROUP BY tablespace_name) b
20 WHERE a.tablespace_name = b.tablespace_name
?
轉(zhuǎn)載于:https://www.cnblogs.com/jijinming/p/9458150.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的Oracle 中对表空间使用情况进行查询的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 总悬浮颗粒物
- 下一篇: 中文企业云操作系统 CecOS