We have a production SQL Server 2014 running on FILESTREAM with Always On Availability Group.
It has been about 4 years since the servers go live. Recently, we encounter a hard disk space issue on the database server. The database is just taking up too much space. The .mdf and .ldf are taking about 30GB (which is fine for us), and the FileTables should have just taken about 100GB. However, the Database Properties window is showing the database size is about 550GB.
A detailed search on the web has gotten me to this article: FILESTREAM garbage collection with AlwaysOn Availability Groups. I further check the database servers and I think that the extra 400GB of space is taken by the FILESTREAM files that were supposed to be garbage collected.
From the article, if I understand correctly, garbage collection will never kick in when the database is in an Availability Group.
Can anyone please share with me if that is really the case?
If that is indeed the case, how can I force the garbage collection to delete all the outdated FILESTREAM files, and free up the 400GB space, other than to remove the Availability Group?
Updated with more info (2022-10-17)
The result from DBCC LOGINFO
The database has 105 records from this command. All of them have a Status of 2, which means they are "Active".
The result from SELECT log_reuse_wait_desc, name FROM sys.databases WHERE name = DB_NAME()
The result from EXEC sp_spaceused
We are using SQL Server 2014, so the @oneresultset
and @include_total_xtp_storage
parameters are not supported.
DBCC LOGINFO
andSELECT log_reuse_wait_desc, name FROM sys.databases WHERE name = DB_NAME()
Also can you please runEXEC sp_spaceused @oneresultset = 1, @include_total_xtp_storage = 1
and add the results of all of these to your post?