[Oracle] 檢視tablespace的使用率(Including temp tablespace)
以前也寫過檢視tablespace的sql,
下面寫的sql包含temp tablespace的使用率的
將permanent和temporary的使用率包含在一起的.
select * from
(select x.tablespace_name,x.contents,x.status,x.extent_management,x.all_bytes/1024/1024 "ALL_SIZE(MB)",y.free_bytes/1024/1024 "FREE_SIZE(MB)",
(x.all_bytes-y.free_bytes)/1024/1024 "USED_SIZE(MB)",round((x.all_bytes-y.free_bytes)/x.all_bytes,4)*100 USAGE
from (select ts.tablespace_name,ts.contents,ts.status,ts.extent_management,sum(bytes) all_bytes from
dba_tablespaces ts, dba_data_files dbf
where ts.tablespace_name=dbf.tablespace_name group by ts.tablespace_name,ts.contents,ts.status,ts.extent_management) x,
(select tablespace_name,sum(bytes) free_bytes from dba_free_space fs group by tablespace_name) y
where x.tablespace_name=y.tablespace_name
union all
select h.tablespace_name,'TEMPORARY' contents,f.status,'LOCAL',sum(h.bytes_free+h.bytes_used)/1024/1024 "ALL_SIZE(MB)",sum((h.bytes_free+h.bytes_used-nvl(p.bytes_used,0)))/1024/1024 "FREE_SIZE(MB)",
sum(p.bytes_used)/1024/1024 "USED_SIZE(MB)",round(sum(p.bytes_used)/sum(h.bytes_free+h.bytes_used),4)*100 USAGE
from v$temp_space_header h,v$temp_extent_pool p,dba_temp_files f
where h.file_id=p.file_id(+) and h.file_id=f.file_id
group by h.tablespace_name,f.status)
order by 8 desc
下面寫的sql包含temp tablespace的使用率的
將permanent和temporary的使用率包含在一起的.
select * from
(select x.tablespace_name,x.contents,x.status,x.extent_management,x.all_bytes/1024/1024 "ALL_SIZE(MB)",y.free_bytes/1024/1024 "FREE_SIZE(MB)",
(x.all_bytes-y.free_bytes)/1024/1024 "USED_SIZE(MB)",round((x.all_bytes-y.free_bytes)/x.all_bytes,4)*100 USAGE
from (select ts.tablespace_name,ts.contents,ts.status,ts.extent_management,sum(bytes) all_bytes from
dba_tablespaces ts, dba_data_files dbf
where ts.tablespace_name=dbf.tablespace_name group by ts.tablespace_name,ts.contents,ts.status,ts.extent_management) x,
(select tablespace_name,sum(bytes) free_bytes from dba_free_space fs group by tablespace_name) y
where x.tablespace_name=y.tablespace_name
union all
select h.tablespace_name,'TEMPORARY' contents,f.status,'LOCAL',sum(h.bytes_free+h.bytes_used)/1024/1024 "ALL_SIZE(MB)",sum((h.bytes_free+h.bytes_used-nvl(p.bytes_used,0)))/1024/1024 "FREE_SIZE(MB)",
sum(p.bytes_used)/1024/1024 "USED_SIZE(MB)",round(sum(p.bytes_used)/sum(h.bytes_free+h.bytes_used),4)*100 USAGE
from v$temp_space_header h,v$temp_extent_pool p,dba_temp_files f
where h.file_id=p.file_id(+) and h.file_id=f.file_id
group by h.tablespace_name,f.status)
order by 8 desc
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2120428/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
- Oracle11g新增檢視查詢表空間使用率DBA_TABLESPACE_USAGE_METRICSOracle
- Oracle OCP(48):UNDO TABLESPACEOracle
- 【TABLESPACE】Oracle表空間最佳實踐Oracle
- 【TABLESPACE】Oracle 表空間結構說明Oracle
- MySQL 5.7 InnoDB Tablespace EncryptionMySql
- offline tablespace 的幾種方式 (轉)
- 【BUG】Oracle12c tablespace io statistics missing from awr reportOracle
- Tablespace表空間刪除
- unlimited tablespace許可權的授予和回收MIT
- mysql5.7 General tablespace使用說明MySql
- alter tablespace ts_name autoextend_clause
- 2.6.8.2 UNDO_TABLESPACE 初始化引數
- ORA-1653: unable to extend table by 1024 in tablespace(oracle表空間滿了的解決方案)Oracle
- [20200327]ORA-46267 Insufficient space in 'USERS' tablespace.txt
- ORA-30012 undo tablespace 'UNDOTBS3' does not exist or of wrong typeS3
- 11g-Reduce Transportable Tablespace Downtime using XTTS (Doc ID 1389592.1)TTS
- Linux檢視CPU使用率Linux
- impdp ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1'
- 檢視temp表空間的消耗明細情況
- Linux中如何檢視CPU使用率?Linux
- Linux 磁碟 使用率 檢視 處理Linux
- oracle temp 表空間Oracle
- kubectl 如何檢視 node、pod 的 cpu、RAM 使用率?
- undo表空間使用率100%的原因檢視
- Oracle普通檢視和物化檢視的區別Oracle
- 11、Oracle中的檢視Oracle
- Oracle Temp 表空間切換Oracle
- 檢視oracle臨時表空間佔用率的檢視Oracle
- Win10怎麼看cpu使用率?Win10檢視CPU使用率的方法Win10
- Oracle OCP(24):檢視Oracle
- k8s 檢視容器資源使用率K8S
- win10 怎麼檢視gpu佔用率_win10檢視gpu使用率的步驟Win10GPU
- Oracle 如何高效的檢視官方文件Oracle
- linux雲主機如何檢視目錄空間的使用率Linux
- oracle 檢視錶空間Oracle
- 4.2.8 檢視元件的Oracle重啟配置元件Oracle
- oracle檢視被鎖的表和解鎖Oracle
- Oracle檢視執行計劃的命令Oracle