熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

Oracle認證:Oracle10g恢復試驗方法

2022-06-13   來源: Oracle 
看了Oracle g的閃回數據庫特性書上說不能完成刪除一個表空間並用resetlogs恢復其實這也就是說如果改變了數據庫的結構是不能閃回的只能閃回邏輯修改但我還是做了一個實驗
  我刪除了一個表空間再用數據庫閃回發現不能打開數據庫打開數據庫的時候提示datafile 這個文件offline如果resetlogs就會丟失這個文件於是我就用RMAN進行恢復也就是要恢復到一個以前的時間用的是UNTIL TIME這個語法但在RESTORE就出錯了告訴不能恢復控制文件在那個時間點確實沒有備份控制文件但數據文件已經全部恢復了其實就是控制文件所記錄的SCN與數據文件的SCN不一致數據庫不能打開也就是控制文件比數據文件新我想到兩個辦法一個是重建控制文件用resetlogs選項一個是再往前面恢復恢復一個在這之前的控制文件我RMAN的controlfile autoback為on控制文件都有備份我采取了第二種辦法
  第一種重建控制文件用resetlogs選項新的控制文件的SCN是從數據文件中讀取再recover database until cancel
  第二種辦法還是一個跨resetlogs時間點恢復因為昨天我做實驗曾今用resetlogs打開過數據庫所以我在恢復控制文件後還RESET DATABASE to incarnation n進行對應物的轉換不然RMAN會報
  RMAN UNTIL TIME is before RESETLOGSS time
  Cause UNTIL TIME cannot be less than the database creation time or RESETLOGSS time
  Action Check the UNTIL TIME If the database needs to be restored to an old incarnation use the
  RESET DATABASE TO INCARNATION command
  最後進行recover database 後數據成功恢復
  記錄下過程以後好參考
  我還是該把中間結果保存下來
  哦還有RMAN的controlfile autoback不僅在備份的時候會自動備份控制文件而且在數據庫結構改變時也會自動備份這是有 SERVER PROCESS完成具體看
  The control file is also automatically backed up after database structural changes such as adding a new tablespace altering the state of a tablespace or datafile (for example bringing it online) adding a new online redo log renaming a file adding a new redo thread and so on Losing this information would compromise your ability to recover the database
  This backup is performed by the server process itself rather than one of the RMAN channels This type of autobackup unlike autobackups that occur after a successful backup is always created on disk You can useCONFIGURECONTROLFILEAUTOBACKUPFORDEVICETYPEDISKto set the location for this disk based control file autobackup Note that a failure of the automatic control file autobackup after a structural change never causes the associated structural change to fail For example if you add a datafile and if the resulting control file autobackup fails then the datafile addition is still successful
From:http://tw.wingwit.com/Article/program/Oracle/201311/17390.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.