Beksalur,
In Oracle 9i, if Oracle created your TEMP tablespace for you, the tablespace behaves slightly differently from earlier versions. (I, personally, use the pre-9i versions of TEMP tablespaces so that I can "see" and manage TEMP tablespaces in a manner consistent with my applications tablespaces.)
So, what I do to bring my TEMP tablespace to 0% is run a script with the following code (so that the TEMP tablespace is "gone" for only a couple of seconds. I usually run this code at during off hours to reduce the liklihood of someone using the TEMP tablespace during the code execution):
1) alter tablespace temp offline;
2) drop tablespace temp including contents;
3) create tablespace temp datafile '<fully qualified file name>'
size 10m reuse autoextend on next 10m maxsize 2000m;
The "reuse" option above allows you to specify the same name as the previous, larger file, but it reduces the size of the file to 10MB and frees you up from needing to "rm" the old, larger, obsolete file from your file system.
If your TEMP tablespace is a standard tablespace, you can use either of the following additional commands to obtain additional file space for TEMP:
1) ALTER TABLESPACE TEMP add datafile '<new file name'
size 10m autoextend on next 10m maxsize 2000m;
or
2) ALTER DATABASE DATAFILE '<name of existing TEMP data file>'
AUTOEXTEND ON NEXT 10M MAXSIZE 2000M;
In all options, above, I place a 2GB (2000MB) maxsize on the files to avoid operating-system issues with files greater than 2GB and to facilitate file management during backups and recoveries.
I hope you find this useful.
Cheers,
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA @ 16:32 (29Dec03) GMT, 09:32 (29Dec03) Mountain Time)