Dbvisit Standby log gap report

Dbvisit Standby can inspect the primary and standby databases and report on the latest log sequence numbers. It includes reporting on the:

  • Archive log gap which is difference between the last archived sequence on the primary and the last applied sequence on the standby database. The archive log gap should be near 0 (except when APPLY_DELAY_LAG_MINUTES is used).
  • Transfer log gap which is the difference between the last archived sequence on the primary and the last sequence transferred to the standby server. The transfer log gap should be near 0.

Starting from Dbvisit Standby 5.3.12 and above, the Dbvisit Standby log gap data is automatically collected every time Dbvisit Standby is run from the primary server. The data collected is stored in the DDR for reporting purposes. It is no longer required to schedule the log gap report.
On the primary database server:
dbvisit -i <DDC>
Where DDC is the name of the Dbvisit Database Configuration. In most cases this is the same as the database name. The DDC refers to the DDC file name which is in the form: dbv_DDC.env and contains the Dbvisit Standby settings for a particular primary and standby configuration.
This produces the Dbvisit Standby log gap report.
For example:

 

 dbvisit -i w102n 
=============================================================
Dbvisit Standby Database Technology
dbvisit.exe started on win2003se-01
=============================================================

Contacting Standby Database w102n on win2003se-02...
Last standby sequence obtained (26).

Dbvisit report:
-------------------------------
Standby database on win2003se-02 is at sequence: 26
Primary database on win2003se-01 is at log sequence: 29
Primary database on win2003se-01 is at archived log sequence: 28
Dbvisit last transfer log sequence: 28

Archive log gap: 2
Transfer log gap: 0
=============================================================
dbvisit.exe ended on win2003se-01
=============================================================
Where w102n is the name of the database.

Home > Run > Run Interactive > Primary Server tab > select Database from drop-down menu > select Default from Run Action drop-down menu > Run

The log sequence number from the primary database will always be one or more sequences ahead of the last log sequence that Dbvisit Standby will have transferred. This is because the log sequence shown for the primary database is the latest log sequence that is not archived yet (redo log).
This reporting is non-intrusive. No log switches are performed and no logs are transferred.
When this command is run, the information is also inserted into the Dbvisit Standby database repository (DDR) table called dbv_sequence_log. This table can be used for log gap analysis over time.
Note: The standby database must be available in standby mode or in READ ONLY mode when this command is executed. If the standby database is not available, Dbvisit Standby will automatically start the standby database if AUTO_START_STANDBY_DB=Yes.

Scheduling the Dbvisit Standby log gap report

Note: This is no longer required if using Dbvisit Standby 5.3.12 and above.
This command can be scheduled to run automatically to email the Dbvisit Standby log gap report. The following example shows how to schedule this command in Scheduled Tasks on an hourly basis:

Where w102n is the name of the database

Emailing the Dbvisit Standby log gap report

The Dbvisit Standby log gap report will be emailed by default to the email address specified by the parameter ADMINS in the DDC file.
If the email report layout is not the same as what is printed on screen, please change the Encoding setting in the email client to Western European (Windows).
To disable emailing the Dbvisit Standby log gap report, set EMAIL_LOG_GAP_REPORT = No in the DDC file.

Dbvisit Standby log gap report alerting

Dbvisit Standby will alert if the log gap from the Dbvisit Standby log gap report (dbvisit -i) exceeds the following values (set to 0 to turn off alerting)

  • ARCHIVE_LOG_GAP_THRESHOLD is the difference between the last archived sequence on the primary and the last applied sequence on the standby database. The archive log gap should be near 0 (except when APPLY_DELAY_LAG_MINUTES is used).
  • TRANSFER_LOG_GAP_THRESHOLD is the difference between the last archived sequence on the primary and the last sequence transferred to the standby server. The transfer log gap should be near 0.

The dbvisit -i <database> command must be scheduled for these settings to be effective.
Example:
ARCHIVE_LOG_GAP_THRESHOLD = 4
Once the archive log gap exceeds 4, then an alert email will be sent.
Example:
TRANSFER_LOG_GAP_THRESHOLD = 3
Once the transfer log gap exceeds 3, then an alert email will be sent.