RMAN Restore生成RMAN-06172

时间:2016-11-02 16:56:10

标签: oracle rman

第一次使用RMAN,我在备份后无法进行恢复。这就是我正在做的事情:

    C:\>rman target /

首先,让我们从delete backup开始,只是为了清除平板......

然后我运行backup database;

结果:

    Starting backup at 02-NOV-16
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00004 name=C:\APP\T4PRO\ORADATA\T4PRO\USERS01.DBF
    input datafile file number=00001 name=C:\APP\T4PRO\ORADATA\T4PRO\SYSTEM01.DBF
    input datafile file number=00002 name=C:\APP\T4PRO\ORADATA\T4PRO\SYSAUX01.DBF
    input datafile file number=00003 name=C:\APP\T4PRO\ORADATA\T4PRO\UNDOTBS01.DBF
    channel ORA_DISK_1: starting piece 1 at 02-NOV-16
    channel ORA_DISK_1: finished piece 1 at 02-NOV-16
    piece handle=C:\APP\T4PRO\FLASH_RECOVERY_AREA\T4PRO\BACKUPSET\2016_11_02\O1_MF_NNNDF_TAG20161102T123933_D1N5P643_.BKP tag=TAG20161102T123933 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    including current control file in backup set
    including current SPFILE in backup set
    channel ORA_DISK_1: starting piece 1 at 02-NOV-16
    channel ORA_DISK_1: finished piece 1 at 02-NOV-16
    piece handle=C:\APP\T4PRO\FLASH_RECOVERY_AREA\T4PRO\BACKUPSET\2016_11_02\O1_MF_NCSNF_TAG20161102T123933_D1N5Q047_.BKP tag=TAG20161102T123933 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
    Finished backup at 02-NOV-16

到目前为止一切顺利。做list backup并得到这个:

    List of Backup Sets
    ===================


    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    ------- ---- -- ---------- ----------- ------------ ---------------
    11      Full    5.28G      DISK        00:00:22     02-NOV-16
            BP Key: 11   Status: AVAILABLE  Compressed: NO  Tag: TAG20161102T123933
            Piece Name: C:\APP\T4PRO\FLASH_RECOVERY_AREA\T4PRO\BACKUPSET\2016_11_02\O1_MF_NNNDF_TAG20161102T123933_D1N5P643_.BKP
      List of Datafiles in backup set 11
      File LV Type Ckp SCN    Ckp Time  Name
      ---- -- ---- ---------- --------- ----
      1       Full 1474154    02-NOV-16 C:\APP\T4PRO\ORADATA\T4PRO\SYSTEM01.DBF
      2       Full 1474154    02-NOV-16 C:\APP\T4PRO\ORADATA\T4PRO\SYSAUX01.DBF
      3       Full 1474154    02-NOV-16 C:\APP\T4PRO\ORADATA\T4PRO\UNDOTBS01.DBF
      4       Full 1474154    02-NOV-16 C:\APP\T4PRO\ORADATA\T4PRO\USERS01.DBF

    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    ------- ---- -- ---------- ----------- ------------ ---------------
    12      Full    9.36M      DISK        00:00:01     02-NOV-16
            BP Key: 12   Status: AVAILABLE  Compressed: NO  Tag: TAG20161102T123933
            Piece Name: C:\APP\T4PRO\FLASH_RECOVERY_AREA\T4PRO\BACKUPSET\2016_11_02\O1_MF_NCSNF_TAG20161102T123933_D1N5Q047_.BKP
      SPFILE Included: Modification time: 02-NOV-16
      SPFILE db_unique_name: T4PRO
      Control File Included: Ckp SCN: 1474163      Ckp time: 02-NOV-16

所以这里的一切看起来都很好。据我所知,我的控制文件是这个O1_MF_NCSNF_TAG20161102T123933_D1N5Q047_.BKP文件。接下来我想要从RMAN恢复数据库:

    RMAN> shutdown immediate

    database closed
    database dismounted
    Oracle instance shut down

    RMAN> startup nomount

    connected to target database (not started)
    Oracle instance started

    Total System Global Area    6797832192 bytes

    Fixed Size                     2188648 bytes
    Variable Size               3556772504 bytes
    Database Buffers            3221225472 bytes
    Redo Buffers                  17645568 bytes

这就是我遇到问题的地方:

    RMAN> restore controlfile from 'O1_MF_NCSNF_TAG20161102T123933_D1N5Q047_.BKP';

    Starting restore at 02-NOV-16
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=63 device type=DISK

    channel ORA_DISK_1: no AUTOBACKUP in 7 days found
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/02/2016 12:50:25
    RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

我尝试了一些不同的控制文件参数,但似乎都没有。

我错过了什么?

谢谢!

1 个答案:

答案 0 :(得分:0)

RMAN希望您提供指定句柄的完整路径,在您的情况下,它将是“O1_MF_NCSNF_TAG20161102T123933_D1N5Q047_.BKP”的完整路径。

在您的特定情况下,这将是:

  

C:\ APP \ T4PRO \ FLASH_RECOVERY_AREA \ T4PRO \ BACKUPSET \ 2016_11_02 \ O1_MF_NCSNF_TAG20161102T123933_D1N5Q047_.BKP

默认情况下,RMAN会在FRA(快速恢复区)中查找该文件,该文件与参数“db_recovery_file_dest”给出的位置相同。