ORACLE SQL查詢表空間使用情況

2021-10-05 17:36:56 字數 586 閱讀 6296

--oracle查詢表空間使用情況

--oracle查詢表空間使用情況

select

b.file_id 檔案id號,

b.tablespace_name 表空間名,

b.bytes/1024/1024 位元組數m,

(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用m,

sum(nvl(a.bytes,0))/1024/1024 剩餘空間m,

100 - sum(nvl(a.bytes,0))/(b.bytes)*100 占用百分比

from dba_free_space a,dba_data_files b

where a.file_id=b.file_id

group by b.tablespace_name,b.file_id,b.bytes

order by b.file_id;

--查詢表空間檔案路徑

--查詢表空間檔案路徑

select * from dba_data_files;

如果覺得有幫助,下方請點贊。

表空間使用率查詢

select a.file id 檔案號,a.tablespace name 表空間名稱,b.file name 物理檔名,b.autoextensible 自動擴充套件,b.maxbytes 1024 1024 1024 最大空間g,total 1024 1024 表空間mb,free 1024 ...

查詢表空間使用情況

select owner,tablespace name,segment name,segment type,sum bytes 1024 1024 sums from dba extents where owner nbcheck and segment type table group by o...

查詢oracle表空間使用情況

1.查詢表空間所在物理路徑及使用情況.select b.file id 檔案id,b.tablespace name 表空間,b.file name 物理檔名,b.bytes 總位元組數,b.bytes sum nvl a.bytes,0 已使用,sum nvl a.bytes,0 剩餘,sum n...