暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

数据字典视图之:DBA_LOGSTDBY_LOG结构

原创 eygle 2009-02-06
582
DBA_LOGSTDBY_LOG是逻辑Standby数据库中比较重要的一个字典视图,该视图用来记录当前的归档日志应用情况,通过该视图可以查看应用日志的SEQUENCE#,APPLIED状况等。

该视图的构建语法如下(来自Oracle 11gR1数据库):

SELECT thread#, resetlogs_change#, reset_timestamp resetlogs_id, sequence#,
       first_change#, next_change#, first_time, next_time, file_name,
       TIMESTAMP, dict_begin, dict_end,
       (CASE
           WHEN l.next_change# < p.read_scn
              THEN 'YES'
           WHEN ((BITAND (l.CONTENTS, 16) = 16) AND (BITAND (l.status, 4) = 0))
              THEN 'FETCHING'
           WHEN ((BITAND (l.CONTENTS, 16) = 16) AND (BITAND (l.status, 4) = 4))
              THEN 'CORRUPT'
           WHEN l.first_change# < p.applied_scn
              THEN 'CURRENT'
           ELSE 'NO'
        END
       ) applied
  FROM SYSTEM.logmnr_log$ l, dba_logstdby_progress p
 WHERE session# = (SELECT VALUE
                     FROM SYSTEM.logstdby$parameters
                    WHERE NAME = 'LMNR_SID')
   AND (flags IS NULL OR BITAND (l.flags, 16) = 0);

引用Oracle文档说明如下:

DBA_LOGSTDBY_LOG displays information about the logs registered for a logical standby database. This view is for logical standby databases only.
































































































ColumnDatatypeNULLDescription
THREAD#NUMBERNOT NULLThread ID of the archive log. The THREAD number is 1 for a single instance. For Real Application Clusters, this column will contain different numbers.
RESETLOGS_CHANGE#NUMBERNOT NULLStart SCN of the branch
RESETLOGS_IDNUMBERNOT NULLResetlogs identifier (a numerical form of the timestamp of the branch)
SEQUENCE#NUMBERNOT NULLSequence number of the archive log file
FIRST_CHANGE#NUMBERNOT NULLSystem change number (SCN) of the current archive log
NEXT_CHANGE#NUMBER SCN of the next archive log
FIRST_TIMEDATE Date of the current archive log
NEXT_TIMEDATE Date of the next archive log
FILE_NAMEVARCHAR2(513) Name of the archive log
TIMESTAMPDATE Time when the archive log was registered
DICT_BEGINVARCHAR2(3) Indicates whether the beginning of the dictionary build is in this archive log (YES) or not (NO)
DICT_ENDVARCHAR2(3) Indicates whether the end of the dictionary build is in this archive log (YES) or not (NO)
APPLIEDVARCHAR2(8) Indicates primarily whether a given foreign archived log has been applied fully by SQL Apply:

  • YES - SQL Apply has fully applied the foreign archived log and no longer needs it



  • CURRENT - SQL Apply is currently applying changes contained in the foreign archived log



  • NO - SQL Apply has not started applying any changes contained in the foreign archived log



  • FETCHING - SQL Apply encountered a corruption while
    reading redo records from this foreign archived log, and is currently
    using the automatic gap resolution to refetch a new copy of the log
    from the primary database



  • CORRUPT - SQL Apply encountered a corruption while
    reading redo records from this foreign archived log, and refetching a
    new copy of the archived log did not resolve the problem. SQL Apply
    will not refetch a new copy of this archived log automatically, and
    will require user intervention to manually register a new copy of the
    foreign archived log.








Note:


The SCN values in this view correlate to the SCN values shown in the DBA_LOGSTDBY_PROGRESS view.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论