• Usermanaged Complete Recovery


    image

    complete recovery: 完全恢复, 数据几乎没有丢失.

    不完全恢复: 恢复, 只能恢复到没有发生问题之前的某个时间点的数据.( 注意是某个时间点 )

    image

    先将cope过来的内容copy 回去, 然后根据 redo log 和 archive log 日志进行 redo data.

    image

    1. 还原数据库到 backup 时间点( 全备 )

    2. Changes from the archived redo log files and online redo log files are applied as necessary.

       undo blocks are generated at this time, This is referred to as rolling forward or cache recovery.(向前滚)

       3. The database may now contain commited and uncommited changes.

    4. The undo blocks are userd to roll back any uncommited changes. This is known as rolling back or transaction

       recovery. (回滚)

    5. The database is now in a recovered state.

    image

    You use the SQL*Plus RECOVER command to apply redo log files to the restored files. You can perform automatic recovery or step through the log files to apply the changes.

    image

    image

    image

    noarchivelog: 如果某个文件损坏, 那么需要全部文件恢复. 否则因为数据文件在不同的时间点上, 所以不能协同作业.

    When media failure occurs in a database operating in Noarchivelog mode, you need a valid closed database backup to recover. In Noarchivelog mode, all Oracle database files must be resotred, even if only one datafile is damaged or lost. Make sure you restore all of the following files: datafiles and control files. If you took a backup of the online redo log files when you backed up the datafile and control files, you can also resotre those files. Remember, all Oracle database files must be synchronized for the database to open.

    You should restore the password and parameter files only if they are corrupt or lost.

    image

    image

    如果磁盘损坏:

    首先, 加一块新的磁盘, 分区, 格式化

    然后, 挂载, mount /dev/sdb1 md( 目录 ), 将备份文件复制到 md 目录下, 这是在新的磁盘下

    然后, 修改 parameter file ( spfile, 例如: 控制文件目录 )

    然后, 修改 control file ( 将系统文件, 数据文件的路径修改 ) , mount 状态下连接数据库, 然后查 v$datafile 找到相应文件的目录,然后 alter database rename file ‘/u01/oradata/morewood/system01.dbf’ to ‘/u01/oradata/md/system01.dbf’; 类似这样, 一个一个修改. 还要改临时文件, v$tempfile. 还要改联机重做日志 v$logfile.

    image

    联机重做日志没有备份. 自动创建联机重做日志文件.

    recover database until cancel using backup confile;

    image

    恢复的原则, 如果数据存在, 就可以恢复.

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    数据库关闭的情况下, 硬件损坏怎么恢复

    业务要求在打开数据库的情况下进行恢复

    image

    第2步, 将损坏的文件 offline

    第4种情况 没有备份, 如果损坏了

    image

    image

    image

    image

    image

    image

    image

    image

    image

  • 相关阅读:
    Collections和Arrays常用方法
    集合(三)------双列集合
    集合(二)------单列集合
    集合(一)----------概述
    泛型
    线程
    Math类和Random类(数学公式相关类)
    时间相关的类
    Runtime类及其常用方法
    第65题:有效数字
  • 原文地址:https://www.cnblogs.com/moveofgod/p/2922705.html
Copyright © 2020-2023  润新知