vote up 1 vote down
star

I am trying to write a query that displays a summary of the total disk space used for all databases for each month.

The return results should look something like this for 2008:

 Month   Sum(CurntPerm)    Sum(PeakPerm)
 01      2.3  tb           2.4  tb
 02      2.35 tb           2.35 tb
 03      2.38 tb           2.5  tb
 etc.................

Is there a table that can be queried for historical disk space information?

Thanks, Jennifer

flag

2 Answers

vote up 1 vote down
check

Teradata's data dictionary tables do not track historical changes in database or tablesizes. This is not a difficult process to setup, but one that is necessary for capacity planning and audit purposes.

You will need to write a process that captures the disk space for the tables and/or databases on a scheduled, reoccurring basis that meets your organizations requirements. For example, I capture table sizes on a weekly basis with the databasename. Then I can aggregate up to database level as the situation requires.

This is something that can be done in a BTEQ script that is scheduled via cron or your enterprise scheduler as part of your routine DBA maintenance procedures.

link|flag
Great! Thank you so much. – jf18338 Nov 24 at 15:48
vote up 0 vote down

i'm not sure if you can fetch the historical permspaces from Teradata. To find out current spaces:

SELECT DatabaseName as "DB Name", SUM(CurrentPermSpace) as "Current Perm", SUM(PeakPermSpace) as "Peak Perm" FROM DBC.DatabaseSpace ds, DBC.DBase db WHERE ds.DatabaseId=db.DatabaseId AND db.RowType='D' GROUP BY DatabaseName ORDER BY DatabaseName;
link|flag
This is very helpful. Thank you! – jf18338 Nov 24 at 15:49

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.