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


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

    一次Data Guard断档,主端归档日志被删除,通过基于SCN在主端做增量备份,备端recover database时出现类似以下报错:

    1.  
      RMAN> RECOVER DATABASE;
    2.   
    3.  
      Starting recover at 18 JUL 2011 18:12:10
    4.  
      allocated channel: ORA_DISK_1
    5.  
      channel ORA_DISK_1: sid=267 devtype=DISK
    6.  
      RMAN-00571: ===========================================================
    7.  
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    8.  
      RMAN-00571: ===========================================================
    9.  
      RMAN-03002: failure of recover command at 07/18/2011 18:12:11
    10.  
      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.   
    3.  
      Starting recover at 18 JUL 2011 18:12:10
    4.  
      allocated channel: ORA_DISK_1
    5.  
      channel ORA_DISK_1: sid=267 devtype=DISK
    6.  
      RMAN-00571: ===========================================================
    7.  
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    8.  
      RMAN-00571: ===========================================================
    9.  
      RMAN-03002: failure of recover command at 07/18/2011 18:12:11
    10.  
      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.   
    3.  
      RMAN-00571: ===========================================================
    4.  
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    5.  
      RMAN-00571: ===========================================================
    6.  
      RMAN-03002: failure of switch to copy command at 07/18/2011 17:10:17
    7.  
      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.   
    8.   
    9.  
      ASMCMD> ls -lt +DG1/prod/datafile/system.423.756840583
    10.  
      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.   
    3.  
      RMAN> list copy of datafile n;
    4.  
      eg.
    5.  
      RMAN> list copy of datafile 1;
    6.   
    7.  
      OR to list multiple copies:
    8.  
      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.   
    3.  
      File Size(MB) Tablespace RB segs Datafile Name
    4.  
      ---- -------- ----------------- ------- ------------------------
    5.  
      1 500 SYSTEM *** +DG1/stby/datafile/system.423.756840583
    6.  
      2 200 UNDOTBS1 *** +DG1/stby/datafile/undotbs1.258.667475049
    7.  
      3 350 SYSAUX *** +DG1/stby/datafile/sysaux.257.756996199
    8.  
      4 545 USERS *** +DG1/stby/datafile/users.259.756996261
     
    -- END --
     
  • 相关阅读:
    【以前的空间】poj 2288 Islands and Bridges
    【以前的空间】网络流合集
    【以前的空间】 单调队列系列
    【以前的空间】几道平衡树
    【以前的空间】vijos 1720 阿狸的打字机
    对拍程序
    【Ubuntu】编写一个c语言代码
    用Matlab对数据进行线性拟合算法
    Oracle视图传递参数
    oracle decode的用法
  • 原文地址:https://www.cnblogs.com/fengaix6/p/9357597.html
Copyright © 2020-2023  润新知