天天看點

rman備份恢複

法一:全部恢複

一:先備份資料庫:

<a href="http://s3.51cto.com/wyfs02/M01/39/5B/wKiom1O5bevSOnfAAAY_n2gE7XU237.jpg" target="_blank"></a>

用report schema檢視資料檔案的目的位址

二:删除system01.dbf,sysaux01.dbf

<a href="http://s3.51cto.com/wyfs02/M00/39/5B/wKiom1O5bnHQP6VpAAXkcPW7K6o813.jpg" target="_blank"></a>

三:關閉資料庫啟動到Mount狀态下

<a href="http://s3.51cto.com/wyfs02/M00/39/5B/wKiom1O5bwGT_gfaAAE3UWxdEjc296.jpg" target="_blank"></a>

四:用rman指令恢複資料庫:

<a href="http://s3.51cto.com/wyfs02/M00/39/5B/wKiom1O5b17z4b7gAASI6fVAexY759.jpg" target="_blank"></a>

五:完成

法二:直接恢複丢失的資料檔案

一:查詢system01屬于幾号資料檔案:

<a href="http://s3.51cto.com/wyfs02/M02/39/5B/wKioL1O5eSbgytzRAAFG-3hY7cQ249.jpg" target="_blank"></a>

二:删除system01

<a href="http://s3.51cto.com/wyfs02/M01/39/5B/wKiom1O5eXDSVN1NAAOe_GVF-lM850.jpg" target="_blank"></a>

三:還原system01資料檔案:

<a href="http://s3.51cto.com/wyfs02/M00/39/5B/wKioL1O5eWbg2qqtAAKfePP3zBQ674.jpg" target="_blank"></a>

四:恢複system01資料檔案:

<a href="http://s3.51cto.com/wyfs02/M02/39/5B/wKiom1O5ecWT8XEfAADeqf0Ky8M500.jpg" target="_blank"></a>

五:驗證資料庫狀态:

<a href="http://s3.51cto.com/wyfs02/M01/39/5B/wKioL1O5eerha6L-AADZKkoMCx4267.jpg" target="_blank"></a>

另:

Oracle rman中recover和restore的差別:

restore just copy the physical file, recover will consistent the database.

restore 是還原,檔案級的恢複。就是實體檔案還原。

recover 是恢複,資料級的恢複。邏輯上恢複,比如應用歸檔日志、重做日志,全部同步,保持一緻。

用我自己的土話講就是,用restore先把備份檔案拷貝到資料庫目錄下進行替換,再用recover經過一些處理,資料庫就恢複正常了。

1、restore 指令:用于還原已經備份的資料檔案。

  (1)、restore database 還原所有的資料檔案。

  (2)、restore tablespace 還原特定表空間的資料檔案。

  (3)、restore datafile 還原特定的資料檔案。

  (4)、restore controlfile  還原控制檔案。

  (5)、restore archivelog  還原歸檔日志檔案。

2、recover 指令:當資料庫需要應用歸檔日志檔案恢複資料檔案時,使用recover指令。使用該指令資料庫系統會自動應用歸檔的日志檔案。

  (1)、recover database 恢複所有的資料檔案。

  (2)、recover tablespace 恢複特定表空間的資料檔案。

  (3)、recover datafile 恢複特定的資料檔案。

本文轉自 abc3486389 51CTO部落格,原文連結:http://blog.51cto.com/1336014/1435144