Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / July 2008

Tip: Looking for answers? Try searching our database.

.mdf fragmentation due to autogrowth

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 08 Jul 2008 12:38 GMT
SQL Server 2005:

Our database is set to autogrow which has resulted in fragmentation of the
.mdf file across the disk.  If we restore the database from a .bak file to
the identical location over the existing database, would this maintain the
old fragmentation, or result in far less fragmentation assuming the phyiscal
disk has the capacity to provide reduced fragmentation?

Thanks in advance,
Mark
Tibor Karaszi - 08 Jul 2008 12:48 GMT
You can either stop your SQL Server and do a traditional disk defrag. I assume you are tight on disk
and have discarded that option, though...

Yes, RESTORE DATABASE can be used to make SQL Server allocate new fresh storage from windows. The
key here is that you need to use the REPLACE option of the restore command. Or drop the old database
and do the restore. What you want to avoid is for SQL Server to just read in the pages into the
existing database files. You want SQL Server to ask Windows for new storage for these files.

Signature

Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi

> SQL Server 2005:
>
[quoted text clipped - 5 lines]
> Thanks in advance,
> Mark
Linchi Shea - 08 Jul 2008 13:04 GMT
Best practices aside, a question I'd ask is, does the filesystem
fragmentation really cause any significant performance degradation? If it
doesn't, you could postpone the defrag and piggyback on some other planned
maintenance event, and therefore minimize any availability impact (if it is a
concern).

Linchi

> SQL Server 2005:
>
[quoted text clipped - 6 lines]
> Thanks in advance,
> Mark
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.