Kbase 19837: 4GL Program to Monitor BI and DB Growth
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  07/05/2009 |
|
Status: Verified
GOAL:
The following program monitors growth of the Progress BI file, database and transactions that have been open for one-half hour or more.
GOAL:
Using Progress Virtual System Tables
FACT(s) (Environment):
Progress 8.x
Progress 9.x
OpenEdge 10
All Supported Operating Systems
FIX:
Note that, if you are using this program in Progress 8.x you must use the following Command to enable the VST's:
proutil <db> -C enablevst
VST's are already enabled on version 9 by default, so it is not necessary to do proutil enablevst
/* Program to monitor BI and database growth, and
to look for transactions older than 1/2 hours.
This program is provided as-is, with no implied warrantee.
It will not be supported by Progress Software Corporation,
and the user assumes all risks of its use. */
def var sample_time as int init 300.
def var tbisize as int init 0.
def var tdbsize as int init 0.
def var tbiinc as char init "".
def var tdbinc as char init "".
def var areainc as char init "".
def var areahwinc as char init "".
define temp-table areasize
field areanum as integer
field hiwater as integer init 0
field total as integer init 0.
def var numa as int init 0.
for each _areastatus:
numa = numa + 1.
create areasize.
areanum = _areastatus-areanum.
end.
define frame area with numa down.
update "Enter Sample Time: " sample_time with frame a.
repeat:
find first _dbstatus.
display string(today).
display string(time, "HH:MM:SS").
/* the BI file grew */
if tbisize <> _dbstatus-bisize then
tbiinc = string(_dbstatus-bisize - tbisize).
else tbiinc = "".
tbisize = _dbstatus-bisize.
display
tbisize label "Bi #blocks"
tbiinc label "(increase)"
_dbstatus-bisize label "Used #blocks"
( tbisize * INTEGER( _dbstatus-biblksize / 1024) )
format ">>>,>>>,>>>,>>9" label "Total size (Kb)"
with frame bi.
/* the database grew */
if tdbsize <> _dbstatus-totalblks then
tdbinc = string(_dbstatus-totalblks - tdbsize).
else tdbinc = "".
tdbsize = _dbstatus-totalblks.
display
tdbsize label "Db #blocks"
tdbinc label "(increase)"
( tdbsize * INTEGER( _dbstatus-dbblksize / 1024) )
format ">>>,>>>,>>>,>>9" label "Total size (Kb)"
_dbstatus-freeblks label "Free #blocks"
_dbstatus-emptyblks label "Empty #blocks"
with frame db.
/* the areas grew */
for each _areastatus:
find areasize where areanum = _areastatus-areanum.
if hiwater <> _areastatus-hiwater then
areahwinc = string(_areastatus-hiwater - hiwater).
else areahwinc = "".
hiwater = _areastatus-hiwater.
if total <> _areastatus-totblocks then
areainc = string(_areastatus-totblocks - total).
else areainc = "".
total = _areastatus-totblocks.
d.isplay
_areastatus-areanum format ">>9" label "Area"
_areastatus-areaname label "Name"
total label "#blocks"
areainc label "(increase)"
hiwater label "last used block"
areahwinc label "(increase)"
( total * INTEGER( _dbstatus-dbblksize / 1024) )
format ">>>,>>>,>>>,>>9" label "Total size (Kb)"
with frame area down.
end.
/* find all open transactions that have been open for 1/2 hour */
for each _trans where _trans-duration > 1800:
find first _connect where _connect-usr = _trans-usrnum.
display _connect-name _connect-usr _trans-duration
_trans-txtime with frame e.
end.
pause sample_time.
end.
.