重建TEMP 資料表空間

來源:互聯網
上載者:User

問題:ora-01652 unable to extend temp segment by 128 in tablespace

        oracle暫存資料表空間耗盡也不會釋放,除非重啟資料庫.一般出現此類問題建議增大temp 

 

Temporary tablespace是不能直接drop預設的暫存資料表空間的,不過我們可以通過以下方法來做。

 準備:查看目前的Temporary Tablespace
SQL> select name from v$tempfile;

NAME
———————————————————————
/product/app/oracle/oradata/uniguard/temp1.dbf

SQL> select username,temporary_tablespace from dba_users;
------------------------------ ------------------------------
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW                      TEMP
SYS                            TEMP
SYSTEM                         TEMP
DBSNMP                         TEMP
SYSMAN                         TEMP
UNIGUARD                       TEMP
OUTLN                          TEMP
MDSYS                          TEMP
ORDSYS                         TEMP
CTXSYS                         TEMP
ANONYMOUS                      TEMP

USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
EXFSYS                         TEMP
DMSYS                          TEMP
WMSYS                          TEMP
XDB                            TEMP
ORDPLUGINS                     TEMP
SI_INFORMTN_SCHEMA             TEMP
OLAPSYS                        TEMP
MDDATA                         TEMP
DIP                            TEMP
SCOTT                          TEMP
TSMSYS                         TEMP

22 rows selected.

1.建立中轉暫存資料表空間
create temporary tablespace TEMP1 TEMPFILE '/product/app/oracle/oradata/uniguard/temp02.dbf' SIZE 2048M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED;  

2.改變預設暫存資料表空間 為剛剛建立的新暫存資料表空間temp1
alter database default temporary tablespace temp1; 

3.刪除原來暫存資料表空間
drop tablespace temp including contents and datafiles;

4.重新建立暫存資料表空間
create temporary tablespace TEMP TEMPFILE '/product/app/oracle/oradata/uniguard/temp01.dbf' SIZE 2048M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED;  

5.重設預設暫存資料表空間為建立的temp資料表空間
alter database default temporary tablespace temp; 

6.刪除中轉用暫存資料表空間
drop tablespace temp1 including contents and datafiles;

7.如果有必要,那麼重新指定使用者資料表空間為重建的暫存資料表空間 
alter user arbor temporary tablespace temp;  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.