Sample Header Ad - 728x90

Defrag or Backup+Restore

1 vote
1 answer
1866 views
I have an MDF file that was autogrown from 1MB to 40GB in 10% increment. The file is heavily fragmented now, and I want to defrag it with minimum downtime. I have a plan that I am not sure will work: 1. Normally defrag the partition while the service is still running until the only fragmented files are the database files. 2. Enter single user mode. 3. Make complete backup to a different partition. 4. Delete the database with fragmented MDF file. 5. Create/restore new database from the recently created backup. Will dropping database and then restore from backup remove the file fragmentation? Or should I just turn off the service and run defrag tool until it finishes?
Asked by Endy Tjahjono (381 rep)
Dec 13, 2012, 03:42 AM
Last activity: Jan 14, 2022, 09:00 AM