Kbase P23419: How to use Virtual System Table (VST) calculate database occupation
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  13/03/2008 |
|
Status: Verified
GOAL:
How to use Virtual System Table (VST) calculate database occupation
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
Windows
Unix
FIX:
The formula to determine the overall Database high-water mark would be:
Overall High-water Mark = SUM(highwater marks for each storage area excluding 1 and 3)
FOR EACH _Areastatus
WHERE _AREASTATUS-AREANUM >= 6 NO-LOCK:
DISPLAY _AREASTATUS._AREASTATUS-AREANAME
_AREASTATUS._AREASTATUS-HIWATER SKIP (SUM)
END.
To calculate how much physical space is remaining:
the difference between Total Database blocks and the Overall High-water Mark, is then Total Empty Blocks.
Total Empty Blocks * Database Block Size (bytes) = physical memory remaining (bytes)
Comparing this to the O/S size of your database (by conversion of each to the same byte, order of magnitude) and the remaining space left on your system aides forecast planning exercises and prevents databases terminating abnormally.
/* how much the allocated blocks are used up what is the true size of the Database and monitor growth? iow: What is the real occupation? */
define variable prcnt_full as decimal.
define variable mty_blocks as integer.
FOR EACH _Area NO-LOCK:
DISPLAY _Area-name LABEL 'Area Name' WITH 2 COLUMNS.
FIND _Areastatus
WHERE _Areastatus-Areanum = _Area._Area-number
NO-LOCK.
mty_blocks = _AreaStatus-Totblocks - _AreaStatus-Hiwater - _AreaStatus-Extents.
prcnt_full = (1 - (mty_blocks / _AreaStatus-Totblocks)) * 100.
DISPLAY _AreaStatus-Hiwater LABEL 'Active Blocks'
mty_blocks LABEL 'Empty Blocks'
_AreaStatus-Extents LABEL 'Extent Blocks'
_AreaStatus-Totblocks LABEL 'Total Blocks' FORMAT
'>,>>>,>>9'.
FOR EACH _AreaExtent OF _Area NO-LOCK:
DISPLAY _Extent-path FORMAT 'x(60)'
_Area-blocksize LABEL 'BlockSize'
_AreaStatus-Hiwater * _Area-blocksize LABEL 'Used space'
mty_blocks * _Area-blocksize LABEL 'Avail space'
prcnt_full LABEL '%Full' WITH 2 COLUMNS.
END.
END.