今天數據庫在查詢數據的時候顯示了這個錯誤:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: '/u01/app/oracle/oradata/ORA11GR2/temp01.dbf'
---查看臨時表空間 SYS@GOOD> select FILE_NAME, TABLESPACE_NAME from dba_temp_files; select FILE_NAME, TABLESPACE_NAME from dba_temp_files * ERROR at line 1: ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: '/u01/app/oracle/oradata/ORA11GR2/temp01.dbf'
很明顯這是我的臨時表空間數據文件丟失了,導致不能查看數據文件
解決辦法:
---刪除文件 SYS@GOOD> alter database tempfile '/u01/app/oracle/oradata/ORA11GR2/temp01.dbf'drop; Database altered. ---重建文件 SYS@GOOD> alter tablespace temp add tempfile'/u01/app/oracle/oradata/GOOD/temp01.dbf'size 100M; Tablespace altered. ---驗證文件 SYS@GOOD> select file_name,tablespace_name from dba_temp_files; FILE_NAME TABLESPACE_NAME ---------------------------------------------- ------- /u01/app/oracle/oradata/GOOD/temp01.dbf TEMP