非法刪除資料檔案導致資料庫不能開啟ORA-01122 ORA-01251

xz43發表於2012-04-23
今天一同事找我,說他本地的資料庫被他誤刪除了檔案,導致不能開啟,然給看看。
SQL> conn jjw/jjw
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress

Warning: You are no longer connected to ORACLE.
SQL>
資料庫已經啟動,但連線報錯。如是,我重啟一下,看報什麼錯誤。
SQL> conn /as sysdba
Connected.
SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size                  2020384 bytes
Variable Size             218106848 bytes
Database Buffers          989855744 bytes
Redo Buffers               14753792 bytes
Database mounted.
ORA-01122: database file 10 failed verification check
ORA-01110: data file 10: '/oracle/database/tabjj_tab.dbf'
ORA-01251: Unknown File Header Version read for file number 10

SQL>
首先,得從資料庫中刪除這個有問題的檔案。
SQL> startup mount
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size                  2020384 bytes
Variable Size             218106848 bytes
Database Buffers          989855744 bytes
Redo Buffers               14753792 bytes
Database mounted.
SQL> alter database datafile  '/oracle/database/tabjj_tab.dbf' offline drop;
Database altered.
 
SQL> alter database open;
Database altered.
SQL>
資料庫恢復正常。
 
以上只是測試環境下的操作,正式系統上,千萬不能這樣隨意刪除檔案了。
 
 

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

相關文章