如何修改oracle資料塊的大小

2021-12-23 18:49:23 字數 3205 閱讀 3105

1樓:

資料庫的表空間的block size建立好之後就不能修改,要麼新建一個表空間,或者新建資料庫,然後將資料匯入到新的資料庫。

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

2樓:思科網俠

檢視方法:

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資料庫大小

3樓:匿名使用者

用這個語句:

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為空閒的表空間大小

4樓:匿名使用者

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;

5樓:匿名使用者

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

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

這個是有多少資料。

6樓:匿名使用者

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

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

7樓:手機使用者

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

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

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

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

8樓:

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;

9樓:

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資料庫密碼過期怎麼修改密碼

是由於oracle11g中預設在default概要檔案中設定了 password life time 180天 所導致。1 檢視使用者的proifle是哪個,一般是default sql select username,profile from dba users 2 檢視指定概要檔案 如defau...

oracle資料庫怎麼授予使用者修改表某一列的許可權

oracle中給表中指定的列賦許可權的sql語句如下 比如有使用者joan需要賦給emp表的emp name操作許可權,寫法如下 grant update emp name on edwin.emp to joan 如果joan去更新emp表中的salary欄位就會報錯 update edwin.e...

oracle如何修改單個使用者密碼永不過期

在oracle中執行以下操作 1 檢視使用者的proifle是那個,一般是default select username,profile from dba users 2 檢視指定概要檔案 如default 的密碼有效期設定 select from dba profiles s where s.pr...