---Create temporary table spaces:
/* Formatted on 2009/11/20 16:03 (Formatter Plus v4.8.7) * *
CREATE Temporary tablespace temp001
Tempfile '/opt/oracle/oradata/orcl/temp001.dbf '
SIZE 200m
Autoextend on
NEXT 32m MAXSIZE 2048m
EXTENT MANAGEMENT Local;
--Delete temporary table space:
DROP tablespace temp001 including CONTENTS and datafiles;
---Note:
1) datafile: Table space data File storage path
2) SIZE: initially set to 200M
3) Uniform: The designated area size is 128k, if not specified, the zone size defaults to 64k
4 Space name temp001 and data file name TEMP001.DBF do not require the same, can be arbitrarily named
5) Autoextend On/off indicates start/stop automatic expansion of table space
6 ALTER DATABASE datafile '/opt/oracle/oradata/orcl/temp001.dbf ' RESIZE 500m; Manual modification
Data file size is 500M
Setting the default temp table space
The main idea is that Oracle must have a default temporary tablespace, set up a temporary tablespace temp1 and default it, then delete temp temporary table space, then create temp temporary tablespace, designate temp as the default temporary tablespace, and finally remove Temp1 temporary tablespace space.
/* Formatted on 2009/11/24 19:48 (Formatter Plus v4.8.7) * *
CREATE Temporary tablespace temp tempfile '/opt/oracle/oradata/orcl/temp.dbf ' SIZE 1024 m
Autoextend on NEXT m MAXSIZE Unlimited;
/* Formatted on 2009/11/24 20:09 (Formatter Plus v4.8.7) * *
ALTER DATABASE DEFAULT Temporary tablespace Temp
/* Formatted on 2009/11/24 19:50 (Formatter Plus v4.8.7) * *
ALTER DATABASE tempfile '/opt/oracle/oradata/orcl/temp.dbf ' RESIZE 1024 m;
DROP tablespace temp1 including CONTENTS and datafiles;
COMMIT;