Daily Increase in Space for Database ?

Database
Enthusiast

Daily Increase in Space for Database ?

Hi all,

As per the some of the requirements , we have to calculate the Daily increase in Volume (bytes) for a database (it includes some 100 + tables) for the past 30 days.

One way of doing it is calculating the daily growth per table i.e through some date/timestamp column and grouping it  and then summing for all the 100 tables .. I would be a very timeconsuming step.

I was just thinking that is there any quick way through dbc tables /views  or DBQL to get the Daily increase in volume of the past 30 days.

cheers!

Nishant

Tags (2)
2 REPLIES
Enthusiast

Re: Daily Increase in Space for Database ?

Hi Nishant,

Maybe you need to tweak a little. The link  below can be a good pointer.

http://forums.teradata.com/forum/database/how-to-know-the-table-size-growthreduce-in-teradata

Put in a unix script may be.

Teradata Employee

Re: Daily Increase in Space for Database ?

You can schedule the following SQL as an INSERT to a table:

SELECT 

databasename

,CAST(SUM(maxperm)/1024/1024/1024 AS DECIMAL(7,2)) max_perm

,CAST(SUM(currentperm)/1024/1024/1024 AS DECIMAL(7,2)) current_perm

,CAST(SUM(maxspool)/1024/1024/1024 AS DECIMAL(7,2)) max_spool

,CAST(SUM(currentspool)/1024/1024/1024 AS DECIMAL(7,2)) current_spool

,max_perm - current_perm AS free_perm

FROM dbc.diskspace WHERE databasename IN

(SELECT databasename FROM dbc.databases WHERE dbkind = 'D' )

GROUP BY databasename ORDER BY max_perm DESC;

And using that table you can find the daily changes over any span of days you choose.

HTH!