Showing posts with label data1. Show all posts
Showing posts with label data1. Show all posts

Monday, March 12, 2012

Move primary data and log files

I need to move all data from drive e: to another drive due
to space limitations.
My database consists of 2 data files and 2 log files:
e:\data1.mdf
f:\data2.mdf
e:\log1.ldf
f:\log2.ldf
I would like to consolidate the data files into 1 file and
the log files into 1 file.
The files on drive E: are primary filesThis is a multi-part message in MIME format.
--=_NextPart_000_010D_01C3CDF1.B3E7EF40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
See my answer to your previous post.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Kelly" <anonymous@.discussions.microsoft.com> wrote in message
news:080c01c3ce19$9019cca0$a101280a@.phx.gbl...
I need to move all data from drive e: to another drive due
to space limitations.
My database consists of 2 data files and 2 log files:
e:\data1.mdf
f:\data2.mdf
e:\log1.ldf
f:\log2.ldf
I would like to consolidate the data files into 1 file and
the log files into 1 file.
The files on drive E: are primary files
--=_NextPart_000_010D_01C3CDF1.B3E7EF40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

See my answer to your previous =post.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Kelly" wrote in message news:080c01c3ce19$90=19cca0$a101280a@.phx.gbl...I need to move all data from drive e: to another drive due to space limitations.My database consists of 2 data files and 2 log files:e:\data1.mdff:\data2.mdfe:\log1.ldff:\log2.=ldfI would like to consolidate the data files into 1 file and the log =files into 1 file.The files on drive E: are primary files

--=_NextPart_000_010D_01C3CDF1.B3E7EF40--|||I did that but SQL Server will not let me remove the
primary file. That is the drive I'm out of space on.
I guess I could move all the data files to antoher drive
first and then drop do the DBCC Shrinkile and Alter Remove
File.
>--Original Message--
>See my answer to your previous post.
>--
>Tom
>----
--
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>SQL Server MVP
>Columnist, SQL Server Professional
>Toronto, ON Canada
>www.pinnaclepublishing.com/sql
>
>"Kelly" <anonymous@.discussions.microsoft.com> wrote in
message
>news:080c01c3ce19$9019cca0$a101280a@.phx.gbl...
>I need to move all data from drive e: to another drive due
>to space limitations.
>My database consists of 2 data files and 2 log files:
>e:\data1.mdf
>f:\data2.mdf
>e:\log1.ldf
>f:\log2.ldf
>I would like to consolidate the data files into 1 file and
>the log files into 1 file.
>The files on drive E: are primary files
>|||This is a multi-part message in MIME format.
--=_NextPart_000_0152_01C3CDF4.0A5AE830
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
You're not removing the primary file. by detaching the database, you're
temporarily removing it from SQL Server. At that point, you can move the
files to a new location, using a regular file copy. Once in the new
location, just reattach.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Kelly" <anonymous@.discussions.microsoft.com> wrote in message
news:078301c3ce1c$ae22aca0$a301280a@.phx.gbl...
I did that but SQL Server will not let me remove the
primary file. That is the drive I'm out of space on.
I guess I could move all the data files to antoher drive
first and then drop do the DBCC Shrinkile and Alter Remove
File.
>--Original Message--
>See my answer to your previous post.
>--
>Tom
>----
--
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>SQL Server MVP
>Columnist, SQL Server Professional
>Toronto, ON Canada
>www.pinnaclepublishing.com/sql
>
>"Kelly" <anonymous@.discussions.microsoft.com> wrote in
message
>news:080c01c3ce19$9019cca0$a101280a@.phx.gbl...
>I need to move all data from drive e: to another drive due
>to space limitations.
>My database consists of 2 data files and 2 log files:
>e:\data1.mdf
>f:\data2.mdf
>e:\log1.ldf
>f:\log2.ldf
>I would like to consolidate the data files into 1 file and
>the log files into 1 file.
>The files on drive E: are primary files
>
--=_NextPart_000_0152_01C3CDF4.0A5AE830
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

You're not removing the primary =file. by detaching the database, you're temporarily removing it from SQL =Server. At that point, you can move the files to a new location, using a regular =file copy. Once in the new location, just reattach.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Kelly" wrote in message news:078301c3ce1c$ae=22aca0$a301280a@.phx.gbl...I did that but SQL Server will not let me remove the primary file. =That is the drive I'm out of space on.I guess I could move all the data =files to antoher drive first and then drop do the DBCC Shrinkile and Alter =Remove File.>--Original Message-->See my answer to =your previous post.>>-->Tom>>--=---->Thomas A. Moreau, BSc, PhD, MCSE, MCDBA>SQL Server MVP>Columnist, =SQL Server Professional>Toronto, ON Canada>www.pinnaclepublishing.com/sql>>>"Kell=y" wrote in message>news:080c01c3ce19$9019cca0$a101280a@.phx.gbl...>=I need to move all data from drive e: to another drive due>to space limitations.>>My database consists of 2 data files and 2 =log files:>>e:\data1.mdf>f:\data2.mdf>>e:\=log1.ldf>f:\log2.ldf>>I would like to consolidate the data files into 1 file and>the log =files into 1 file.>>The files on drive E: are primary files>

--=_NextPart_000_0152_01C3CDF4.0A5AE830--