The on premises SQL Server 2017 database, for Azure DevOps Server is approaching 280GB in size. One of our builds was adding 210MB artifact to Azure DevOps Server (on premises) instance. The build job had about 100 builds and I deleted 99 of them. They still appear in the 'deleted' tab of the builds. And the database shows no change in size. Even shrink shows only about 290MB free space.
How do I remove these artifacts from the SQL Server instance? What part of policy needs changing or can I just force this? I have admin rights on the system.
P.S. Apologies for duplicating this question here. Didn't find Azure DevOps Server tag there. Happy to delete/cross-reference one of these questions as soon as one gets answered. Thank you.
Found this blog post and followed the 'Be sure to run the cleanup jobs' section.
The collection database has these stored procedures and having executed those, the database size dropped dramatically.
EXEC prc_CleanupDeletedFileContent 1
# You may have to run the following command multiple times, the last
# parameter is the batch size, if there are more items to prune than the
# passed in number, you will have to run it multiple times
EXEC prc_DeleteUnusedFiles 1, 0, 100000
I do not know if that is the recommended way of doing it. Unless somebody else posts a better answer, I will accept this as the solution.