標籤:
控制檔案的預設備份格式是:
c-IIIIIIIIII-YYYYMMDD-QQ
其中:
c:表示控制檔案
IIIIIIIIII:表示DBID
YYYYMMDD:備份的時間戳記
QQ:16進位的序號,從00開始,最大值為FF
使用了fast recovery area或recovery catalog
1.從自動備份中還原控制檔案
RMAN> restore controlfile from autobackup;
2.從指定備份片中還原控制檔案
RMAN> restore controlfile from ‘/tmp/piece_name‘;
3.從最近可用的控制檔案備份中還原控制檔案
RMAN> restore controlfile;
如果沒有使用fast recovery area或recovery catalog,在還原控制檔案前,要先設定dbid
4.使用$ORACLE_HOME/dbs中預設的備份
RMAN> set dbid=xxxxxxxx;
RMAN> restore controlfile from autobackup;
5.預設是從最近7天的預設備份中恢複,也可以指定天數
RMAN> set dbid=xxxxxxxx;
RMAN> restore controlfile from autobackup maxdays 20;
6.根據自動備份的序列進行還原
RMAN> set dbid=xxxxxxxx;
RMAN> restore controlfile from autobackup maxseq 20;
7.從非預設備份路徑環境
RMAN> set dbid=xxxxxxxx;
RMAN> set controlfile autobackup format for device type disk to ‘/tmp/%F‘;
RMAN> restore controlfile from autobackup;
8.從指定別分進行還原
RMAN> set dbid=xxxxxxxxx;
RMAN> restore controlfile from ‘/tmp/c-1140771490-20080502-03‘;
9.將控制檔案先還原到一個臨時目錄,再用duplicate命令根據參數control_files還原到指定位置和名稱
RMAN> set dbid=xxxxxxxxx;
RMAN> restore controlfile from ‘/tmp/c-1140771490-2008050203‘ to ‘/tmp/control.tmp‘;
RMAN> replicate controlfile from ‘/tmp/control.tmp‘;
10.根據時間點進行還原
RMAN> restore controlfile from autobackup until time "to_date(‘Jan 23 2009 14:00:00‘, ‘MON DD YYYY HH24:MI:SS‘ )";
使用RMAN對控制檔案進行restore