Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5600937
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类: Oracle

2007-12-03 18:50:27

基于序列号 (sequence number)
做不完全恢复之前,要给数据库做一个备份 这里用rman 做
sequence number是指 redo log的序列号
SQL> create table scott.test1(n1 number);
SQL> insert into scott.test1 values(1); 
SQL> insert into scott.test1 values(2); 
SQL> commit;                            
SQL> alter system switch logfile;       
SQL> insert into scott.test1 values(3); 
SQL> insert into scott.test1 values(4); 
SQL> commit;                            
SQL> select * from v$log;               
                                                                                                          
  
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
----- ------- ---------- ----- ------- --- ------ ------------- ----------
1      1       11        104857600   1 NO  CURRENT  305030 2007-12-03:18:39:21
2      1        9        104857600   1 YES INACTIVE 284753 2007-12-03:18:09:52
3      1       10        104857600   1 YES ACTIVE   304755 2007-12-03:18:17:49
SQL> shutdown abort
1号组为当前组,将其破坏
SQL> startup mount
RUN {
    SET UNTIL SEQUENCE 11 THREAD 1;
    RESTORE DATABASE; 
    RECOVER DATABASE;
    ALTER DATABASE OPEN RESESTLOGS;}
   
   
SQL> select * from scott.test1
  2  /                       
                             
        N1                   
----------                   
         1                   
         2                   
scott.test1 中3,4没有归档,丢失
阅读(2002) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~