RMAN恢複-system資料表空間恢複

來源:互聯網
上載者:User

恢複system資料表空間的資料檔案
system資料表空間存放著資料字典的資訊。當資料庫處於open狀態,如果system資料表空間所對應的資料檔案出現介質失敗,那麼當在其資料檔案上執行I/O操作時,資料庫會自動關閉;當資料庫處於關閉狀態時,如果system資料表空間所對應的資料檔案出現介質失敗,資料庫將不能開啟。
恢複system資料表空間必須在mount狀態下進行。
樣本一system資料表空間的資料檔案被誤刪除
備份資料庫。
刪除system資料表空間對應的資料檔案。
啟動資料庫到mount狀態。
使用restore datafile轉儲資料檔案,並使用recover datafile命令應用歸檔日誌,最後使用alter database open開啟資料庫。

  1. --備份資料庫(略)   
  2. --刪除system資料表空間對應的資料檔案   
  3. RMAN> host rm $Oracle_BASE/product/10.2.0/oradatabak/system01.dbf  
  4. RMAN> startup  
  5.   
  6. connected to target database (not started)  
  7. Oracle instance started  
  8. database mounted  
  9. RMAN-00571: ===========================================================  
  10. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============  
  11. RMAN-00571: ===========================================================  
  12. RMAN-03002: failure of startup command at 08/22/2011 21:56:39  
  13. ORA-01157: cannot identify/lock data file 1 - see DBWR trace file  
  14. ORA-01110: data file 1: '/oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf'  
  15.   
  16. SQL> select file#,error from v$recover_file;  
  17.   
  18.      FILE# ERROR  
  19. ---------- -----------------------------------------------------------------   
  20.          1 FILE NOT FOUND  
  21.   
  22. SQL> select file#,name from v$datafile where file#=1;  
  23.   
  24.      FILE# NAME  
  25. ---------- ------------------------------------------------------------------------------------------------------------------------   
  26.          1 /oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf  
  27.   
  28.   
  29. --啟動資料庫到mount狀態並進行恢複   
  30. RMAN> run {  
  31. 2> startup force mount;  
  32. 3> restore datafile 1;  
  33. 4> recover datafile 1;  
  34. 5> sql 'alter database open';  
  35. 6> }  
樣本二system資料表空間資料檔案所在磁碟出現故障
備份資料庫(略)
刪除system資料表空間對應的資料檔案。
啟動資料庫到mount狀態。
在restore database之前,執行set newname為資料檔案指定新的位置。
在restore database之後,執行switch datafile改變控制檔案中資料檔案位置和名稱。
之後通過執行recover database應用歸檔日誌。
最後執行alter database open開啟資料庫。
  1. --備份資料庫(略)   
  2. --刪除system資料表空間對應的資料檔案   
  3. RMAN> host 'rm /oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf'  
  4. 2> ;  
  5.   
  6. --啟動資料庫到mount狀態並進行恢複(為資料檔案指定新位置,轉儲資料檔案,恢複資料檔案,開啟資料庫)   
  7. RMAN> run {  
  8. 2> startup force mount;  
  9. 3> set newname for datafile 1 to '/oracle/10g/oracle/product/10.2.0/oradata/oralife/system01.dbf';  
  10. 4> restore datafile 1;  
  11. 5> switch datafile 1;  
  12. 6> recover datafile 1;  
  13. 7> sql 'alter database open';  
  14. 8> }  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.