eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 推荐电影《Juno》-朱诺 | Blog首页 | 微软发布 Windows XP SP3 补丁包 »

Oracle Logfile的常见不同状态
modb.pro

Logfile的不同状态

 

一、  V$LOG:STATUS 指的是GROUP的状态

 

UNUSED

尚未记录change的空白group(一般会出现在,loggroup刚刚被添加,或者刚刚使用了resetlogs打开数据库,或者使用clear logfile后)

 

CURRENT:

当前正在被LGWR使用的group(同时是ACTIVE状态)

 

ACTIVE

未被LGWR写,instance recovery需要的。还没有完成checkpoint

 

INACTIVE

online,未被LGWR写,对instance recovery不再有用了。

 

CLEARING

正在被cleargroupLog is being re-created as an empty log after an ALTER DATABASE CLEAR LOGFILE statement. After the log is cleared, the status changes to UNUSED.

 

CLEARING_CURRENT:

一个正在被clearCURRENT groupCurrent log is being cleared of a closed thread. The log can stay in this status if there is some failure in the switch such as an I/O error writing the new log header.)出现在中状态一般是有错误的。

 

二、V$LOGFILE:STATUS指的是member的状态

 

INVALID:

             不能使用的member,可能损坏了(另外,刚加入到redolog group的日志文件在被使用之前也是这个状态)

STALE

            见下面解释

DELETED

      被alter database drop logfile membermember

BLANK:

            正常的都是blank,不管是否被写。

 

下面是对metalink上对stale的解释:

 

Log files may have a status of stale regardless of redo log mirroring or

archival mode.

 

 

Solution Description:

=====================

 

In general, the stale status of a redo log member should not be a cause for

great concern, unless you observe that this happens frequently or

systematically.  Keep in mind that a stale log is not necessarily an invalid

log, but more of an "in-doubt" one. Once the corresponding redo group becomes

the current one again, the stale status will go away by itself.

 

 

下面是一个例子:

 

logfile中有两个filestale状态,当发生日志切换时,group1变成current状态,从而,group1下的logfile变成

blank(正常状态)

另外,这个例子也展示了logfile groupactiveinactive的变化。

当发生switch logfile前,group5current状态,switch logfile后,group5变为active状态,这说明recovery

group5是有用的,同时也说明logfile时发生的不是完全检查点。

当手工发生检查点后,group5active变为了inactive状态,此时,group5recovery不再有用。这说明:

 

alter system checkpoint发生的是完全检查点。

 

SQL> l  

  1* select * from v$logfile

SQL> /

 

    GROUP# STATUS  TYPE    MEMBER

---------- ------- ------- ----------------------------------------

         1 STALE   ONLINE  /opt/oracle/oradata/userlog2/redo01.log

         2 STALE   ONLINE  /opt/oracle/oradata/userlog2/redo02.log

         3         ONLINE  /opt/oracle/oradata/userlog2/redo03.log

         4         ONLINE  /opt/oracle/oradata/userlog2/redo04.log

         5         ONLINE  /opt/oracle/oradata/userlog2/redo05.log

 

SQL> select * from v$log;

 

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

         1          1         21   20971520          1 NO  INACTIVE                704228 07-AUG-06

         2          1         22   20971520          1 NO  INACTIVE                753376 07-AUG-06

         3          1         23   20971520          1 NO  INACTIVE                785843 07-AUG-06

         4          1         24   20971520          1 NO  INACTIVE                868923 08-AUG-06

         5          1         25   20971520          1 NO  CURRENT                 951980 10-AUG-06

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> select * from v$logfile;

 

    GROUP# STATUS  TYPE    MEMBER

---------- ------- ------- ----------------------------------------

         1         ONLINE  /opt/oracle/oradata/userlog2/redo01.log

         2 STALE   ONLINE  /opt/oracle/oradata/userlog2/redo02.log

         3         ONLINE  /opt/oracle/oradata/userlog2/redo03.log

         4         ONLINE  /opt/oracle/oradata/userlog2/redo04.log

         5         ONLINE  /opt/oracle/oradata/userlog2/redo05.log

 

SQL> select * from v$log;

 

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

         1          1         26   20971520          1 NO  CURRENT                 994126 10-AUG-06

         2          1         22   20971520          1 NO  INACTIVE                753376 07-AUG-06

         3          1         23   20971520          1 NO  INACTIVE                785843 07-AUG-06

         4          1         24   20971520          1 NO  INACTIVE                868923 08-AUG-06

         5          1         25   20971520          1 NO  ACTIVE                  951980 10-AUG-06

 

SQL>

SQL> alter system checkpoint;

 

System altered.

 

SQL> select * from v$log;

 

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

         1          1         26   20971520          1 NO  CURRENT                 994126 10-AUG-06

         2          1         22   20971520          1 NO  INACTIVE                753376 07-AUG-06

         3          1         23   20971520          1 NO  INACTIVE                785843 07-AUG-06

         4          1         24   20971520          1 NO  INACTIVE                868923 08-AUG-06

         5          1         25   20971520          1 NO  INACTIVE                951980 10-AUG-06

 

  - The End-


历史上的今天...
    >> 2015-05-07文章:
    >> 2012-05-07文章:
    >> 2009-05-07文章:
    >> 2006-05-07文章:
           繁华,不过是一掬细沙
           节日过后 几点关注
    >> 2005-05-07文章:
           Google的新玩具:Webaccelerator
           2005.05.03司马台之行

By eygle on 2008-05-07 22:59 | Comments (0) | FAQ | 2705 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com