Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Determine database growth

Author  Topic 

frank.svs
Constraint Violating Yak Guru

368 Posts

Posted - 2010-07-14 : 02:18:11

Hi,

For determining the growth of a database, which method is the good one.
1. select 'dbname' as "dbname",SUM(size*8)/1024 "Sizein MB",getdate() as "Date" from dbnamedbo.sysfiles
2. We have daily full backup scheduled, so i would go for

SELECT a.database_name,
a.type,
CASE a.type WHEN 'D' THEN 'FULL BACKUP'
WHEN 'I' THEN 'Differential Backup'
WHEN 'L' THEN 'Transaction Log bkp'
WHEN 'F' THEN 'File or Filegroup bkp'
WHEN 'G' then 'Differential File bkp'
WHEN 'P' THEN 'Partial bkp'
WHEN 'Q' THEN 'Differential partial' END as backupType,
a.backup_size/1024/1024 AS backupSizeMB,
a.backup_finish_date as last_backup
FROM msdb.dbo.backupset a
inner join msdb.dbo.backupmediafamily m
ON a.media_set_id = m.media_set_id
WHERE a.database_name = 'dbname'
and a.type = 'D'
order by a.backup_finish_date

I personally beleive going for secondnd method is reasonable. I can clearly observe the change in MB of actual data.
I have seen, few are using way1 as well in there environments

But, i wana know which is good??

Thanks in Advance

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-07-14 : 02:20:14
http://weblogs.sqlteam.com/tarad/archive/2010/07/09/Database-Growth-Tracker-Tool-ndash-New-Version.aspx



It was even featured in a SQL Server Magazine article: http://weblogs.sqlteam.com/tarad/archive/2009/10/08/SQL-Server-Magazine-web-article-about-a-tool-I-wrote.aspx



Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -