不设定为on,控制文件无法恢复!
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;
1 查询当前时间
SQL> select to_char(sysdate,'yy-mm-dd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'
-----------------
17-11-20 16:55:14
2 rman run脚本
run {
startup force mount;
allocate channel c1 type disk;
allocate channel c2 type disk;
set until time "to_date('2017-11-20 16:45:07','yyyy-mm-dd hh24:mi:ss')";
restore database;
recover database;
alter database open resetlogs;
}
时间格式要写对否则报错
RMAN-03002: failure of restore command at 11/20/2017 16:58:49
ORA-01861: literal does not match format string