問題: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;