## 查詢所有表空間的使用情況和位置(oracle表空間單檔案最大32g)
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(
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_name, b.file_id, b.bytes
order by b.tablespace_name;
方式1:手工改變已存在資料檔案的大小
方式2:允許已存在的資料檔案自動增長
autoextend on next 100m maxsize 20480m;
方式3:增加資料檔案,設定檔案初始分配空間為7g, autoextend on為自動增長大小,oracle單個檔案大小最大不超過32g.
sql指令碼如下:需要擴容的表空間是system
alter tablespace system add datafile
'd:\dfyycdb\datafile\o2_mf_system_cwmnz9xv_.dbf'
size 7167 m autoextend on;
針對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 剩餘空間,10...
oracle 資料庫表空間不足 解決方法
先補充知識 1.查詢某個表 占用大小 select segment name as tablename,bytes b,bytes 1024 kb,bytes 2014 1024 mb from user segments where segment name upper tablename tab...
oracle表空間不足
由於oracle的rowid使用22位來代表資料塊號,因此oracle表空間資料檔案每個資料檔案最多只能包含2 22個資料塊。也因此資料庫表空間的資料檔案不是無限增長的,例如 在資料塊為8k的情況下,單個資料檔案的最大容量為8k 2 22 32g 同理,資料塊為2k,資料檔案最大約8g 資料塊為32...