NaviWorldSG
asked on
Any free or simple solution to track the growth of an SQL database
Hi
I have a customer who is concern that his cloud server storage space due to the growth rate of the SQL server.
I have suggested that he periodically checks the database size but he is not keen on the idea.
Is there a SQL script that I can use to write to periodically so the user can analyze the growth rate of the database? Alternatively, are there any free tools that can assist the tracking of the database growth size?
Thank yuo,
I have a customer who is concern that his cloud server storage space due to the growth rate of the SQL server.
I have suggested that he periodically checks the database size but he is not keen on the idea.
Is there a SQL script that I can use to write to periodically so the user can analyze the growth rate of the database? Alternatively, are there any free tools that can assist the tracking of the database growth size?
Thank yuo,
Hi
If you have some history then you can query the msdb.dbo.backupset and the below code in the side will get you do it
http://theadeptdba.blogspot.ie/2013/01/how-fast-is-my-sql-server-database.html
Or you can use trace to get information about recent growth events .
http://dba.stackexchange.com/questions/7788/how-to-check-the-growth-of-database
If you have some history then you can query the msdb.dbo.backupset and the below code in the side will get you do it
http://theadeptdba.blogspot.ie/2013/01/how-fast-is-my-sql-server-database.html
Or you can use trace to get information about recent growth events .
http://dba.stackexchange.com/questions/7788/how-to-check-the-growth-of-database
You can check the backupset table in msdb
This script from SQLskill.com
Or you can use the script with step by step configuration from this link which i use.
https://sqljourney.wordpress.com/2013/02/13/sql-server-track-database-size-growth-trend/
This script from SQLskill.com
SELECT
CAST([database_name] as Varchar(20)) AS 'Database',
convert(varchar(7),[backup_start_date],120) AS 'Month',
STR(AVG([backup_size]/1024/1024/1024),5,2) AS 'Backup Size GB',
STR(AVG([compressed_backup_size]/1024/1024/1024),5,2) AS 'Compressed Backup Size GB',
STR(AVG([backup_size]/[compressed_backup_size]),5,2) AS 'Compression Ratio'
FROM msdb.dbo.backupset
WHERE [database_name] in (select name from sys.databases)
AND [type] = 'D'
and backup_finish_date > (getdate()-30)
GROUP BY [database_name],convert(varchar(7),[backup_start_date],120)
order BY [database_name],convert(varchar(7),[backup_start_date],120);
Or you can use the script with step by step configuration from this link which i use.
https://sqljourney.wordpress.com/2013/02/13/sql-server-track-database-size-growth-trend/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Create this stored procedure and
EXEC sp_track_db_growth
GO
to check growth or current db
EXEC sp_track_db_growth 'dbname'
GO
for required db.
You can store the result in table and use that table as tracking one