Kbase 22001: Sample Code to Determine the Database High-Water Mark
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  01/05/2002 |
|
SUMMARY:
The purpose of this Knowledge Base Solution is to provide sample code
that queries the Virtual System Tables (VST) for database block size, Total number of Database blocks, as well as Total number of Empty and Free blocks in the database.
SOLUTION:
The formulas and code below are for the overall view of the database. Similar information is listed at the tail end of a PROSTRCT statistics command issued against a database when it is offline. This same code is simply facilitating capturing overall totals while the database is in multi-user mode.
NOTE: With the introduction of areas in Progress Version 9, you must monitor the high-water mark for each individual area to ensure that sufficient space is available to extend the database on a per area basis. Disregard for the high-water mark on a per area basis could result in abnormal shutdown of the database due to inability to extend within an area. The formula to determine the overall Database high-water mark would be:
Overall High-water Mark = Total Database blocks - Total Empty blocks
-- Sample Code for Overall Database Totals:
FOR EACH _DBSTATUS WITH SIDE-LABELS:
DISPLAY _DBSTATUS._DBSTATUS-DBBLKSIZE SKIP
_DBSTATUS._DBSTATUS-EMPTYBLKS SKIP
_DBSTATUS._DBSTATUS-FREEBLKS SKIP
_DBSTATUS._DBSTATUS-TOTALBLKS SKIP.
END.
-- Sample Code to report Area Specific Totals:
FOR EACH _Areastatus WITH SIDE-LABELS:
DISPLAY _AREASTATUS._AREASTATUS-AREANUM SKIP
_AREASTATUS._AREASTATUS-AREANAME SKIP
_AREASTATUS._AREASTATUS-TOTBLOCKS SKIP
_AREASTATUS._AREASTATUS-HIWATER SKIP
_AREASTATUS._AREASTATUS-EXTENTS SKIP
_AREASTATUS._AREASTATUS-LASTEXTENT SKIP
_AREASTATUS._AREASTATUS-FREENUM SKIP
_AREASTATUS._AREASTATUS-RMNUM SKIP(2).
END.