veritas環境Oracle ORA-01157異常處理-orastar

orastar發表於2017-05-04


1、 異常現象


結點2:
資料庫查詢異常,報錯資訊如下,
SQL> select file_name,status,online_status from dba_data_files where file_id=238;
select file_name,status,online_status from dba_data_files where file_id=238
                                           *
ERROR at line 1:
ORA-01157: cannot identify/lock data file 238 - see DBWR trace file
ORA-01110: data file 238: '/dev/vx/rdsk/ht/ht_data8_34'


結點1:
資料庫查詢正常,
SQL> select file_name,status,online_status from dba_data_files where file_id=238;


FILE_NAME                    STATUS        ONLINE
------------------------------------ -      --------------     ----------------
/dev/vx/rdsk/ht/ht_data8_34      AVAILABLE     ONLINE


2 、環境介紹



作業系統: aix 6.1
共享儲存管理: veritas storage foundation(以下簡稱veritas)
資料庫版本: Oracle 10.2.0.5  2結點rac
?


3 、異常處理



檢視ora-01157錯誤程式碼

點選(此處)摺疊或開啟

  1. [oracle@htapp1 ~]$ oerr ora 1157
  2. 01157, 00000, "cannot identify/lock data file %s - see DBWR trace file"
  3. // *Cause: The background process was either unable to find one of the data
  4. // files or failed to lock it because the file was already in use.
  5. // The database will prohibit access to this file but other files will
  6. // be unaffected. However the first instance to open the database will
  7. // need to access all online data files. Accompanying error from the
  8. // operating system describes why the file could not be identified.
  9. // *Action: Have operating system make file available to database. Then either
  10. // open the database or do ALTER SYSTEM CHECK DATAFILES.
查詢結點2磁碟狀態:


crw-------    1 root     system       48,51277 Apr 15 19:19 ht_data8_34(異常磁碟許可權)


查詢結點1磁碟狀態:
crw-rw----    1 oracle   oinstall     48,51281 Apr 15 19:19 ht_data8_34(正常磁碟許可權)


發現結點2磁碟許可權異常,造成資料庫無法正常訪問該資料檔案。
使用veritas叢集命令修改磁碟許可權
vxedit -g vght set user=oracle group=oinstall mode=660 ht_data8_34
說明: vght裸裝置所在卷組,ht_data8_34裸裝置名稱


重新識別並驗證資料檔案
SQL> alter system check datafiles;


System altered.
再次檢查該資料檔案可用性:
SQL> select file_name,status,online_status from dba_data_files where file_id=238;


FILE_NAME                    STATUS        ONLINE
------------------------------------ -      --------------     ----------------
/dev/vx/rdsk/ht/ht_data8_34      AVAILABLE     ONLINE
資料檔案恢復正常。

4 、問題分析



資料庫2號結點伺服器重啟後,veritas管理的裸裝置許可權重置造成資料檔案異常。根據以往的經驗,異常資料檔案是透過作業系統命令分別在2個結點修改許可權,裸裝置的許可權資訊未記錄到veritas叢集中,在伺服器重啟後,裸裝置許可權重置,造成資料檔案異常。標準化操作應該使用veritas命令修改裝置許可權,命令如下:
vxedit -g vght set user=oracle group=oinstall mode=660 ht_data8_34


5 、最佳化建議



1、 檢查所有在運veritas是否存在以上問題。
2、 規範veritas操作,統一使用veritas命令修改裝置許可權,杜絕該問題再次出現。



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31442014/viewspace-2138416/,如需轉載,請註明出處,否則將追究法律責任。

相關文章