Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm using SQL Server 2012 Express Edition and I have a problem with huge amount of files generated in:

C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\MyDatabaseStream_Filegroup_Data\$FSLOG\

It is generating roughly 150 files per minute and taking so much disc space on C Drive. Size of MyDatabaseStream is growing rapidly quick and making C Drive full (around 140GB)

How can I stop generating those files?

enter image description here

share|improve this question

2 Answers 2

Make a backup. Those are not log files - where did you get this idea from?

Yu basically store some data in the file system - MyDatabaseStream_Filegroup_Data\$FSLOG\

Database FIleStream feature. VERY nice if you (a) know what you do there and (b) need it.

Either you back up - thzen surplus can be deleted - or you move it to another disc or.... you disable file stream storage.

share|improve this answer

You would stop generating them by disabling FileStream feature.

I have not heavily used FileStream that much so I had to go look up how it all worked. I came across a nice blog post on the CSS SQL Server Engineers blog. This may shed some light on why those files are generated:

The gist of what I understand from the above...

The files in this directory are log files for the database. However they may not the be the same type of log files you are thinking. These are actually tied to the LSN number of the associated transaction that modifies the image. You will basically get a file generated for before it was modified, and then one for after it was modified.

The garbage collection process will keep up with which of those files can be cleaned up and are no longer needed. This is a feature built into FileStream and is handled internally by SQL Server. One of the methods that can cause this process to kick off is taking a FULL or LOG backup of the database. The article above shows taking a backup and issuing a CHECKPOINT. You may not see all the files removed immediately but you should start seeing a few go here-and-there.

Something to note based on the large number of files being generated is to increase your log backup frequency to account for the activity. As well it is best practice to keep SQL Server files separate from the OS drive, prime example of why in your case.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.