oracle丟失temp表空間的處理方法
之前有做臨時(shí)表空間的切換,切換后沒drop tablespace就刪除了temp01.dbf結(jié)果排序跟查dba_temp_files報(bào)錯
SQL> select tablespace_name,file_id,file_name,bytes/1024/1024 Mbytes from dba_temp_files;
select tablespace_name,file_id,file_name,bytes/1024/1024 Mbytes from dba_temp_files
*
ERROR at line 1:
ORA-01116: error in opening database file 201
ORA-01110: data file 201: '/home/oracle/oradata/osa/temp01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3兩種方法可以恢復(fù)
1、重啟數(shù)據(jù)庫
重啟后系統(tǒng)會自動重建,數(shù)據(jù)庫會提示re-creating在bdump的alter_sid.log中
Re-creating tempfile /home/oracle/oradata/osa/temp01.db
2、重建
alter tablespace temp add tempfile '/oracle/oradata/osa/temp03.dbf' size 50m;
alter tablespace temp drop tempfile '/oracle/oradata/osa/temp01.dbf' ;
Oracle 11g的Temp表空間怎么恢復(fù)?
答案是系統(tǒng)會自動重建;
實(shí)驗(yàn)如下:
我們先查看Temp表空間對應(yīng)的數(shù)據(jù)文件
SQL> select FILE_NAME,TABLESPACE_NAME,STATUS from dba_temp_files; FILE_NAME TABLESPACE_NAME STATUS ---------------------------------------- ------------------------------------------------------------------------------------------ --------------------- /u01/oracle/oradata/orcl/temp01.dbf TEMP ONLINE
然后登陸到sys用戶下,shutdown immediate
在文件系統(tǒng)層面去刪除該數(shù)據(jù)文件
cd /u01/oracle/oradata/orcl/ ls rm -f temp01.dbf
啟動過程中,可觀察到Alert日志中出現(xiàn)如下語句
Re-creating tempfile /u01/oracle/oradata/orcl/temp01.dbf
然后Oracle正常啟動,查看文件系統(tǒng),又多了temp01.dbf
實(shí)驗(yàn)結(jié)束。
還有一種情況,考慮到生產(chǎn)環(huán)境,數(shù)據(jù)庫需要7*24小時(shí)的運(yùn)轉(zhuǎn),假如說運(yùn)行過程中temp數(shù)據(jù)文件出問題,而該問題又沒有導(dǎo)致數(shù)據(jù)庫異常關(guān)閉的情況下,該如何修復(fù)? 值得注意的是,temp表有排序的功能。
由于實(shí)驗(yàn)過程不好模擬,我們需要執(zhí)行的操作就是丟一個(gè)temp02.dbf的數(shù)據(jù)文件給臨時(shí)表空間,然后去掉temp01.dbf的數(shù)據(jù)文件就可以了。
相關(guān)文章
有關(guān)Oracle數(shù)據(jù)庫的備份情況
有關(guān)Oracle數(shù)據(jù)庫的備份情況...2007-03-03
Oracle數(shù)據(jù)庫rownum和row_number的不同點(diǎn)
在Oracle中,有一個(gè)很有趣的東西,那就是rownum。當(dāng)你從某個(gè)表中查詢數(shù)據(jù)的時(shí)候,返回的結(jié)果集中都會帶有rownum這個(gè)字段,而且有時(shí)候也可以使用rownum進(jìn)行一些條件查詢2015-11-11
ORACLE數(shù)據(jù)庫日常維護(hù)知識點(diǎn)總結(jié)
這篇文章主要介紹了ORACLE數(shù)據(jù)庫日常維護(hù)知識點(diǎn)總結(jié),對于維護(hù)oracle數(shù)據(jù)庫的朋友可以參考下2016-06-06
Oracle使用觸發(fā)器和mysql中使用觸發(fā)器的案例比較
這篇文章主要介紹了Oracle使用觸發(fā)器和mysql中使用觸發(fā)器的案例比較,本文通過示例講解,給大家介紹的非常詳細(xì),需要的朋友參考下2016-12-12
基于Oracle的高性能動態(tài)SQL程序開發(fā)
對動態(tài)SQL的程序開發(fā)進(jìn)行了總結(jié),并結(jié)合筆者實(shí)際開發(fā)經(jīng)驗(yàn)給出若干開發(fā)技巧2007-03-03
oracle bbed恢復(fù)刪除數(shù)據(jù)實(shí)例
在oracle中bbed恢復(fù)刪除數(shù)據(jù)實(shí)例2013-11-11

