異機恢複後ORA-01152錯誤解決

來源:互聯網
上載者:User

1. 現象:

異機資料檔案恢複成功後,執行最後一步開啟資料庫時報錯。例如:

SQL > alter database open resetlogs;

報錯:

ORA-01152: file 1 was not restored from a sufficiently old backup

ORA-01110: data file 1: '/u02/Oracle/oradata/mingya/system01.dbf'

 

2. 原因:

造成這種報錯的原因是因為controlfile裡所記錄的scn與datafile裡的scn不一致,導致資料庫啟動時失敗。

 

3. 解決

3.1 確定需要恢複的achivelog

將資料庫啟動到mount狀態;

$ rman target / catalog rman/rman@catalog ;串連到RMAN

RMAN> recover database;

運行命令後,RMAN將會報錯,在最後列出需要的archivelog;例如:

RMAN-06025: no backup of log thread 1 seq 3784 lowscn 82847939 found to restore

RMAN-06025: no backup of log thread 1 seq 3783 lowscn 82845664 found to restore

其中的3783、3784是我們需要恢複的archivelog。

 

3.2 從磁帶庫備份中恢複所需archivelog

RMAN> run {

2>set archivelog destination to '/u03/oracle/archivelog'; 該路徑根據歸檔日誌實際路徑設定

3> allocate channel ch00 type 'SBT_TAPE';

4> send 'NB_ORA_SERV=BAKSERV,NB_ORA_CLIENT=HOSTA';

5> restore archivelog sequence between 3783 and 3784;

6> release channel ch00;

7> }

恢複成功後,在/u03/oracle/archivelog目錄下將看到3783、3784兩個檔案。

 

3.3 應用archivelog

RMAN> run{

2> allocate channel ch00 type disk;

3> set until sequence 3785 thread 1; 3785是需要恢複的最大號3784+1

4> recover database;

5> release channel ch00;

6> }

 

3.4 開啟資料庫

RMAN> alter database open resetlogs;

至此,資料庫可以正常開啟。為使其他用戶端能串連本資料庫,最好重新建立監聽listener.ora,其他用戶端重新設定串連檔案tnsnames.ora。

 

4. 其他問題-ORA-19625錯誤解決

在測試機上恢複操作成功後,正常啟動並執行生產主機用NBU進行備份時,可能出現以下錯誤:

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-03002: failure of backup command at 09/02/2009 02:21:47

ORA-19625: error identifying file /u03/oracle /archivelog/2009_08_31/1_3783_634497921.dbf

==== ended in error on Wed Sep 2 02:21:48 CST 2009 ====

這時需要進行以下操作修正:

登入正常啟動並執行主機:

$ rman target / catalog rman/rman@catalog

RMAN> crosscheck archivelog all;

推薦閱讀:

Oracle基礎教程之通過RMAN複製資料庫

RMAN備份策略制定參考內容

RMAN備份學習筆記

OracleDatabase Backup加密 RMAN加密

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.