控制文件的默認備份格式是:
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' )";