zoukankan      html  css  js  c++  java
  • 在没有备份的情况下重新创建丢失的数据文件 (Doc ID 1149946.1)

    Recreating a missing datafile with no backups (Doc ID 1149946.1)

    APPLIES TO:

    Oracle Database - Enterprise Edition - Version 10.2.0.2 and later
    Information in this document applies to any platform.
    ***Checked for relevance on 16-Apr-2014***

    GOAL

    How to recreate a datafile that is missing at the operating system level. Missing/inaccessible files may be reported with one or more of these errors:

    如何重新创建操作系统级别上缺少的数据文件。丢失/无法访问的文件可能会报告,其中包含以下一个或多个错误

    ORA-01116: error in opening database file %s
    ORA-27041: unable to open file
    ORA-01157: cannot identify/lock data file %s - see DBWR trace file
    ORA-01119: error in creating database file '%s'
    

    No backup or copy of the datafile is required. We only need the redo logs starting from the time of the datafile creation to the current point in time.

    无需备份或复制数据文件。我们只需要从创建数据文件到当前时间点的 redo logs

    Note: plugged-in datafiles do not apply in this scenario and needs to be plugged-in again from its source.

    注意:插入的数据文件在这种情况下不适用,需要从其源中再次插入

    SOLUTION

    When a datafile goes missing at the operating system level, you would normally need to restore and recover it from a backup. If you do not have backups of this datafile, but do have redo logs you can still create and recover the datafile. You only need the redo logs starting from the datafile creation time to now.

    当数据文件在操作系统级别丢失时,通常需要从备份中还原和恢复它。如果您没有此数据文件的备份,但是有 redo logs,则仍然可以创建和恢复该数据文件。您只需要从数据文件创建时间到现在的 redo logs

    Prior to 10g, you would use the following SQL command:  在10g之前,您将使用以下SQL命令

    SQL> alter database create datafile 'missing name' as 'misisng name';
    SQL> recover datafile 'missing name';
    SQL> alter database datafile '<missing name>' online;
    

    As of 10g, you can also do this in RMAN.  从10g开始,您也可以在RMAN中执行此操作

    1) RMAN will create the datafile if there is no backups or copies of this datafile:

        如果没有该数据文件的备份或副本,RMAN将创建该数据文件

    RMAN> restore datafile <missing file id>;
    

    2) Recover the newly created datafile:  恢复新创建的数据文件

    RMAN> recover datafile <missing file id>;
    

    3) Bring it online:

    RMAN> sql 'alter database datafile <missing file id> online';
    

    Example:

    RMAN> list copy of datafile 6;
    
    specification does not match any datafile copy in the repository
    
    RMAN> list backup of datafile 6;
    
    specification does not match any backup in the repository
    
    RMAN> restore datafile 6;
    
    Starting restore at 14 JUL 10 10:20:02
    using channel ORA_DISK_1
    
    creating datafile file number=6 name=/opt/app/oracle/oradata/ORA112/datafile/o1_mf_leng_ts_63t08t64_.dbf
    restore not done; all files read only, offline, or already restored
    Finished restore at 14 JUL 10 10:20:05
    
    RMAN> recover datafile 6;
    
    Starting recover at 14 JUL 10 10:21:02
    using channel ORA_DISK_1
    
    starting media recovery
    media recovery complete, elapsed time: 00:00:00
    
    Finished recover at 14 JUL 10 10:21:02
    
    RMAN> sql 'alter database datafile 6 online';
    
    sql statement: alter database datafile 6 online
    

      

  • 相关阅读:
    poj 1789 每个字符串不同的字母数代表两个结点间的权值 (MST)
    poj 1251 poj 1258 hdu 1863 poj 1287 poj 2421 hdu 1233 最小生成树模板题
    poj 1631 最多能有多少条不交叉的线 最大非降子序列 (LIS)
    hdu 5256 最少修改多少个数 能使原数列严格递增 (LIS)
    hdu 1025 上面n个点与下面n个点对应连线 求最多能连有多少条不相交的线 (LIS)
    Gym 100512F Funny Game (博弈+数论)
    UVa 12714 Two Points Revisited (水题,计算几何)
    UVa 12717 Fiasco (BFS模拟)
    UVa 12718 Dromicpalin Substrings (暴力)
    UVa 12716 && UVaLive 6657 GCD XOR (数论)
  • 原文地址:https://www.cnblogs.com/zylong-sys/p/12004746.html
Copyright © 2011-2022 走看看