使用RMAN recover database時遇到ORA-01119 ORA-27040 錯誤的解決辦法

ljm0211發表於2012-07-02

問題描述:

DATA COLLECTED
===============

CUSTOMER STATEMENT
------------------
不過在恢復資料的過程中,用8月1號的全備份,恢復到8月26號的時候有報錯,好像是在8月26號時有在資料庫中新增一個資料檔案。
錯誤資訊如下:
……
archive log filename=/image/oraywzkr/archive/arch_2bc2b0e5_1_684411423_3030.log thread=1
sequence=3030
archive log filename=/image/oraywzkr/archive/arch_2bc2b0e5_1_684411423_3031.log thread=1
sequence=3031
creating datafile fno=22 name=/ywzkr_db/ywzkr/jy_data_tbs04.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/23/2009 09:33:22
ORA-01119: error in creating database file '/ywzkr_db/ywzkr/jy_data_tbs04.dbf'
ORA-27040: file create error, unable to create file
HPUX-ia64 Error: 2: No such file or directory

其中/ywzkr_db/ywzkr/jy_data_tbs04.dbf 應該是8月26號在生產庫中新增的一個資料檔案,這個問題應該如何解決,敬請李顧問回電,謝謝!

看錯誤資訊好像找不到ywzkr_db路徑,做了一個軟連線:
ln -s /image/oraywzkr/oradata /ywzkr_db

在執行recover操作:
RMAN> run {
2> set newname for datafile '/ywzkr_db/ywzkr/jy_data_tbs04.dbf' to
'/image/oraywzkr/oradata/ywzkr/jy_data_tbs04.dbf';
3> recover database until time '2009-08-26 22:00:00';
4> }

executing command: SET NEWNAME
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of set command at 10/23/2009 09:39:33
RMAN-20201: datafile not found in the recovery catalog
RMAN-06010: error while looking up datafile: /ywzkr_db/ywzkr/jy_data_tbs04.dbf

RMAN> recover database until time '2009-08-26 22:00:00';

Starting recover at 2009-10-23 09:43:27
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/23/2009 09:43:27
RMAN-06094: datafile 22 must be restored

RMAN> recover database until time '2009-08-25 22:00:00';

Starting recover at 2009-10-23 09:44:27
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/23/2009 09:44:28
RMAN-06094: datafile 22 must be restored

解決辦法:

ACTION PLAN
============
1. recover database
run
{
set until time "to_date('2009-08-26 22:00:00','yyyy-mm-dd hh24:mi:ss')";
recover database;
}

2. Error occured then issue following sql.

SQL>select name from v$datafile where file#=22;
=>UNNAMED0002

SQL>alter database create datafile 'UNNAMED0002' as '/image/oraywzkr/oradata/ywzkr/jy_data_tbs04.dbf';

3. recover database again.

run
{
set until time "to_date('2009-08-26 22:00:00','yyyy-mm-dd hh24:mi:ss')";
recover database;
}

For more detail ,you can refer to Note 130724.1 RMAN-06023 Recover from Missing Datafile that is Never Backed Up

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11411056/viewspace-734423/,如需轉載,請註明出處,否則將追究法律責任。

相關文章