A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/support/sql/admin/defragmenting-database-disk-drives below:

Defragmenting database disk drives - SQL Server

This article provides some guidance regarding defragmentation of SQL Server database drives.

Original product version:   SQL Server
Original KB number:   3195161

Should SQL Server disks be defragmented at the operating system layer?

That depends on the fragmentation state of the current drives. Generally, it doesn't hurt and it may help, assuming you follow the precautions that are described in the Precautions when defragmenting SQL Server database drives section. The only negative is that you must shut down SQL Server unless the defragmentation tool supports transactional data capabilities. The good news is that, after you've run the defrag, you don't really have to do it again unless you have many Autogrowth and other files moving on and off the disks. Make sure that you understand any write-caching strategies that the utility uses. Caching by such a utility might involve a non-battery-backed cache, and this could violate WAL protocol requirements.

More information

A disk defragmenter moves all files, including the database file, into contiguous clusters on a hard disk. This optimizes and speeds up file access. Except for Windows NT operating system, if you don't defragment your hard disk, the operating system may have to go to several physical locations on the disk to retrieve the database file, making file access slower.

Because physical data access is the most expensive part of an I/O request, defragmentation can provide performance gains for SQL Server and other applications. Positioning-related chunks of data close to each other reduces I/O operation requirements.

Various defragmentation utilities are available in the market today. Some utilities enable defragmentation on open files, whereas others require closed-file defragmentation or perform better when used under closed-file conditions. Additionally, some utilities have transactional capabilities, whereas others don't.

Precautions when you defragment SQL Server database drives

When you evaluate a defragmentation utility for use with SQL Server, make sure that the utility provides transactional data capabilities. Specifically, choose a defragmentation utility that provides the following transactional data capabilities:

Critical disk defragmenters that don't provide these transactional data capabilities shouldn't be used unless the SQL Server instance using the disks to be defragmented has been shut down so that you're not defragmenting open database files.

Open-file defragmentation raises several possible issues that closed-file defragmentation typically doesn't:

Recommendations References

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4