Oracle資料庫中出現ORA-01157: 無法標識/鎖定資料檔案

來源:互聯網
上載者:User

Oracle資料庫中出現ORA-01157: 無法標識/鎖定資料檔案

環境:SLES 11 sp1 + RAC 11.2.0.3.7

馬上要休假了,對資料庫做了個檢查,結果發現計費billingdb資料庫的節點2出現如下錯誤:
 Fri Apr 25 21:51:13 2014
 Errors in file /Oracle/app/oracle/diag/rdbms/ispace/ispace2/trace/ispace2_m000_15002.trc:
 ORA-01157: 無法標識/鎖定資料檔案 54 - 請參閱 DBWR 追蹤檔案
 ORA-01110: 資料檔案 54: '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/DATADG'
 Fri Apr 25 22:01:14 2014
 Errors in file /oracle/app/oracle/diag/rdbms/ispace/ispace2/trace/ispace2_m000_30469.trc:
 ORA-01157: 無法標識/鎖定資料檔案 54 - 請參閱 DBWR 追蹤檔案
 ORA-01110: 資料檔案 54: '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/DATADG'
 

於是檢查資料檔案的狀態,結果發現這個資料檔案在節點2上查不到的。
 再到節點1檢查時,發現這個資料檔案被建立在本地目錄中了:
 TABLESPACE_NAME  FILE_ID FILE_NAME
      MB STATUS    AUT
 ----------------------- ---------- ----------------------------------------------------------- ---------- --------- ---
 SRPTSP  54 /oracle/app/oracle/product/11.2.0/dbhome_1/dbs/DATADG
    32500 AVAILABLE NO
 SRPTSP  55 +DATADG/ispace/datafile/srptsp.4718.845812309
    32500 AVAILABLE NO
 

鬱悶,怎麼會把資料檔案建立在本地目錄中呢?
 
經檢查,發現是有一個新來的DBA建立資料檔案時將"+DATADG"錯誤寫成了"DATADG",相當於漏掉了"+",資料庫根據OMF格式,預設將資料檔案建立在本地目錄的$ORACLE_HOME/dbs下面。更重要的是,剛剛好監控系統出現了故障,不然這個問題有就有警告了。幸好,這個是存放轉存的曆史資料,對業務沒有產生影響,真是不幸中的萬幸呀....
 

解決辦法:
 再建立一個資料表空間,然後將54號資料檔案上的所有對象move到新的資料表空間中,索引rebuild到新的資料表空間中,最後再:
 alter table xxxx move tablespace yyyyy;
 alter tablesapce SRPTSP drop datafile 54;
 再重新加資料檔案到DATADG磁碟組中,將資料移回原資料表空間中。

--------------------------------------------------------------------------------

Linux-6-64下安裝Oracle 12C筆記

在CentOS 6.4下安裝Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虛擬機器中安裝步驟

Debian 下 安裝 Oracle 11g XE R2

--------------------------------------------------------------------------------

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.