Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Performance issue removing NDF files

$
0
0

I inherited some databases where the previous DBA added 1GB data files when space was needed.  I decided to remove files from one of the databases.  There was over 50 data files and most were 1GB.  I ran DBCC Shrinkfile with Emptyfile and each of the files took between 30 minutes and 1 hour.  I managed to get down to 6 data files and performance is much better.

My problem arises because I'm trying to do the same to a database with 100 files.  The first file I decided to delete took over 17 hours and I cancelled the process.  I'm testing in a test environment so I disabled all connections and it's still very slow.  I do see that this process reads from every other file when trying to shrink the file.  I read somewhere that DBCC Shrinkfile is a single thread process.  Are my first couple of files going to take this long but get better the more files I delete?

I also read that rebuilding indexes before shrinking make the shrink process faster. 

Any ideas on what may save some time and effort?  I have 92 1GB files that I would like to consolidate into the remaining 8 files that are spread on 2 different drives on a SAN on 2 different LUNS.

Thanks in advance


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>