Did you track the growth of your database-backup?
Frequently you'll want to know how fast your database-backup has been growing. Perhaps you have implement a SAN Backup-Device for Backup-to-disk, or you only want know how fast your database has been growing.
This TSQL statement will query the [msdb]..[backupset], to roughly outline the growth of your database-backup, for each user-database of the local server.
DECLARE @command VARCHAR(1000)
CREATE TABLE #db_backup_grow (DBName sysname, BackupDate sysname, SizeInGB sysname)
SELECT @command =
'USE [?] SELECT ''?'' AS DBName
,BackupDate = CONVERT(VARCHAR(10),[backup_start_date], 111)
,SizeInGB = ([backup_size]/1073741824)
FROM [msdb]..[backupset]
WHERE [database_name] = ''?''
AND [type]=''D''
ORDER BY [backup_start_date] DESC'
INSERT INTO #db_backup_grow
EXEC sp_MSforeachdb @command
SELECT *
FROM #db_backup_grow
WHERE DBName not in ('master', 'model', 'msdb', 'tempdb')
ORDER BY DBName, BackupDate, SizeInGB
DROP TABLE #db_backup_grow
CU tosc
Print article | This entry was posted by tosc on 2008-05-07 at 17:01:54 . Follow any responses to this post through RSS 2.0. |
Tag cloud
administration backup «best practices» books bug ctp «cumulative update» datetime demo dmv ebook humor index indexoptimize integrity kbfix links maintenance «ms sql server 2008» pass performance php reviews «ross mistry» rtm serverproperty «service pack» «service pack 2» «service pack 3» «service packs» sharepoint sp_msforeachdb «sql server» «sql server 2005» «sql server 2008 r2» «sql server 2012» «sql server 2014» «sql server builds» sqlcat sqlpass «sqlpass franken» ssms ssmstoolspack «stacia misner» t-sql «technical note» tempdb tools version whitepapers