1.基于scn做不完全恢复
Select Recid,
Stamp,
Thread#,
Sequence#,
First_Change# First_Time,
Next_Change#
From V$archived_Log
Where Resetlogs_Change# = (Select Resetlogs_Change#
From V$database_Incarnation
Where Status = 'CURRENT');
RECID STAMP THREAD# SEQUENCE# FIRST_TIME NEXT_CHANGE#
60 788191628 1 1 1154977 1155349
61 788191760 1 2 1155349 1155413
62 788191840 1 3 1155413 1155453
这里我们只恢复到日志2,即找到日志2里最大的scn为1155413
run{
set until scn 1155413;
allocate channel c1 device type disk;
restore database;
recover database;
release channel c1;
}
2.基于sequence做不完全恢复
run{
set until sequence 3 thread 1;
allocate channel c1 device type disk;
restore database;
recover database;
release channel c1;
}
这里用到日志3前的日志(不包含日志3)
3.基于时间点的不完全恢复
Select Recid,
Stamp,
Thread#,
Sequence#,
First_Change# First_Time,
Next_Change#,
t.completion_time -- 这里可以查到某个日志归档完成的时间点,可以参考这个时间点恢复
From V$archived_Log t
Where Resetlogs_Change# = (Select Resetlogs_Change#
From V$database_Incarnation
Where Status = 'CURRENT');
run{
set until time "to_date('2012-7-9 15:07:20','YYYY-MM-DD HH24:MI:SS')";
allocate channel c1 device type disk;
restore database;
recover database;
release channel c1;
}
4.表空间完全恢复
run{
allocate channel c1 device type disk;
restore tablespace tps_hxl01;
recover tablespace tps_hxl01;
release channel c1;
}
阅读(1838) | 评论(0) | 转发(0) |