星期四, 9月 20, 2012

Oracle 如何用RMAN 註冊backuppiece (檔案路徑有修改)

最近與原廠交流學到的恢復技巧 先留下來mark先 ...當然其中太多小眉角...等有空來測試一下.

特殊RMAN回復技巧(Oracle 10g 以上)
1.透過RMAN部分回復datafiles(DB : mount 狀態)
  1.1 刪除所有catalog backupset from controlfile.
      --如何查詢 : list backup;
      SQL>change backuppiece piece_num# uncatalog;
  1.2 手動註冊備份檔, 僅註冊想要的備份(最常使用在異機恢復, 並非所有RMAN備份檔都在異機 , 所以手動把最新備份註冊到control file 去 , 假設使用舊的control file , 就不會有新的備份資料資訊 , 假設使用最新的control file 則不會有此問題 , 只要設定recover until 條件就可順利恢復 )
  # Catalog specific backup piece.
  CATALOG BACKUPPIECE '/backup/MYSID/01dmsbj4_1_1.bcp';
 
  # Catalog all files and the contents of directories which
  # begin with the pattern "/backup/MYSID/arch".
  CATALOG START WITH '/backup/MYSID/arch';

2.透過RMAN回復僅需要的archive logs(異機空間不足的前提下 , 用此方法很方便)
rman log=restore_arch.log << EOF
connect target /
run
{
set archivelog destination to '/home/oracle/arch';
restore archivelog from sequence 189713 until sequence 189810 thread 1;
restore archivelog from sequence 217940 until sequence 218057 thread 2;
}
EOF

---
For Oracle 9i  http://docs.oracle.com/cd/B10501_01/server.920/a96565/rcmsynta11.htm#1005792

Examples


Cataloging an Archived Redo Log: Example

This example assumes that you made operating system copies of archived logs or transferred them from another location, and then added them to the RMAN repository:
CATALOG ARCHIVELOG '?/oradata/archive1_30.dbf', '?/oradata/archive1_31.dbf', 
                   '?/oradata/archive1_32.dbf';

Cataloging a File Copy as an Incremental Backup: Example

The following example catalogs datafile copy users01.bak as an incremental level 0 backup:
CATALOG DATAFILECOPY '?/oradata/users01.bak' LEVEL 0;


Note that you can create datafile copies both with the RMAN COPY command and by using operating system utilities in conjunction with ALTER TABLESPACE BEGIN/END BACKUP.

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...