使用RMAN對控制檔案進行restore

來源:互聯網
上載者:User

標籤:

控制檔案的預設備份格式是:
  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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.