When the size of single database file is greater than 2TB, SSMS will pop up error in shinking file. And database property, you cannot change the database file size in SSMS. I think it is because of the data type for the size in SSMS is integer. It is out of integer range.
We can check the free space and change database file size using script:
select name , filename , convert(decimal(15,1),size * 8192.0 / 1048576) as FileSizeMB , convert(decimal(15,1),fileproperty(name,'SpaceUsed') * 8192.0 / 1048576) as SpaceUsedMB , convert(decimal(15,1),(size-fileproperty(name,'SpaceUsed')) * 8192.0 / 1048576) as FreeSpaceMB from dbo.sysfiles
--change database size
ALTER DATABASE test MODIFY FILE ( NAME = N'test', SIZE = 2311100MB )
No comments:
Post a Comment