Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

Track database growth

By Irwan Tjanterik,

Hi,

I think it is time for me to start contributing script which I have written and hopefully you may find this script useful to keep track your database growth and to be aware of when you are going to run out of space.

Basically the script is used for the following:

- Keeping Track of your Database file sizes (MDF,NDF or LDF) .

- Calculate the size of the file when it grows, depending on the setting (% or MB growth), so you will know if you are running out of drive space, so preventable steps can be taken beforehand.

- Can be used for capacity planning based on the used size not the file size, e.g. your database may have 100GB mdf size, but only 40% is currently used.

- Gives you information of current empty percentage,as I always try to ensure we have 20% of free space and increase it during off-peak hours when it is needed.

The script is tested on SQL 2000, 2005 & 2008 & it will provide the following column:

- DBName : Database Name

- FileLogicalName : File Logical Name

- Filename : Database Filename

- FileMBSize : Current File Size in MB

- FileGrowth : Types of the growth, e.g. increase by 5% or 50MB

- FileMBGrowth : Size of the file when after it grows based on the Filegrowth type

- DriveName : DriveName Location

- DriveMBEmpty : Freespace size of your current drive in MB

- FileMBused : Current size of the file being used, you may have 100GB where you only used 80GB

- FileMBEmpty : Unused space size of the file

- FilePercentEmpty : Unused space size of the file in percentage

Total article views: 7868 | Views in the last 30 days: 60
 
Related Articles
FORUM

Database Growth

Database Growth Settings

FORUM

Database growth

Database growth

FORUM

Database file growth settings

Database file growth settings

SCRIPT

Script to change auto growth settings for all databases in SQL Server

Script to change auto growth settings for all databases in SQL Server.

SCRIPT

Database Growth History

This script uses the backup tables to get info on the growth of your database files.

Tags
databases    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones