Consultor Eletrônico



Kbase P27398: Virtual System Table (VST) used to calculate database occupation
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/10/2008
Status: Verified

GOAL:

Virtual System Table (VST) used to calculate database occupation

GOAL:

Overall Database storage area high-water mark (hiwater) calculation

GOAL:

How much space is left in each database extent?

GOAL:

Will I run out of space for database expansion?

GOAL:

How to calculate the amount of data within a last fixed extent?

GOAL:

When will I need to add a new extent ?

GOAL:

How to find the true size of the Database ?

GOAL:

How to monitor Database growth ?

GOAL:

How to find the HWM per Storage Area

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

With the introduction of Storage Areas in Progress Version 9, the high-water mark for each area must be monitored 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. In addition to the availability of database extents to accomodate database growth, one should also consider the availability of disk space for database expansion. Please refer to Progress Solution P27397, "How much space do I have left for my database to grow"

/* how much of the storage area is used up by allocated blocks (HWM)? What is the true size of the Database? How fast is my database growing? iow: What is the real occupation? */

define variable v-prcnt_full as decimal format ">>9.99" label "% Full" no-undo.
define variable v-empty_blocks as decimal format ">>,>>>,>>9" label "Empty" no-undo.
define variable v-hiwater as decimal format ">>,>>>,>>9" label "Hiwater" no-undo.
define variable v-mb_used as decimal format ">>>,>>9.99" label "MB Used" no-undo.
define variable v-mb_avail as decimal format ">>>,>>9.99" label "MB Avail" no-undo.
define variable v-mb_tused as decimal format ">>>,>>9.99" label "Total MB used" initial 0.0 no-undo.
define variable v-mb_tavail as decimal format ">>>,>>9.99" label "Total MB avail" initial 0.0 no-undo.
/* output to sa.xml. */
FOR EACH _Area NO-LOCK:
FIND _Areastatus WHERE _Areastatus-Areanum = _Area._Area-number NO-LOCK.
v-hiwater = _AreaStatus-Hiwater.
if v-hiwater = ? then v-hiwater = 0.0.
v-empty_blocks = _AreaStatus-Totblocks - v-hiwater - _AreaStatus-Extents.
v-prcnt_full = (1.0 - (v-empty_blocks / _AreaStatus-Totblocks)) * 100.0.

v-mb_avail = v-empty_blocks / 1048576 * _Area-BlockSize.
v-mb_tavail = v-mb_tavail + v-mb_avail.

v-mb_used = v-hiwater / 1048576 * _Area-BlockSize.
v-mb_tused = v-mb_tused + v-mb_used.
DISPLAY
_Area-name LABEL 'Name' format "x(21)"
_Area-blocksize LABEL 'DBBlockSize'
_AreaStatus-Extents LABEL '#Extents' format ">>9" SKIP
_AreaStatus-Lastextent LABEL "HWM extent" SKIP
v-hiwater
v-empty_blocks
_AreaStatus-Totblocks - _AreaStatus-Extents LABEL 'T.Blocks' FORMAT ">>,>>>,>>9"
v-prcnt_full SKIP
v-mb_used
v-mb_avail.
END.
display v-mb_tused
v-mb_tavail.