时间:2021-07-01 10:21:17 帮助过:57人阅读
用rman方式基于日志序列的不完全恢复 sqlgt; select * from test;a-----123456sqlgt;hostramn target/rmangt;run{allocate ch
用rman方式基于日志序列的不完全恢复
sql> select * from test;
a
-----
1
2
3
4
5
6
sql>host
ramn target/rman>run
{
allocate channel c1 type disk;
bakup full tag 'dbful' format 'd:\backup\full_%u_%s_%p' database
include current controlfile;
sql' alter system archive log current';
release channel c1;
}
rman>exit;
sql>insert into test values(16);
sql>commit;
sql>alter system switch logfile;
sql>insert into test values(17);
sql>alter system switch logfile;sql>archive log list;
....
oldest onlie log sequence 14
next log sequence to archive 16
current log sequence 16sql>select group#,sequence#,archived,status from v$log
group# sequence# archived status
-----------------------------------
1 16 yes active
2 17 no current
3 15 yes active从这里看出备份的数据文件包含了第14个归档日志. 在线日志v$log里正在使用的是17序列的日志,15和16已经完成了归档.
当我们没有备份15和16日志.15和16包含了表test新数据16和17.
实现不完全恢复就是只恢复归档日志下面的日志数据. 不能进行实例恢复,也就是说在线日志被看成没了!
在线日志17里的数据不能被恢复, 15和16日志已经被归档,当没备份,如果没有被删除是可以被恢复的.
sql> shutdown immediate;
sql>startup nomount;
sql>alter database monut;
sql>host
rman target/
rman> run{
allocate channel c1 type disk;
set until logseq 14 thread 1;
restore database;
recover database;
sql'alter database open resetlogs';
}