Monday, March 12, 2012

moving SQL data and then shrinking file

I have added a new drive to a server and want to move one of the databases to
this drive to alleviate space problems on the original drive. I wanted to do
this with as little downtime to the system as possible and the size of the
original database file is almost 100 GB. I created a second file (NDF) on
the new drive. I think did a shrinkfile to empty the original mdf file. It
appears that most of the data has been moved, but I cannot reduce the size of
the mdf file even though it says it is only using 5 GB of the 100 GB. I
would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
size of a mdf file?
Thanks.
--
Danne> Can you reduce the
> size of a mdf file?
Yes. You might need to do a few SHRINKFILEs, and make sure you don't specify the NOTRUNCATE option.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Danne" <Danne@.discussions.microsoft.com> wrote in message
news:84C00DB8-5491-405C-B9EA-72D2D9521D2B@.microsoft.com...
>I have added a new drive to a server and want to move one of the databases to
> this drive to alleviate space problems on the original drive. I wanted to do
> this with as little downtime to the system as possible and the size of the
> original database file is almost 100 GB. I created a second file (NDF) on
> the new drive. I think did a shrinkfile to empty the original mdf file. It
> appears that most of the data has been moved, but I cannot reduce the size of
> the mdf file even though it says it is only using 5 GB of the 100 GB. I
> would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
> size of a mdf file?
> Thanks.
> --
> Danne

No comments:

Post a Comment