Database Growth Report

PJan8724

New Member
Hey Guys,

I've got a 17GB progress database that I'm running or I should say that I've got 17GB worth of space allotted for this database. What I'm trying to find out is how can I go about getting the EXACT SIZE of the database and which extent it is currently using. Please note that I need the exact size of the database.

I have 15 DB extents assigned to my database but I don't truely no the exact size of the database other then relying on the size of the nightly backup. Which isn't the most accurate means of tracking database size and doesn't tell me which extent the database is currently in or by how much that database has grown over the span of time.

I'm trying to create a report that I can hand of to management so that they can see how quickly the database is growing. I've created several reports like this in SQL Server and I'm hoping that I can generate one for Progress that can be schedules automatically. Does anyone know how I can go about getting this information from the database into a usable file format that I can import into SQL Server and generate a report. Thanks in advance for all the help.

Thanks,

Pete J.
 

Dmitri

New Member
You can use _AreaStatus VST

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.


http://www.geocities.com/ResearchTriangle/3737/dlc/dbuse.html
 

PJan8724

New Member
Hey Dmitri,

Thank for the code, however the output does not provide the actual database size in a usable format like MB or GB nor can I find out which extent I am actaully in, only that it is currently 85% full.

Thanks,

Pete J.
 

Dmitri

New Member
This version will give the size in GB.

define variable dbhw as decimal init 0 no-undo.
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 format ">,>>>,>>>" column-label "Tot blocks"
_AreaStatus-Hiwater column-label "H watermark"
_AreaStatus-Hiwater / _AreaStatus-Totblocks * 100 column-label "% use"
_AreaStatus-Extents format ">>>" column-label "Ext"
_AreaStatus-Freenum format ">,>>>,>>>" column-label "Freenum"
_AreaStatus-Rmnum format ">,>>>,>>>" column-label "RM num"
with down width 130 overlay.
if _AreaStatus-Areanum <> 3 then dbhw = dbhw + _AreaStatus-Hiwater.
end.

pause.
find first _DbStatus no-lock.
display "DB Size"
dbhw * _DbStatus._dbstatus-dbblksize / 1024 / 1024 / 1024 "GB".

You can find the current extent by using the % number and _filelist table ( extent size will be _filelist._filelist-size ).
 

erick.rosales

New Member
Hi... Does anybody know how to tracking the transactions on Database... I mean.. I want to know witch tables is writting, is reading is creating etc...

Of course I have a monouser environment.
 
Top