Monday, March 19, 2012

Defragment SQL Database File

I am trying to defragment our sql database file but windows defragmentation
tool defragments everything but the database file. I have tried detaching th
e
database and stopping the services but with no luck. Drive size is 82 Gb and
file size is about 45 Gb. The file is in 2 fragments and records a 99% file
fragmentation level. Does anyone have any ideas how I can defrag this file?
Thank you
Clint ColefaxClint
Look at DBCC SHRINKFILE command in the BOL.
"Clint Colefax" <ClintColefax@.discussions.microsoft.com> wrote in message
news:B7892BF8-05E9-459A-B70E-844612937AC7@.microsoft.com...
> I am trying to defragment our sql database file but windows
defragmentation
> tool defragments everything but the database file. I have tried detaching
the
> database and stopping the services but with no luck. Drive size is 82 Gb
and
> file size is about 45 Gb. The file is in 2 fragments and records a 99%
file
> fragmentation level. Does anyone have any ideas how I can defrag this
file?
> Thank you
> Clint Colefax|||And to avoid such fragmentation in the future, check out:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:%23Zy%23K7NDFHA.2764@.TK2MSFTNGP10.phx.
gbl...
> Clint
> Look at DBCC SHRINKFILE command in the BOL.
>
> "Clint Colefax" <ClintColefax@.discussions.microsoft.com> wrote in message
> news:B7892BF8-05E9-459A-B70E-844612937AC7@.microsoft.com...
> defragmentation
> the
> and
> file
> file?
>|||Tibor
You are not added yet "Search" engine on your web site
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:unTZdvQDFHA.328@.tk2msftngp13.phx.gbl...
> And to avoid such fragmentation in the future, check out:
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23Zy%23K7NDFHA.2764@.TK2MSFTNGP10.phx.gbl...
message[vbcol=seagreen]
detaching[vbcol=seagreen]
Gb[vbcol=seagreen]
>|||Thanks for the reminder Uri. It is still on the to-do list, but other things
keep getting popped on
the stack before I get to do this one. ;-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:%23mkEydRDFHA.1280@.TK2MSFTNGP10.phx.gb
l...
> Tibor
> You are not added yet "Search" engine on your web site
>

No comments:

Post a Comment