zoukankan      html  css  js  c++  java
  • oracle 11g ocp 笔记(16)--使用rman进行恢复

    http://book.51cto.com/art/201112/306856.htm

    一、数据恢复顾问

    1)heath_moniter 和ADR

          结果存储到外部文件中,由DIGNOSTIC_DESC 决定。

         heath_moniter 只能在open状态下运行。

    2)ADR局限性

         nomount状态可以

        仅支持单实例 不支持rac和dg备库。

    3)使用

       list failure;

       ladvise   failure;

    repair failure

    二、数据库的还原和恢复

       关键文件(损坏实例立即宕机) 控制文件的任何副本,system表空间的数据文件、undo表空间的数据文件。

       非关键数据:其他的 ,包括redo log

       完全恢复和不完全恢复。 

       不完全恢复的原因是:用户错误,要恢复到错误以前,或者不能完全恢复。

    完全恢复的步骤,脱机----->还原 ---->恢复 ----->联机

    三、数据文件的恢复

        1)归档模式: restore datafile 5; recover datafile 5 ; alter database datafile 5 online;

         2)非归档模式,restore database ; alter database open resetlogs。

         3)归档模式下非关键数据 :步骤2

        4) 归档模式下关键数据,启动到mount状态下执行步骤2.

    四、不完全恢复

    步骤   mount---还原所有数据文件---还原到某一个点 -resetlog选项打开数据库。

        redo log 损坏只能不完全恢复。

        只能 sysdba进行不完全恢复,sysoper和其他用户都不可以

        until time    until scn  until sequence三个选项。

       sqlplus 和rman语法不同

                           sqlplus 使用until cancel 和until    change 、    until time

                            rman 使用 until scn  until sequence、    until time

          run{   startup mount;

                      set until time="  to_date(xxxxxxxasdadsadasd) ";

                      restore database;

                       recover database;

                       alter database open resetlogs;}

    五、控制文件的自动备份

         configure controlfile autobackup  on;

        restore controlfile from autobackup;

    六、使用映像副本恢复

        backup  as copy database;

       rman > run { sql ' alter database datafile   4  offline';

                              set newname for datafile 4 to '/u01/df_copies/users.dbf';

                             switch datafile 4;-----等同于sqlplus 的rename命令。

           recover datafile 4;

                           sql ' alter database datafile 4 online ';

    }

    如果在FRA中,可以执行switch database to copy;

    七、块恢复

    1、检测块损坏

        遇到坏块立即终止。

       set  maxcorrupt for datafile 7 to 100 ;

       backup datafile 7;

        v$database_block_corruption查询

         备份集的备份 v$backup_corruption       镜像备份在v$copy_corruption中查看

    2、块介质恢复

           好处:文件不必脱机,恢复时间减少

    3、块恢复

    block recover datafile 7 block 5,6,7 datafile 9 block 21,25;

  • 相关阅读:
    黑苹果崩溃恢复
    黑苹果声音小解决方法
    idea plugin 进度条
    phpstorm 插件
    awesome mac
    webstorm vue eslint 自动修正配置
    Laravel/php 一些调试技巧
    php ZipArchive 压缩整个文件夹
    laravel 模型事件 updated 触发条件
    php 开启 opcache 之后 require、include 还会每次都重新加载文件吗?
  • 原文地址:https://www.cnblogs.com/hezt1114/p/8980414.html
Copyright © 2011-2022 走看看