临时表空间
临时表空间是一个磁盘空间,主要用于内存排序区不够而必须将数据写到磁盘的某个逻辑区域,由于该空间在排序操作完成后可以由oracle系统自动释放,所以也称作临时表空间
临时表空间主要用于临时段,而临时段是由数据库根据需要创建、管理和删除的,这些临时段的生成通常与排序之类的操作有关系。例如
1.select distinct不重复检索
2.union联合查询
3.minus计算
4.analyze分析
5.连接两个没有索引的表
创建临时表空间
- 创建一个临时表空间。空间大小为300Mb
create temporary tablespace temp_01 tempfile 'D:\oraclefiles\tempfiles\tem_01.tpf' size 300m;
- 修改临时表空间
alter database default temporary tablespace temp_01;
查询临时表空间
oracle11g将临时表空间与相应的临时文件信息存放在DBA_TEMP_FILES数据字典中,在v$tempfiles试图中。
select file_name,bytes,tablesapce_name from dba_temp_files;