怎麼檢視oracle表空間,剩餘大小,表空間利用

時間 2021-10-27 04:38:39

1樓:匿名使用者

1、因為oracle執行在linux系統下,首先,要連線linux系統。

2、連上後,進行oracle控制檯。輸入命令: sqlplus  / as sysdba;

3、在sql命令列,輸入:

select upper(f.tablespace_name) "表空間名",d.tot_grootte_mb "表空間大小(m)",d.

tot_grootte_mb - f.total_bytes "已使用空間(m)",

to_char(round((d.tot_grootte_mb - f.total_bytes) / d.

tot_grootte_mb * 100,2),'990.99') || '%' "使用比",f.total_bytes "空閒空間(m)",f.

max_bytes "最大塊(m)"

from (select tablespace_name,round(sum(bytes) / (1024 * 1024), 2) total_bytes,round(max(bytes) / (1024 * 1024), 2) max_bytes,

from sys.dba_free_space,group by tablespace_name) f,

(select dd.tablespace_name,round(sum(dd.bytes) / (1024 * 1024), 2) tot_grootte_mb,

from sys.dba_data_files dd,group by dd.tablespace_name) d,

where d.tablespace_name = f.tablespace_name,order by 1;

4、這樣就可以檢視到相應結果。 完成效果圖。

2樓:水果丶糖糖

select

b.file_name 物理檔名,

b.tablespace_name 表空間,

b.bytes/1024/1024 大小m,

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

substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率

from dba_free_space a,dba_data_files b

where a.file_id=b.file_id

group by b.tablespace_name,b.file_name,b.bytes

order by b.tablespace_name

3樓:匿名使用者

給個郵箱,我給個oracle工具你用,很簡單很方便的幫你解決你的問題:

在我給你的工具中一樣使用使用者名稱和密碼以normal模式登陸所在的服務資料庫,之後在選單『管理』項中有『表空間資訊』開啟:

4樓:匿名使用者

select * from dba_tablespaces

結果返回資料庫所有表空間資料

5樓:紫玉羅

select tablespace_name ,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;

select tablespace_name ,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;

如何檢視oracle表空間已使用大小

6樓:匿名使用者

檢視所有表空間使用情況 :

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;

備註:建議用系統管理員dba許可權進行檢視。

7樓:

1. 檢視所有表空間大小

sql> select tablespace_name,sum(bytes)/1024/1024 from dba_data_files

2 group by tablespace_name;

2. 已經使用的表空間大小

sql> select tablespace_name,sum(bytes)/1024/1024 from dba_free_space

2 group by tablespace_name;

3. 所以使用空間可以這樣計算

select a.tablespace_name,total,free,total-free used from

( select tablespace_name,sum(bytes)/1024/1024 total from dba_data_files

group by tablespace_name) a,

( select tablespace_name,sum(bytes)/1024/1024 free from dba_free_space

group by tablespace_name) b

where a.tablespace_name=b.tablespace_name;

4. 下面這條語句檢視所有segment的大小。

select segment_name,sum(bytes)/1024/1024 from user_extents group by segment_name

5. 還有在命令**況下如何將結果放到一個檔案裡。

sql> spool out.txt

sql> select * from v$database;

sql> spool off

怎麼檢視oracle中某個表空間下所有表的大小

用如下語句查詢 select segment name,tablespace name,bytes b,bytes 1024 kb,bytes 1024 1024 mb from user segments where segment type table and tablespace name u...

檢視資料庫建立了哪些表空間oracle

檢視oracle中表空間需要用具有dba許可權的使用者使用以下語句 select distinct tablespace name from dba data files 查詢結果 另外,可通過其他方法檢視一下oracle中表空間的使用率,語句如下 select total.tablespace n...

如何檢視oracle表空間資料檔案位置

育知同創教育 查詢oracle資料檔案 表空間的位置 1。執行 select name from v datafile查詢表空間中資料檔案具體位置 結果集就一列 name f oracle oradata orcl system01.dbf 2。執行 select from dba data fil...