oracle 表空間不足解決辦法大全

2021-06-27 13:21:54 字數 1787 閱讀 6231

oracle表空間不足,一般有兩個原因:一,原表空間太小,沒有自增長;二,表空間已自增長,而且表空間也已足夠大,對於這兩種原因分別有各自的解決辦法。

【檢查原因】

1、檢視表在那個表空間  select tablespace_name,table_name from user_talbes where table_name='test';

2、獲取使用者的預設表空間  select  username,  default_tablespace  from  dba_users where username='mxh';

3、檢視表空間所有的檔案  select * from dba_data_files where tablespace_name='users';

4、查詢表空間使用情況

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

【解決辦法-原因一】

只要將表空間設定為足夠大,並設定為自增長即可。

1、擴充套件表空間  alterdatabase datafile 'd:\oracle\product\oradata\

temp01.dbf' resize 50m;

注:50m,是表空間大小,可以根據實際需要加大,但最大不得超過32g

2、自動增長  alterdatabase datafile 'd:\oracle\product\oradata\temp01.dbf' autoextend onnext 50m maxsize 500m; 

【解決辦法-原因二】

因為表空間中的資料檔案已經足夠大(達到32g),所以,這時僅僅增加表空間大小是不行的。

這個時候,我們可以增加該錶空間的資料檔案,這樣表空間的大小即變為64g了。

alter tablespace aaa

add datafile 'd:\oracle\product\oradata\temp02.dbf'

size 32767m;

oracle 表空間不足解決辦法

問題 在對某一表空間進行新建表的時候,出現ora 01658的錯誤。create 語句 create table oa orgconfig oaoc unid integer not null,oaoc uuid varchar2 32 not null,oaoc cdate date,oaoc u...

oracle 表空間不足解決辦法大全

oracle表空間不足,一般有兩個原因 一,原表空間太小,沒有自增長 二,表空間已自增長,而且表空間也已足夠大,對於這兩種原因分別有各自的解決辦法。檢查原因 1 檢視表在那個表空間 select tablespace name,table name from user talbes where ta...

system表空間空間不足解決辦法

場景描述 系統表空間空間不足,導致應用無法正常連線!環境描述 oracle 11g 檢視當前表空間的整體使用情況,以及有沒有開啟自動擴充套件,以及擴充套件的最大限制!tablespace status 表空間使用情況 set pages 12222 lines 132 set serveroutpu...