查询表空间状态
select tablespace_name
,status from dba_tablespaces
;
状态都ONLINE(在线)表示正常
查询临时表空间文件
select tablespace_name
,file_name
from dba_temp_files
;
未查询到数据,表示不存在临时表空间物理文件
创建表空间
alter database default temporary tablespace temp;
执行此命令如果报ORA-12907: 表空间 TEMP 已经是默认的临时表空间表示临时表空间已存在,无需创建,只需增加临时表空间物理文件
增加临时表空间物理文件
alter tablespace TEMP add tempfile
'D:\oracle\oradata\TEMP.DBF' size
200m autoextend
on;
注:表空间地址(D:\oracle\oradata\TEMP.DBF)替换为个人oracle数据物理文件实际存储地址
查询临时表空间物理文件是否创建成功
select tablespace_name
,file_name
from dba_temp_files
;
查询到记录表示创建成功