ORA-01652(暫存資料表空間無法擴充)解決方案

來源:互聯網
上載者:User

ORA-01652:unable to extend temp segment by num in tablespace name

產生原因:ORACLE臨時段資料表空間不足,因為ORACLE總是盡量分配連續空間,一但沒有足夠的可分配空間或者分配不連續就會出現上述的現象。

解決方案:我們知道由於ORACLE將資料表空間作為邏輯結構-單元,而資料表空間的物理結構是資料檔案,資料檔案在磁碟上物理地建立,資料表空間的所有對象也存在於磁碟上,為了給資料表空間增加空間,就必須增加資料檔案。先查看一下指定資料表空間的可用空間,使用視圖SYS.DBA_FREE_SPACE,視圖中每條記錄代表可用空間的片段大小:

SQL>Select file_id,block_id,blocks,bytes from sys.dba_free_space where tablespace_name=’’;

返回的資訊可初步確定可用空間的最大塊,看一下它是否小於錯誤資訊中提到的尺寸,再查看一下預設的資料表空間參數:

SQL>SELECT INITIAL_EXTENT,NEXT_EXTENT,MIN_EXTENTS,PCT_INCREASE FROM SYS.DBA_TABLESPACES WHERE TABLESPACE_NAME=name;

通過下面的SQL命令修改臨時段資料表空間的預設儲存值:

SQL>ALTER TABLESPACE name DEFAULT STORAGE (INITIAL XXX NEXT YYY);

適當增大預設值的大小有可能解決出現的錯誤問題,也可以通過修改使用者的暫存資料表空間大小來解決這個問題:

SQL>ALTER USER username TEMPORARY TABLESPACE new_tablespace_name;

使用ALTER TABLESPACE命令,一但完成,所增加的空間就可使用,無需退出資料庫或使資料表空間離線,但要注意,一旦添加了資料檔案,就不能再刪除它,若要刪除,就要刪除資料表空間。

一個報錯例子如下:

ORA-1652:unable to extend temp segment by 207381 in tablespace TEMPSPACE

相應的英文如下:

Cause: Failed to allocate extent for temp segment in tablespace

Action:Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the specified tablespace or create the object in another tablespace.

補充:

重建Temp資料表空間 startup --啟動資料庫          create temporary tablespace TEMP2 TEMPFILE '/home2/oracle/oradata/sysmon/temp02.dbf' SIZE 512M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED; --建立中轉暫存資料表空間          alter database default temporary tablespace temp2; --改變預設暫存資料表空間 為剛剛建立的新暫存資料表空間temp2          drop tablespace temp including contents and datafiles; --刪除原來暫存資料表空間          create temporary tablespace TEMP TEMPFILE '/home2/oracle/oradata/sysmon/temp01.dbf' SIZE 512M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED; --重新建立暫存資料表空間          alter database default temporary tablespace temp; --重設預設暫存資料表空間為建立的temp資料表空間          drop tablespace temp2 including contents and datafiles; --刪除中轉用暫存資料表空間     

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.