–创建临时表空间
create temporary tablespace wdy_temp
tempfile ‘D:\oracle\app\oracle\oradata\XE\wdy_temp.DBF’
size 50m
autoextend on
next 50m maxsize unlimited
extent management local;
–修改默认表空间为新建的临时表空间
alter database default temporary tablespace temp01;
–查看用户当前使用的临时表空间
select username,temporary_tablespace from dba_users;
–删除原来的临时表空间
drop tablespace temp including contents and datafiles;
–查看所有表空间名确认临时表空间是否已删除
select tablespace_name from dba_tablespaces;
扩展:
–临时表空间添加数据文件
alter tablespace temp01 add tempfile ‘/oradata/temp02.dbf’ size 2G autoextend on;
–修改临时表空间数据文件大小
alter database tempfile ‘/oradata/temp02.dbf’ resize 4G;