0

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.

dushyantp
  • 4,398
  • 7
  • 37
  • 59
  • You can try to delete builds from the local folder to see if the space is released. – Hugh Lin Jul 05 '19 at 10:42
  • @HughLin-MSFT Hi, what do you mean by local folder? I thought all data from server instance are stored in the SQL Server Database. Maybe I am missing something! – dushyantp Jul 05 '19 at 10:45
  • do you run a self-hosted agent for build processes? A self-hosted agent have also a high space consumption. – Mar Tin Jul 05 '19 at 11:04
  • 'deleting' happens in two phases. 'delete' and 'destroy'. Once a build is 'deleted' the build will be listed for about 30days (this may vary, i am not sure about this time) but is not yet deleted. After theese days have passed the build will be 'destroyed' which will REALLY delete the build. i don't know if you can change the time between 'delete' and 'destroy' tho :/ – D.J. Jul 05 '19 at 12:54

1 Answers1

0

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.

dushyantp
  • 4,398
  • 7
  • 37
  • 59