还原(Restore):如果是基于用户管理(手工)的还原恢复,需要用户主动在系统层面进行拷贝粘贴,这个操作过程称之为还原;如果是基于恢复管理器(RMAN)的恢复,则通过Restore命令进行还原(自动进行)。
恢复(Recover):在完成还原动作之后,数据回到了还原点,但从这个还原点到宕机时间点之间的数据,就要利用归档日志和在线日志进行前滚,直至应用到宕机前最后一次commit提交的状态(完全恢复),或应用到指定的某个时间点(不完全恢复)。
restore | recover |
---|---|
只是用备份来还原。 | 是用archivelog 或者online log 。 |
是转储 也是還原被损坏文件(RMAN经常用)。 | 是恢复 通过 redo log & archive log 恢复。 |
使用备份文件,将数据库还原到过去的某个状态。 | 使用redo日志和归档日志将数据库向前恢复,一步步的恢复到现在这个时点。 |
A corrupted data file is overwritten from a backup of the data file .The data file is at a prior point of time than the current database. | Recovery applies the changes to the individual blocks,using archive and redo information,to move the database forward to the current point in time. |
举例说明:
假设我时间点A,做了个备份,时间点B数据库挂了
restore database ;
// 这个操作利用时间点A做的备份来还原,返回到时间点A
recover database ;
//这个操作利用archivelog and online log做recover,从时间点A,推进到时间点B。