黄色电影一区二区,韩国少妇自慰A片免费看,精品人妻少妇一级毛片免费蜜桃AV按摩师 ,超碰 香蕉

oracle丟失temp表空間的處理方法

oracle丟失temp表空間的處理方法

之前有做臨時(shí)表空間的切換,切換后沒drop tablespace就刪除了temp01.dbf結(jié)果排序跟查dba_temp_files報(bào)錯(cuò)

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)會(huì)自動(dòng)重建,數(shù)據(jù)庫會(huì)提示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)會(huì)自動(dòng)重建;

實(shí)驗(yàn)如下:

我們先查看temp表空間對(duì)應(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

啟動(dòng)過程中,可觀察到alert日志中出現(xiàn)如下語句

re-creating tempfile /u01/oracle/oradata/orcl/temp01.dbf

然后oracle正常啟動(dòng),查看文件系統(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ù)文件就可以了。

下一節(jié):oracle試用到期如何刪除注冊(cè)表繼續(xù)試用30天

oracle數(shù)據(jù)庫

相關(guān)文章
學(xué)習(xí)MySQL