Get All Database Sizes in SQL Server
Measuring databases is important for knowing how much disk space a SQL Server requires today, as well as the future growth of the database files.
Measuring databases is important for knowing how much disk space a SQL Server requires today, as well as the future growth of the database files.
Tracking database file sizes and free space within data and log files is an important part of monitoring SQL Server. This information, along with other metrics such as growth events, can help you to better predict and plan for future disk space provisioning needs.
The Disk Usage by Top Tables Report in SQL Server is a quick way to get the sizes of all tables within a database.
When a database file gets full and it needs more space, a growth event will happen. The size of said database growth can be set within the database options, or can be done using the ALTER DATABASE statement as shown below.
Setting maximum database file sizes in SQL Server is something you’d ideally not have to set, but it’s a good last resort option available if you need it.
It’s a solid best practise to have TempDB files stored in separate drive, away from your C: drive. This is because TempDB can grow very large, very quickly (within minutes);
There are many ways to check the size of a table in SQL Server. The way you will do it will likely depend on what your task at hand is.
This post contains a script to get database and log file growth events on a SQL Server instance. I often find a need to use this script to check what databases have been growing on unmonitored SQL Servers.
This blog post is to share a script that you can run in SQL Server (versions 2008 R2 and above) which shows the available disk space for all local volumes on a SQL Server host.