oracle丟失temp表空間的處理方法
之前有做臨時表空間的切換,切換后沒drop tablespace就刪除了temp01.dbf結(jié)果排序跟查dba_temp_files報錯
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
兩種方法可以恢復
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表空間怎么恢復?
答案是系統(tǒng)會自動重建;
實驗如下:
我們先查看Temp表空間對應的數(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
實驗結(jié)束。
還有一種情況,考慮到生產(chǎn)環(huán)境,數(shù)據(jù)庫需要7*24小時的運轉(zhuǎn),假如說運行過程中temp數(shù)據(jù)文件出問題,而該問題又沒有導致數(shù)據(jù)庫異常關(guān)閉的情況下,該如何修復? 值得注意的是,temp表有排序的功能。
由于實驗過程不好模擬,我們需要執(zhí)行的操作就是丟一個temp02.dbf的數(shù)據(jù)文件給臨時表空間,然后去掉temp01.dbf的數(shù)據(jù)文件就可以了。
相關(guān)文章
Oracle中serveroutput參數(shù)一次設(shè)置永久保存方法
serveroutput是sqlplus的配置參數(shù),而不是數(shù)據(jù)庫的配置參數(shù),每次都需要修改并保存sqlplus的配置參數(shù),本文將介紹如何一次設(shè)置永久保存2012-11-11oracle 11g 數(shù)據(jù)庫常用操作實例總結(jié)
這篇文章主要介紹了oracle 11g 數(shù)據(jù)庫常用操作,結(jié)合實例形式總結(jié)分析了oracle 11g數(shù)據(jù)庫進入、創(chuàng)建、權(quán)限、用戶等相關(guān)操作技巧與注意事項,需要的朋友可以參考下2023-05-05安裝Oracle時出現(xiàn)環(huán)境變量Path的值大于1023的解決辦法
這篇文章主要介紹了安裝Oracle時出現(xiàn)環(huán)境變量Path的值大于1023的解決辦法,非常不錯,具有參考借鑒價值,感興趣的朋友一起看看吧2016-12-12Oracle 表三種連接方式使用介紹(sql優(yōu)化)
這篇文章主要介紹了Oracle表三種連接方式的使用,學習sql優(yōu)化的朋友可以參考下2014-08-08Linux系統(tǒng)下Oracle數(shù)據(jù)庫監(jiān)聽啟動關(guān)閉命令詳解
現(xiàn)在很多朋友在學習linux下oracle 數(shù)據(jù)庫的時候可能都發(fā)現(xiàn)了一個問題,oracle數(shù)據(jù)庫的服務不能自動啟動,這篇文章主要給大家介紹了關(guān)于Linux系統(tǒng)下Oracle數(shù)據(jù)庫監(jiān)聽啟動關(guān)閉命令的相關(guān)資料,需要的朋友可以參考下2024-01-01oracle誤刪數(shù)據(jù)恢復方法小結(jié)
最近幫客戶維護一個數(shù)據(jù)庫,數(shù)據(jù)庫中的數(shù)據(jù)被他誤刪了,下面就為大家分享下我是通過什么方法來實現(xiàn)的2015-08-08