• RMAN备份之丢失数据文件及控制文件的恢复


    About Recovery with a Backup Control File
    If all copies of the current control file are lost or damaged, then you must restore and mount a backup control file. You must then run the RECOVER command, even if no data files have been restored, and open the database with the RESETLOGS option. If some copies of the current control file are usable, however, then you can follow the procedure in "Responding to the Loss of a Subset of the Current Control Files" and avoid the recovery and RESETLOGS operation. When RMAN is connected to a recovery catalog, the recovery procedure with a backup control file is identical to recovery with a current control file. The RMAN metadata missing from the backup control file is available from the recovery catalog. The only exception is if the database name is not unique in the catalog, in which case you must use SET DBID command before restoring the control file.
    1. Start RMAN and connect to a target database.
    2. Start the target instance without mounting the database. RMAN>STARTUP NOMOUNT;  --控制文件丢失或损坏,只能将启动到nomount
    3. Restore the control file
    RMAN> SET DBID 320066378; # (Optional) If the database name is not unique, you need to specify the DBID
    RMAN> RUN
    {
    SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'autobackup_format';  
    RESTORE CONTROLFILE FROM AUTOBACKUP;  --从自动备份中恢复控制文件
    }
    4. Start the target instance with mounting the database. RMAN>STARTUP MOUNT;  --控制文件已恢复,可mount数据文件

    5. Restore the data files; RMAN>RESTORE DATABASE;  --restore/recover损坏的数据文件
    6. Recover the database; RMAN>RECOVER DATABASE;
    7. Open the database with RESETLOGS option; RMAN> ALTER DATABASE OPEN RESETLOGS; --以resetlog方式打开数据库

  • 相关阅读:
    OCP-1Z0-051-V9.02-108题
    以一种访问权限不允许的方式做了一个访问套接字的尝试
    常用的几个官方文档
    OCP-1Z0-053-V12.02-388题
    FusionChart实现奇偶间隔显示
    OCP-1Z0-053-V12.02-138题
    Tcp and Udp NAT 穿越穿透打洞
    flashback database实验(使用lgmnr找出还原时间点)
    flashback table实验(基于undo数据)
    flashback query实验(基于undo数据)
  • 原文地址:https://www.cnblogs.com/rusking/p/4380070.html
Copyright © 2020-2023  润新知