[Q]丟失一個資料檔案,但是沒有備份,怎麼樣開啟資料庫 zt

orchidllh發表於2005-03-15
[A]如果沒有備份只能是刪除這個資料檔案了,會導致相應的資料丟失。
SQL>startup mount
--ARCHIVELOG模式命令
SQL>Alter database datafile 'file name' offline;
--NOARCHIVELOG模式命令
SQL>Alter database datafile 'file name' offline drop;
SQLl>Alter database open;
注意:該資料檔案不能是系統資料檔案 
  

[Q]丟失一個資料檔案,沒有備份但是有該資料檔案建立以來的歸檔怎麼恢復
[A]保證如下條件
a.  不能是系統資料檔案
b.  不能丟失控制檔案
如果滿足以上條件,則
SQL>startup mount
SQL>Alter database create datafile 'file name' as 'file name' size ... reuse;
SQL>recover datafile n; -檔案號
或者
SQL>recover datafile 'file name';
或者
SQL>recover database;
SQL>Alter database open;
  
[Q]聯機日誌損壞如何恢復
[A]1、如果是非當前日誌而且歸檔,可以使用
Alter database clear logfile group n來建立一個新的日誌檔案
如果該日誌還沒有歸檔,則需要用
Alter database clear unarchived logfile group n
2、如果是當前日誌損壞,一般不能clear,則可能意味著丟失資料
如果有備份,可以採用備份進行不完全恢復
如果沒有備份,可能只能用_allow_resetlogs_corruption=true來進行強制恢復了,但是,這樣的方法是不建議的,最好在有Oracle support的指導下進行。

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

相關文章