rman 恢復機制與恢復測試

peng163fj發表於2015-08-07
最近設定了
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
發現oracle會刪除昨天的檔案,有點不解。
後來考慮到有可能是恢復時不需要某些檔案,所以才被標記為過期,因此做了個簡單的實驗

  1. 將三天的備份集打包zip,傳輸並解壓至恢復用機器上,目錄為/u02/backup。授權
  2. 進行不完全恢復,備份命令最後附錄
  3. 發現不需要被刪除的檔案,資料庫正常恢復成功
說明rman會檢測檔案的重複,會將檔案刪除,只要不是恢復需要的檔案

附:操作記錄
startup nomount pfile='/u02/backup/ism.ora';
restore controlfile from '/u02/backup/ISM_20150807_320_1_CONTROL';
alter database mount;
column c1 format a5
column c2 format a40
select trim(file#) c1,name c2 from v$datafile;
select trim(file#) c1,name c2 from v$tempfile;
catalog start with '/u02/backup';
run
{
set newname for datafile 1 to"/u02/oracle/app/oradata/ism/SYSTEM.DBF";
set newname for datafile 2 to"/u02/oracle/app/oradata/ism/SYSAUX.DBF";
set newname for datafile 3 to"/u02/oracle/app/oradata/ism/UNDOTBS1.DBF";
set newname for datafile 4 to"/u02/oracle/app/oradata/ism/USERS.DBF";
set newname for datafile 5 to"/u02/oracle/app/oradata/ism/NNC_DATA01.DBF";
set newname for datafile 6 to"/u02/oracle/app/oradata/ism/NNC_DATA02.DBF";
set newname for datafile 7 to"/u02/oracle/app/oradata/ism/NNC_DATA03.DBF";
set newname for datafile 8 to"/u02/oracle/app/oradata/ism/NNC_INDEX01.DBF";
set newname for datafile 9 to"/u02/oracle/app/oradata/ism/NNC_INDEX02.DBF";
set newname for datafile 10 to"/u02/oracle/app/oradata/ism/NNC_INDEX03.DBF";
set newname for tempfile 1 to"/u02/oracle/app/oradata/ism/TEMP.DBF";
restore database;
switch datafile all;
}
shutdown immediate
startup pfile='/u02/backup/ism.ora' upgrade ;

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

相關文章