我通过之前的一个rman备份文件恢复了一个数据库用于tspitr的实验。
1、通过先前的rman备份 恢复一个数据库orcl,使用resetlogs打开。
run{
shutdown immediate;
startup mount;
set until time "to_date('2011-07-25 10:05:27','yyyy-mm-dd hh24:mi:ss')";
restore database;
recover database;
alter database open resetlogs;
}
2、备份orcl,
run{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup incremental level 0 database include current controlfile plus archivelog delete all input;
release channel c1;
release channel c2;
}
3、在表空间users上创建表scott.rec_test 并插入数据。
4、多次切换logfile。
5、truncate scott.rec_test 并记录下当前时间
6、通过tspitr将表空间users恢复到truncate 之前的状态。
recover tablespace USERS until time "to_date('2011-07-25 10:43:14','yyyy-mm-dd hh24:mi:ss')"
auxiliary destination 'D:\oracle\product\10.2.0\TSPITR';
恢复最后提示
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/25/2011 10:47:35
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of sql command on default channel at 07/25/2011 10:47:35
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace USERS online
ORA-01190: control file or data file 4 is from before the last RESETLOGS
ORA-01110: data file 4: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
不知何因