temporary tablespaces are used to manage space for database sort operations and for storing global temporary tables. for example, if you join two large tables, and oracle cannot do the sort in memory (see sort_area_size initialisation parameter), space will be allocated in a temporary tablespace for doing the sort operation. other sql operations that might require disk sorting are: create index, analyze, select distinct, order by, group by, union, intersect, minus, sort-merge joins, etc.
the dba should assign a temporary tablespace to each user in the database to prevent them from allocating sort space in the system tablespace.
when executing sql query, the following oracle error may appears:
ora-25153: temporary tablespace is empty
the cause for the ora-25153 error is because attempt was made to use space in a temporary tablespace with no files (no datafiles defined).
to solve the problem, the solution is just by adding files (datafiles) to the temp tablespace by using add tempfile command, or by using “add datafiles” in oracle enterprise manager.
if you check and found that temp tablespace already has data files, check the default temporary tablespace for all users and your database and set the default temporary tablespace to a valid temporarary tablespace.
to check the default temporary tablespace of the database:
to check default temporary tablespace for all users of the database:
sql> select username, temporary_tablespace, account_status from dba_users;
if default temporary tablespace is wrong the alter it with the following command:
sql> alter database default temporary tablespace temp;
if wrong temporary tablespace is found, alter it with the correct tablespace name (for example, sys) with the following sql:
sql> alter user sys temporary tablespace temp;
alternatively, recreate or add a datafile to your temporary tablespace and change the default temporary tablespace for your database;
sql> drop tablespace temp including contents and datafiles;
sql> create temporary tablespace temp tempfile ‘/db/temp01.dbf’ size 100m autoextend off extent management local uniform size 1m;
sql> alter database default temporary tablespace temp;
阅读(2541) | 评论(0) | 转发(0) |