Home » SQL » Learn About Database Autogrowth in SQL Server

Learn About Database Autogrowth in SQL Server

👤 Andrew Jackson | Modified: May 8th, 2023|SQL | 4 Minutes Reading

Overview

SQL Server provides various maintenance tasks for the proper management of data system such as creating tables, defining databases, performing the integrity of data checks, shrinking databases, etc. For creating these routine databases, administration tasks offers by using the point whereas click gives the accidental DBA an easy way to build the maintenance of routines. Most of these automatic maintenance events that the server handles are controlled by configurable settings, which have predetermined the values that are not suitable in all installations. Out of which one such setting is Transaction log auto-growth, which are established when first database is created. In the following section, we will discuss about database autogrowth in SQL Server database and way to utilise it in proper manner.

Know What SQL Server Database Autogrowth is

SQL Database Auto-growth is a procedure due to which SQL Server engine expands its database size when all its space runs out. The amount due to which the size of database file grows is based on the settings, which is for the growth of file option for database. Every database files is related to the database that has an auto-growth setting. There are three different setting that can be utilized for identifying the way for growing the database file. It can grow via a specific size, current size percentage or not grow at all. Moreover, it can be set to unrestrict the growth, which will keep on increasing, as more is required. Every auto-grow setting has default otherwise; it can be set by every database file. If the auto-growth setting for a database is not managed properly then, database may experience various or few auto-grow events. Every time when an auto-growth event is occurred, SQL Server holds up the database processing. It means that the auto-growth event is completed, which means that database will be held up. It connects to slower the time of response for SQL commands, which are being processed against the growing database.

Why to Use Database Autogrowth In SQL Server ?

When an event of SQL Database Autogrowth is occurred, Server requires in finding the additional disk storage for the database that can grow. Moreover, the disk space will not be physically next to the database, which is existing. It is stored somewhere else on the disk. It causes the database file to be physically fragmented on the disk. More the auto-growth events then, more will be physically fragment on the disk. The default settings of auto-growth settings for a database are rarely ideal settings for how the database will grow.

Process for creating Auto-growth Settings in New-Database

Users can set the setting of auto-growth by utilizing SQL Server Management Studio while creating the new database. Even these methods can be used in changing the settings of the existing databases.

While defining the new database, the initial settings for auto-growth are set to default values. These values are recognized by utilizing auto-growth settings on the database files model. The default values can be viewed on the screen of New Database as shown in the image below.

Auto growth

Now, by clicking on the ellipses button, user can define the auto-growth that makes sense for the database that I am creating. After clicking on the mentioned button, Windows dialog box will appear.

Autogrowth Setting

Now the user can change the auto-growth setting to any of the three possible mentioned values. The first option is the checkbox that enables the auto-growth. If this is unchecked then, there will not be an auto-grow in the newly created database.

Another option is to set File Growth that permits users to set how the data file will grow if it is run out of space. User can set the percentage or Megabytes accordingly for the growth of file. If the large database was based on the percentage then, it will take more space that is required to handle the growth. This causes these large database files to be over allocated from the disk space.

The last option is to maximum file size option. This permits users to set the maximum size, which is will allow server to grow the file. Most of the users normally utilize the unrestricted option of growth due to which most of their applications are well-behaved and are unlikely to grow irrepressibly. In addition, using the options of unrestricted reduces application failures due to auto-growth restrictions. If it is important to make sure, no other database utilizes up all the disk space then, setting a maximum file size will avoid this.

Conclusion

Auto-growth helps to expand the size of the database that is important for proper management of data. In the above discussion, proper way is discussed to perform database autogrowth in SQL Server./p>