User-managed 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

转载于:https://www.cnblogs.com/moveofgod/archive/2013/02/22/2922705.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值