Previous Topic

Next Topic

logstat Command—Display Logging Status

Permission required: Installation owner.

The logstat utility displays logging status. Logstat output has the following sections:

Note: Logstat functions are included in the forms-based Interactive Performance Monitor (ipm) utility. Also, you can use Visual DBA to monitor log information. See Visual DBA online help.

For more information on the information displayed by the logstat command, see the Interactive Performance Monitor User Guide.

The logstat command has the following format:

logstat [-help]

Previous Topic

Next Topic

Logstat Command Output – Logging System Summary

The Logging System Summary on the logstat output provides an overall view of the logging system. The information indicates how well the logging system is tuned.

The summary contains the following informational fields (described in the order in which they appear):

Previous Topic

Next Topic

Logstat Command Output – Current Log File Header

The Current Log File Header gives quantitative information on the logging system, such as the size of the log file, log buffers, and CP interval.

Consistency Points (CP)—In the Current log file header section is a group of numbers preceded by the label CP. These numbers, like the numbers following Begin and End, are in three groups. The middle group refers to the block marking the last consistency point. This consistency point contains a list of all open transactions and open databases at that time.

In the sample output shown here, the block marking the consistency point is 1873. CPs shorten the recovery window after a system goes down. Instead of reading from BOF to EOF, the last CP is read and recovery begins from there.

----Current log file header----------------------------------------------------
Block size: 4096 Block count: 2048 Buffer count: 4
CP interval: 102  Logfull interval: 1945  Abort interval: 1536
Last Transaction Id: 00002D5B2D5BFA03
Begin: <760996814:1702:2304> CP: <760996814:1873:3592> End: <760996815:107:20>
Percentage of log file in use or reserved: 30
Log file blocks reserved by recovery system: 180
Archive Window: <760996814,1991,3508>..<760996815,107,220>
Previous CP: <760996814,1702,2304>
Status:  ONLINE,ARCHIVE,CPFLUSH
Active Log(s):  LOG_FILE

The Current Log File Header section has the following fields:

Previous Topic

Next Topic

Logstat Command Output – List of Active Processes

The List of Active Processes provides information on processes currently active in the logging system. This section has the following fields:

Previous Topic

Next Topic

Logstat Command Output – List of Active Databases

The "List of active databases" provides statistical information on all active databases in the logging system. You can use the information in this section and the List of active transactions section to determine which databases are open and active. Before shutting down an installation, you should ensure that all databases are closed. Knowing which databases are open and active allows you to determine whom to notify of the impending shutdown.

This section has the following fields:

Previous Topic

Next Topic

Logstat Command Output – List of Active Transactions

The List of active transactions provides statistical information on each active transaction. The fields in this section are described below:

Previous Topic

Next Topic

logstat Example: Determine Databases that Are Active

To determine which databases are currently active, follow these steps:

  1. Look at the section "List of active databases" in the logstat output. For each database listed, the database's ID number, name, owner, and status appear on one line.

    Note: The first entry listed is always owned by $ingres.

  2. Note the ID number of each database. These numbers are used in the List of active transactions in the logstat output to identify the database associated with each transaction.
  3. Compare the database ID numbers to the entries following the heading Database in the listings of active transactions. If you find a match, the database associated with that ID is currently active.

For example, in the sample output shown here, the second database shown is testdb owned by test. The ID for this database is 00280005. In the List of active transactions, the transaction listed belongs to Database: 00280005. The status of this database (testdb) is ACTIVE,PROTECT,JOURNAL. If an installation shutdown was pending, you can inform the testdb's owner, test, of the impending shutdown.

----List of active databases-------------------------------------------
Id: FFFF0001 Database: ($recovery,$ingres) Status: NOTDB,ACTIVE
  Tx_cnt: 13 Begin: 16 End: 1 Read: 0 Write: 217 Force: 583 Wait: 1707
  Location: None
  Journal Window: <0,0,0>..<0,0,0>
  Start Backup Location: <0,0,0> (0,0)
Id: 00280005 Database: (testdb,test) Status: JOURNAL,FAST_COMMIT,ACTIVE
  Tx_cnt: 1 Begin: 17 End: 16 Read: 0 Write: 4690 Force: 6 Wait: 681
  Location:  /devsrc/65sun4/install/test/ingres/data/default/testdb

  Journal Window: <760996814,981,2800>..<760996814,1300,3184>
  Start Backup Location: <0,0,0> (0,0)


----List of active transactions------------------------------------
  [... transaction information deleted ...]

Tx_id: 295D001D Tran_id: 00002D5B2D5BF9F7 Database: 00280005
  Process: 00010012 Dis_tran_id: <0,0> Session: 0093C000
  First: <760996814,1160,3100> Last: <760996814,1300,3184>
    Cp: <760996814,881,948>
  Write: 463 Split: 107 Force: 0 Wait: 109 Reserved: 140
  Status: ACTIVE,PROTECT,JOURNAL
  Wait Reason: (not waiting)
  User: <test>

Previous Topic

Next Topic

logstat Example: Determine Proximity to FORCE-ABORT-LIMIT

To determine how close your installation is to the FORCE-ABORT-LIMIT, use the information from the Current log file header section in the logstat output. Four statistics are relevant: the Abort interval, the Block count, the Begin, and the End.

The number appearing after Abort interval is the number of blocks in the log file that must be filled before the FORCE-ABORT-LIMIT is reached. The Block count refers to the total number of blocks in the log file. Begin refers to the block marking the log file's Beginning of File (BOF), and End refers to the block marking the log file's End of File (EOF). The numbers following Begin and End are divided into three groups separated by colons. The middle group is the most relevant. For example, in the sample output, block 778 marks the beginning of the log file.

To calculate how close the installation is to the FORCE-ABORT-LIMIT, follow these steps:

  1. Calculate the number of blocks in use.

    Because the log file is a circular file, the block marking the file's beginning can have a higher number than the block marking the file's end (see the Second Log File Header).

    Consequently, there are two ways to determine the number of blocks in use:

    1. If the End of File is larger than the Beginning of File, subtract the BOF from the EOF to obtain the number of blocks in use. For example, in the sample output, the BOF is 778 and the EOF is 1299. The number of blocks in use in this example is:

      1299 - 778 = 521

    2. If the End of File is smaller than the Beginning of File, subtract the BOF from the block count figure and add the result to the EOF to obtain the number of blocks in use. For example, in the second Log File Header, the Beginning of File is 1702, the Block Count is 2048, and the End of File is 107. The number of blocks in use is:

      (2048 - 1702) + 107 = 453

  2. Subtract the number of blocks in use from the Abort interval figure to determine how many blocks are available before the FORCE-ABORT-LIMIT is reached.

    For example, in the sample output shown here, 521 blocks are in use and the Abort interval is 1536, so the number of blocks still available is:

    1536 - 521 = 1015

    ----Current log file header-----------------------------------

    Block size: 4096 Block count: 2048 Buffer count: 4
    CP interval: 102  Logfull interval: 1945  Abort interval: 1536
    Last Transaction Id: 00002D5B2D5BFA03
    Begin: <760996814:1702:2304> CP: <760996814:1873:3592>
    End: <760996815:107:20>
    Percentage of log file in use or reserved: 30
    Log file blocks reserved by recovery system: 180
    Archive Window: <760996814,1991,3508>..<760996815,107,220>
    Previous CP: <760996814,1702,2304>
    Status:  ONLINE,ARCHIVE,CPFLUSH
    Active Log(s):  LOG_FILE


© 2007 Ingres Corporation. All rights reserved.