v$dataguard_stats

v$dataguard_stats
一般是用这个动态视图来查看 备库到主库的应用日志延迟时间。首先解释下个字段的含义

NAME:

 

apply lag:Amount of time that the application of redo data on the standby database lags behind the primary database.APPLY LAG -  Apply lag is a measure of the degree to which the data in a standby database lags behind the data in the primary database,            due to delays in propagating and applying redo to the standby database. This value is relevent only to the applying instance. (只与应用日志的实例有关,也就是 对于已经传到备库的redo来说,需要应用这部分redo日志需要的应用时间)备库通过应用主库传过来的redo日志与主库同步所延迟的时间。

TRANSPORT LAG: How much redo data (in time units) generated by the primary database is not available or                applicable on the standby database at the time of computation。没有传到备库的redo量或者在已经传输到备库但是备库没有应用的redo量。

APPLY FINISH TIME :表示在备库上完成redo应用所需要的时间。An estimate of the time needed to apply all received, but unapplied redo from the primary database.                   (从主数据库已经接收到了,但是没有应用的重做日志 所需的时间估计。)

ESTIMATED STARTUP TIME:启动和打开物理备库需要的时间,不适用逻辑备库

standby has been open,该值表示物理备库自从上次启动以来,是否以OPEN READ ONLY方式打开过?该参数值如果是Y,现在需要做FAILOVER,那么就需要先将该物理备库shutdown然后以OPEN READ WRITE方式打开。从第1个查询中,看到该物理备库如果做FAILOVER,那么就需要shutdown--->startup open read write;第2个查询中则没有该记录,因为11g的dataguard可以一边OPEN READ ONLY,一边执行redo apply,也就是11g 的ACTIVE Dataguard。

 

VALUE:参数的值

UNIT:各个参数的时间单元。

TIME_COMPUTED:物理备库上估算各个参数的本地时间

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> select * from v$dataguard_stats;

NAME                 VALUE
-------------------- --------------------
UNIT
------------------------------------------------------------
TIME_COMPUTED        DATUM_TIME
-------------------- --------------------
transport lag        +00 00:00:00
day(2) to second(0) interval
11/19/2014 03:04:55  11/19/2014 03:04:14

apply lag            +00 00:57:25
day(2) to second(0) interval
11/19/2014 03:04:55  11/19/2014 03:04:14

NAME                 VALUE
-------------------- --------------------
UNIT
------------------------------------------------------------
TIME_COMPUTED        DATUM_TIME
-------------------- --------------------

apply finish time    +00 00:00:18.000
day(2) to second(3) interval
11/19/2014 03:04:55


 

 

 

该动态性能视图显示出在主库产生了多少重做日志数据,但是没有被备库所应用,所以通过该视图基本可以确定当主库崩溃的话,备库将丢失多少重做日志数据,同时我们可以估算failover的时间(apply finish time + estimated startup time).

官方原文:

V$DATAGUARD_STATS displays information about Oracle Data Guard metrics when queried on a standby database. No rows are returned when queried on a primary database.

ColumnDatatypeDescription

SOURCE_DBID

NUMBER

Database ID of the protected source database

SOURCE_DB_UNIQUE_NAME

VARCHAR2(32)

DB unique name of the protected source database

NAME

VARCHAR2(32)

Name of the metric:

  • APPLY FINISH TIME - An estimate of the time needed to apply all received, but unapplied redo from the primary database. If there are one or more redo gaps on the standby database, an estimate of the time needed to apply all received, but unapplied redo up to the end of the last archived redo log before the beginning of the earliest redo gap.

  • APPLY LAG - Apply lag is a measure of the degree to which the data in a standby database lags behind the data in the primary database, due to delays in propagating and applying redo to the standby database. This value is relevent only to the applying instance.

  • TRANSPORT LAG - Transport lag is a measure of the degree to which the transport of redo to the standby database lags behind the generation of redo on the primary database. If there are one or more redo gaps on the standby database, the transport lag is calculated as if no redo has been received after the beginning of the earliest redo gap.

  • ESTIMATED STARTUP TIME - An estimate of the time needed to start and open the database.

VALUE

VARCHAR2(64)

Value of the metric

UNIT

VARCHAR2(30)

Unit of measurement

TIME_COMPUTED

VARCHAR2(30)

Local time at the standby database when the metric was computed

DATUM_TIME

VARCHAR2(30)

Local time at the standby database when the datum used to compute the metric was received

The APPLY LAG and TRANSPORT LAG metrics are computed based on data that is periodically received from the primary database. An unchanging value in this column across multiple queries indicates that the standby database is not receiving data from the primary database.

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

相关推荐