日期:2014-05-16 浏览次数:20545 次
错误描述如下:
SQL> select dbms_metadata.get_ddl('TABLE','TEST') from dual;
ERROR:
ORA-25153: Temporary Tablespace is Empty
ORA-06512: at "SYS.DBMS_LOB", line 664
ORA-06512: at "SYS.DBMS_METADATA", line 3825
ORA-06512: at "SYS.DBMS_METADATA", line 5678
ORA-06512: at line 1
no rows selected
解决方法: --很简单解决的
(1)故障定位
SQL> select name from v$tempfile; --发现临时文件丢失
no rows selected
也会从警告日志中可以看出确实临时文件
SMON: enabling tx recovery
*********************************************************************
WARNING: The following temporary tablespaces contain no files.
This condition can occur when a backup controlfile has
been restored. It may be necessary to add files to these
tablespaces. That can be done using the SQL statement:
ALTER TABLESPACE <tablespace_name> ADD TEMPFILE
Alternatively, if these temporary tablespaces are no longer
needed, then they can be dropped.
Empty temporary tablespace: TEMP
*********************************************************************
(2)指定临时文件
SQL> alter tablespace temp add tempfile '/u01/oracle/oradata/elvis/temp01.dbf';
Tablespace altered.
SQL> select * from v$tempfile;
FILE# CREATION_CHANGE# CREATION_ TS# RFILE# STATUS ENABLED
---------- ---------------- --------- ------