今天在執行oracle預存程序的時候報錯,錯誤資訊:"01652 無法通過128(在資料表空間temp中)擴充temp段"。
在linux中執行df命令後發現資料表空間由於autoextend的原因,導致磁碟已用空間為100%。
[root@localhost ~]# df -h檔案系統 容量 已用 可用 已用% 掛載點/dev/sda1 9.5G 8.6G 439M 96% //dev/sda3 119G 52G 61G 46% /home/sistmpfs 2.0G 0 2.0G 0% /dev/shm
(上面的sd1磁碟可用空間是刪除了一些臨時檔案的顯示結果)
解決辦法是在另外一個磁碟開闢新的資料表空間,語句如下:
[root@localhost sis]# mkdir oracle_tmp[root@localhost sis]# chown -R oracle /home/sis/oracle_tmp//給EP資料表空間添加新的dbf檔案[root@localhost sis]# su -l oracle[oracle@localhost ~]$ sqlplus /nologSQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 10 11:35:35 2011Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL> conn /as sysdbaConnected.SQL> alter tablespace EP add datafile 2 '/home/sis/oracle_tmp/EP02.dbf' size 500M autoextend on next 100M;Tablespace altered.
SQL> alter database datafile '/home/oracle/app/oracle/oradata/orcl/EP01.dbf' 2 autoextend off;Database altered.
建立好的資料檔案,貌似oracle會自動隨機的寫到以後的資料檔案中去。
建立暫存資料表空間:
SQL> create temporary tablespace TEMP2 tempfile 2 '/home/sis/oracle_tmp/TEMP2.dbf' size 500m reuse autoextend on next 100m;Tablespace created.SQL> alter database default temporary tablespace "TEMP2";Database altered.