/* How much db is in use ( Progress ver 9 and up )
  Dmitri Levin
*/

for each _AreaStatus where 
   ( not _AreaStatus-Areaname matches "*After Image Area*" )
   no-lock:

  display 
     _AreaStatus-Areanum  format ">>>" column-label "Num"
     _AreaStatus-Areaname format "x(20)" column-label "Area Name"
     _AreaStatus-Totblocks column-label "Tot blocks"
     _AreaStatus-Hiwater column-label "High water mark"
     _AreaStatus-Hiwater / _AreaStatus-Totblocks * 100 column-label "% use"
     _AreaStatus-Extents  format ">>>" column-label "Num Extents"
     _AreaStatus-Freenum column-label "Free num"
     _AreaStatus-Rmnum   column-label "RM num"
     .
end.

/* How much db and bi is in use ( Progress ver 8.2 and 8.3 ) 
  VST has to be enabled.
*/

define variable lv-size           as decimal no-undo.
define variable lv-bi-size        as decimal no-undo.
define variable lv-extent-count   as integer no-undo.
define variable lv-current-extent as integer no-undo.

find first _DbStatus no-lock.

for each _filelist                                      
    where _filelist-name matches "*d." 
    or    _filelist-name matches "*d.."
    or    _filelist-name matches "*d..."
    no-lock
    by entry(2,_filelist-name,"."): /* assume directory names do not have dots */

    assign
      lv-size = lv-size + _filelist._filelist-size
      lv-extent-count = lv-extent-count + 1.

   if lv-size > _DbStatus._dbstatus-hiwater and lv-current-extent = 0 then
      lv-current-extent = lv-extent-count.
end.
for each _filelist                                      
    where _filelist-name matches "*b." 
    or    _filelist-name matches "*b.."
    no-lock:

    lv-bi-Size = lv-bi-Size + (decimal(_filelist-size) * decimal(_filelist-blksize)).
end.

display 
    ( lv-size * _DbStatus._dbstatus-dbblksize ) / 1024 
      format ">>>,>>>,>>9K" label "Physical DB size" at 1 
    ( decimal( _DbStatus._dbstatus-hiwater ) * decimal( _DbStatus._dbstatus-dbblksize )) / 1024      
      format ">>>,>>>,>>9K" label "High Water Mark " at 1
    (_dbstatus-hiwater / lv-size) * 100
        format ">>9%" label "Percent DB in use"            at 1 
     "Current extent is:" + string(lv-current-extent,">>9") + " of" + 
    string(lv-extent-count,">>9") format "x(50)"             at 1
     lv-bi-size format ">,>>>,>>>,>>>" label "Physical BI size" at 1 
    _DbStatus._dbstatus-bisize 
      format ">>,>>>,>>9" label "Logical BI size "           at 1
    _DbStatus._dbstatus-dbblksize label "DB Block Size   "   at 1
    with side-labels.   
    

Return to myProgress Home Page
    

    

    

    

    

    

    

Hosted by www.Geocities.ws

1