oracle表空間不足

2021-10-06 18:50:08 字數 1032 閱讀 2249

由於oracle的rowid使用22位來代表資料塊號,因此oracle表空間資料檔案每個資料檔案最多只能包含2^22個資料塊。

也因此資料庫表空間的資料檔案不是無限增長的,例如:

在資料塊為8k的情況下,單個資料檔案的最大容量為8k*2^22 = 32g

同理,資料塊為2k,資料檔案最大約8g

資料塊為32,資料檔案最大約16*8g

故若達到這個最大容量之後,則即便是設定了自增長,也不是無限自增長,此時則需要為這個表空間新增資料檔案

(1)設定檔案的自動增長

首先選擇設定自增長,sql語句:alter tablespace 表空間名 adddatafile 『資料檔案存放路徑『 autoextend on next 每次增加的大小 maxsize 資料檔案大小的最大值

(2)增加資料檔案

在自增長失靈了之後,需要增加資料檔案,sql語句:alter tablespace 表空間名 adddatafile 『資料檔案存放的路徑』 size 資料檔案大小m autoextend on next 每次自增長大小m maxsize unlimited;(後半部分為設定自增長)

這裡放個例子:

增加新的資料檔案

alert tablespace 表空間名 add datafile 『d:\oracle_data\***.dbf』 size 1000m autoextend on next 1000m maxsize unlimited;

刪除指定的表空間檔案

alter tablespace 表空間名 drop datafile 『d:\oracle_data\***.dbf』;

1.oracle查詢使用者以及使用者對應的表空間

select username,default_tablespace from dba_users;

2.oracle,查詢 表空間對應的資料檔案,使用者和表空間對應關係

select tablespace_name,file_id,bytes/1024/1024,file_name from dba_data_files order by file_id;

Oracle表空間不足

出現的問題 ora 01659 無法分配超出 4 的 minextents 在表空間 sde 中 n sde.zd 1.對於小檔案的解決方法 alter database datafile c sde.dbf autoextend on next 100m maxsize unlimited 2.對...

oracle表空間不足擴容的方法

oracle表空間不足擴容的方法 1 查詢當前使用者的所屬表空間 select from user users 2 增加表空間有兩種方法 以sysdba登陸進資料庫 語法 alter tablespace 表空間名稱 add datafile 表空間存放路徑 size 表空間大小 autoexten...

ORACLE 解決表空間不足的問題

ora 01658 無法為表空間 ts 中的段建立 initial 區1 檢視表空間使用情況 select a.tablespace name tablespace name total 1024 1024 total m free 1024 1024 free m total free 1024 ...