User-managed Complete Recovery
complete recovery: 完全恢复, 数据几乎没有丢失.
不完全恢复: 恢复, 只能恢复到没有发生问题之前的某个时间点的数据.( 注意是某个时间点 )
先将cope过来的内容copy 回去, 然后根据 redo log 和 archive log 日志进行 redo data.
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.
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.
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.
如果磁盘损坏:
首先, 加一块新的磁盘, 分区, 格式化
然后, 挂载, 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.
联机重做日志没有备份. 自动创建联机重做日志文件.
recover database until cancel using backup confile;
恢复的原则, 如果数据存在, 就可以恢复.
数据库关闭的情况下, 硬件损坏怎么恢复
业务要求在打开数据库的情况下进行恢复
第2步, 将损坏的文件 offline
第4种情况 没有备份, 如果损坏了