基于sequence恢复rman备份
- [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog
- RMAN> run {
- startup force mount;
- set until sequence=3;
- restore database;
- recover database;
- sql 'alter database open resetlogs';
- }
- --查看,可见不包括日志序列号为3的归档日志信息(oracle_seq3_act),即恢复到日志序列号为2的归档日志
基于scn恢复rman备份
[oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog
RMAN> run {
2> startup force mount;
3> set until scn=1214281;
4> restore database;
5> recover database;
6> sql 'alter database open resetlogs';
7> }
基于时间恢复RMan备份
--在终端设置环境变量nls_date_format指定日期时间格式。
[oracle@localhost ~]$ export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
--恢复
[oracle@localhost ~]$ RMAN target sys/oracle@oralife nocatalog
RMAN> run {
2> startup force mount;
3> set until time='2011-08-29 21:01:00';
4> restore database;
5> recover database;
6> sql 'alter database open resetlogs';
7> }