1. 程式人生 > >【轉】RMAN-06094: datafile 1 must be restored ID 1339439.1

【轉】RMAN-06094: datafile 1 must be restored ID 1339439.1

很好 oca 打印錯誤 報錯 dot com 有效 lis 如果

【轉自】:https://blog.csdn.net/u010692693/article/details/78537018

一次Data Guard斷檔,主端歸檔日誌被刪除,通過基於SCN在主端做增量備份,備端recover database時出現類似以下報錯:

  1. RMAN> RECOVER DATABASE;
  2. Starting recover at 18 JUL 2011 18:12:10
  3. allocated channel: ORA_DISK_1
  4. channel ORA_DISK_1: sid=267 devtype=DISK
  5. RMAN-00571: ===========================================================
  6. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  7. RMAN-00571: ===========================================================
  8. RMAN-03002: failure of recover command at 07/18/2011 18:12:11
  9. RMAN-06094: datafile 1 must be restored

搜索MOS發現以下文章,完美解決問題:

RMAN-06094 or RMAN-06571 During Recovery or Switch to Copy at Standby Site (文檔 ID 1339439.1)

嘗試從增量備份恢復數據庫時,遇到以下錯誤:

  1. RMAN> RECOVER DATABASE NOREDO;
  2. Starting recover at 18 JUL 2011 18:12:10
  3. allocated channel: ORA_DISK_1
  4. channel ORA_DISK_1: sid=267 devtype=DISK
  5. RMAN-00571: ===========================================================
  6. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  7. RMAN-00571: ===========================================================
  8. RMAN-03002: failure of recover command at 07/18/2011 18:12:11
  9. RMAN-06094: datafile 1 must be restored

Further, there doesn‘t appear to be a valid copy of the datafiles to use:
此外,似乎沒有要使用的數據文件的有效副本:

  1. RMAN> SWITCH DATABASE TO COPY;
  2. RMAN-00571: ===========================================================
  3. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  4. RMAN-00571: ===========================================================
  5. RMAN-03002: failure of switch to copy command at 07/18/2011 17:10:17
  6. RMAN-06571: datafile 1 does not have recoverable copy

Note: Even though the above is reporting errors on datafile 1, this is not necessarily the full extent of the problem. Rather than printing an error message for each file in question (imagine a system with five thousand or more datafiles!), RMAN is only showing you the first file with a problem.
註:即使上面報告數據文件1的錯誤,這不一定是問題的全部範圍。 而不是為每個有問題的文件打印錯誤消息(想象一下有五千個或更多數據文件的系統!),RMAN只會向您顯示出現問題的第一個文件。

The errors RMAN-06094 or RMAN-06571 can be encountered after recreating the standby controlfile, where datafiles at the primary site reside in a different directory to the standby site.

重新創建備用控制文件後,可能會遇到錯誤RMAN-06094或RMAN-06571,其中主站點上的數據文件駐留在與備用站點不同的目錄中。

When a standby controlfile is recreated, by restoring it from the primary site, the datafile names as shown in v$datafile and RMAN‘s REPORT SCHEMA will actually reflect those of the primary database rather than the standby database.

當重新創建備用控制文件時,通過從主站點恢復,v $ datafile和RMAN的REPORT SCHEMA中顯示的數據文件名稱實際上將反映主數據庫的數據文件名稱,而不是備用數據庫。

RMAN> report schema;

Look at the SIZE and NAME columns. The SIZE of 0 is a good indication that the file does not physically exist on disk.

For example:

看看SIZE和NAME列。 0的SIZE 很好地表明該文件在物理上不存在於磁盤上。
例如:

  1. File Size(MB) Tablespace RB segs Datafile Name
  2. ---- -------- ----------------- ------- ------------------------
  3. 1 0 SYSTEM *** +DG1/prod/datafile/system.423.756840583
  4. 2 0 UNDOTBS1 *** +DG1/prod/datafil/undotbs1.258.667475049
  5. 3 0 SYSAUX *** +DG1/prod/datafil/sysaux.257.667475049
  6. 4 0 USERS *** +DG1/prod/datafile/users.259.667475049
  7. ASMCMD> ls -lt +DG1/prod/datafile/system.423.756840583
  8. asmcmd: entry ‘prod‘ does not exist in directory ‘+DG1/‘

Often the datafiles do actually reside on disk in either a different directory or filename. So you just need to tell RMAN where they are.
1) If the datafiles are all in the same directory path, you can catalog them all with one command:

通常,數據文件實際上駐留在不同的目錄或文件名中的磁盤上。 所以你只需要告訴RMAN他們在哪裏。
1)如果數據文件都在相同的目錄路徑中,可以用一個命令將它們全部編目:

RMAN> catalog start with ‘full pathname‘;

Otherwise, to catalog an individual datafile:
否則,要編制一個單獨的數據文件:

RMAN> catalog datafilecopy ‘full path filename‘;

2) Confirm that RMAN knows about the newly cataloged datafile copies:

2)確認RMAN知道新編目的數據文件副本:

  1. RMAN> list copy of database;
  2. RMAN> list copy of datafile n;
  3. eg.
  4. RMAN> list copy of datafile 1;
  5. OR to list multiple copies:
  6. RMAN> list copy of datafile 1,2,3,4;

3) Rename the datafiles to the correct copy on disk
a) If all datafiles needs to be renamed:

3)將數據文件重命名為磁盤上的正確副本
a)如果所有數據文件都需要重命名:

RMAN> switch database to copy;

b) If only renaming a single datafile:

b)如果只重命名單個數據文件:

  1. RMAN> switch datafile n to copy;
  2. eg.
  3. RMAN> switch datafile 1 to copy;

c) If renaming a list of files:

c)如果重命名文件列表:

  1. RMAN> switch datafile n,o,p,q to copy;
  2. eg.
  3. RMAN> switch datafile 1,2,3,4 to copy;

d) to rename to a specific copy:

d)重命名為特定副本:

  1. RMAN> run {
  2. switch datafile ‘old datafile path and name‘ to datafilecopy ‘new datafile path and name‘;
  3. }

4) The controlfile should now reflect the real datafiles on disk, with their correct size and names.

4)控制文件現在應該反映磁盤上的真實數據文件,其正確的大小和名稱。

  1. RMAN> report schema;
  2. File Size(MB) Tablespace RB segs Datafile Name
  3. ---- -------- ----------------- ------- ------------------------
  4. 1 500 SYSTEM *** +DG1/stby/datafile/system.423.756840583
  5. 2 200 UNDOTBS1 *** +DG1/stby/datafile/undotbs1.258.667475049
  6. 3 350 SYSAUX *** +DG1/stby/datafile/sysaux.257.756996199
  7. 4 545 USERS *** +DG1/stby/datafile/users.259.756996261
-- END --

【轉】RMAN-06094: datafile 1 must be restored ID 1339439.1