In this article, we will discuss the actual database file size and free space in the database file size with the help of monitoring script and shrink solutions. While creating a database initial size of the database files (Data File and Log File) can be defined by us, with the Autogrowth and MAXSIZE parameter. The initial size will be the same as the model database if by chance user forgot to define the initial size parameter while creating a database or do the same intentionally.
在本文中,我们将借助监视脚本和收缩解决方案来讨论实际的数据库文件大小和数据库文件大小中的可用空间。 创建数据库时,我们可以使用Autogrowth和MAXSIZE参数来定义数据库文件(数据文件和日志文件)的初始大小。 如果用户偶然在创建数据库时忘记定义初始大小参数或有意这样做,则初始大小将与模型数据库相同。
At the beginning, size of the database can be set up using the SIZE parameter and how much maximum space can be occupied by a database can be defined using the MAXSIZE parameter. How fast a database file can reach its maximum space can be resolved using the FILEGROWTH parameter. We are facilitated in a way we define the FILEGROWTH parameter. It leaves us with two options either by specific absolute value or by percentage, while in both cases we must define the value in MB format. There will be no boundary on the growth of a database file if we do not take care of defining the MAXSIZE parameter, as the default value is UNLIMITED.
最初,可以使用SIZE参数设置数据库的大小,并可以使用MAXSIZE参数定义数据库可以占用的最大空间。 可以使用FILEGROWTH参数解决数据库文件达到其最大空间的速度。 定义FILEGROWTH参数的方式为我们提供了便利。 它为我们提供了两个选项,分别是特定的绝对值或百分比,而在两种情况下,我们都必须以MB格式定义值。 如果我们不用定义MAXSIZE参数,则数据库文件的增长将没有边界,因为默认值是UNLIMITED。
SQL Server can not commit any transaction to disk storage in the situation where disk is full so it’s always good to define the MAXSIZE parameter beforehand to avoid such situation. UNLIMITED would fill up the disk storage but before that, it makes several spaces tinier than before. Even this has a very hazardous impact on the operating system as well if it doesn’t have enough space to execute its system programs. We also need to take into