2

I'm trying to delete the actual binaries from the file system while using SQL Server FILESTREAM.

When doing so (and after removing all records that refers the BINARIES table) and running EXEC sp_filestream_force_garbage_collection the num_unprocessed_items is increasing and the actual binary still exists in the FS.

For the sake of this post BINARIES is the table holding the blobs.

I'm calling

DELETE FROM BINARIES 

and then I'm twice calling

EXEC sp_filestream_force_garbage_collection

What can be the reason and if possible, I'll be glad to get a step by step explanation (I'm not a DBA).

Thanks, R.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Burgaz
  • 237
  • 7
  • 14
  • 1
    May be this can help http://stackoverflow.com/questions/26802310/how-to-complete-remove-filestream-and-all-attached-files – Guanxi Mar 23 '15 at 13:04
  • 1
    if you read https://technet.microsoft.com/en-us/library/gg492195(v=sql.110).aspx "Items may be unprocessed for various reasons, including the following: Files that need to be pinned down because Log backup or CheckPoint has not been taken." Have you done an initial backup of this database? – Jack Fox Apr 24 '15 at 21:24

1 Answers1

2

I verified my comment is correct. You have to perform a backup on your database before you can successfully garbage collect on it. See https://technet.microsoft.com/en-us/library/gg492195(v=sql.110).aspx

"Items may be unprocessed for various reasons, including the following: Files that need to be pinned down because Log backup or CheckPoint has not been taken."

Jack Fox
  • 953
  • 6
  • 20