zoukankan      html  css  js  c++  java
  • 【转】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 --
     
  • 相关阅读:
    Java虚拟机工作原理具体解释
    关于java的JIT知识
    php重建二叉树(函数缺省参数相关的都写在后面,比如array_slice函数中的$length属性,故第一个参数是操作的数组)
    php实现从尾到头打印列表
    thinkphp5项目--企业单车网站(九)(加强复习啊)(花了那么多时间写的博客,不复习太浪费了)
    php 面试题一(看视频的学习量比网上瞎转悠要清晰和明了很多)(看视频做好笔记)(注重复习)
    php对象和数组的相互转换(还是可以去找没有没php的高阶课程看看看)(要不别人分析一下重点要点,要不自己来,不然 效果真的不好)
    js中JSON的解析(将json字符串转化为对象)和序列化(将对象转化为json字符串)(函数的功能一般都挺全的,需要的时候去查看完整函数)
    html中radio、checkbox选中状态研究(静下心来看,静下心来总结)
    thinkphp中view页面中的volist标签转化为原生php分析(多去看源代码,你会发现不仅简单,方便你理解,还节约时间)
  • 原文地址:https://www.cnblogs.com/fengaix6/p/9357597.html
Copyright © 2011-2022 走看看