怎麼檢視oracle資料庫資料量大小

時間 2021-08-30 11:07:30

1樓:思科網俠

檢視方法:

1、檢視所有表空間及表空間大小:

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

2、檢視所有表空間對應的資料檔案:

select tablespace_name,file_name from dba_data_files;

3、修改資料檔案大小:

alter database datafile 'h:\oracle\product\10.1.

0\oradata\oracle\users01.dbf' resize 10240m;

擴充套件資料

每張表都是作為「段」來儲存的,可以通過user_segments檢視檢視其相應資訊。

段(segments)的定義:如果建立乙個堆組織表,則該錶就是乙個段。

sql:select segment_name as tablename,bytes from user_segments where segment_name='表名'。

解釋:segment_name 就是要查詢的表名(大寫),bytes 為表儲存所占用的位元組數。本sql的意思就是查詢出表名和表所佔的儲存空間大小。

參考資料

csdn:怎麼檢視oracle資料庫大小

2樓:匿名使用者

用這個語句:

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

(select tablespace_name, sum(bytes)/1024/1024 as total from dba_data_files group by tablespace_name) a,

(select tablespace_name, sum(bytes)/1024/1024 as free from dba_free_space group by tablespace_name) b

where a.tablespace_name = b.tablespace_name;

其中total為表空間大小,free為空閒的表空間大小

3樓:匿名使用者

1、檢視所有表空間及表空間大小:

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

2、檢視所有表空間對應的資料檔案:

select tablespace_name,file_name from dba_data_files;

3、修改資料檔案大小:

alter database datafile 'h:\oracle\product\10.1.

0\oradata\oracle\users01.dbf' resize 10240m;

4樓:匿名使用者

這個是佔檔案系統的空間。例如表空間的大小是10g,使用了1g,你的這種統計按照10g來算的。

select sum(bytes)/1024/1024/1024 from dba_segments;

這個是有多少資料。

5樓:匿名使用者

你這個語句是統計資料檔案大小,不是資料量大小。先搞清楚你要統計什麼。

資料量大小包括索引嗎,還是表,先搞清楚。

6樓:手機使用者

應該是剛接觸,要學的很多。

先去學oracle安裝,在學oracle的sql,關注系統環境相關的sql。

這樣相關的問題就都有了答案。

這個不是答案,是方法、路徑。自個捕魚去吧。希望有所提示,有空到it168,it實驗室,天天軟體測試網進一步交流!

7樓:

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;

8樓:

select round(sum(bytes) / 1024 / 1024 / 1024, 2) || 'g'

from dba_segments

where owner not in ('mdsys', 'outln', 'ctxsys', 'olapsys', 'hr', 'system',

'exfsys', 'scott', 'dbsnmp', 'ordsys', 'sysman', 'oe', 'pm', 'sh',

'xdb', 'orddata', 'ix', 'sys', 'wmsys')

oracle資料庫,oracle資料庫價格

oracle是一種適用於大型 中型和微型計算機的關聯式資料庫管理系統,它使用sql structured guery language 作為它的資料庫語言。sql主要包括資料定義 資料操縱 包括查詢 和資料控制等三方面功能。sql是一種非過程化程度很高的語言,使用者只需說明 幹什麼 而無需具體說明 怎麼...

怎麼檢視oracle資料庫表單,如何檢視oracle資料庫中的所有表

例如想要查出資料庫 abc 中的所有資料表,可以直接用這條語句查然後匯出在excel中檢視 select from all tab comments t where t.owner abc win r 輸入cmd 開啟命令 執行 sqlplus 登陸賬號密碼 select from tab 怎麼檢視...

oracle怎樣檢視資料庫中有資料的表

千鋒教育 select from all tables all tables是所有能訪問,包括其它使用者的,如果要檢視當前使用者用user tables 超級喵公主 覺得你應該先弄清楚oracle的常規資料字典的結構,像9i裡的常規資料字典中物件名稱就有以user,all,dba為字首的物件。以us...