--查詢當前數據庫默認臨時表空間名
select * from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
--創建新的臨時表空間
create temporary tablespace temp01 tempfile '/oradata/temp01.dbf' size 2G autoextend on;
--修改默認表空間為新建的臨時表空間
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;