Wednesday, March 21, 2012

Location of SQL

I have an SQL server with a number of databses including :
Sharepoint and SMS. I would like to move these databases to the D
partition and they are currently in the C:\ partition.
How can this be done ?Easiest is to us sp_detach_db and sp_attach_db (documented in Books Online).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"scuba19" <scuba19@.discussions.microsoft.com> wrote in message
news:D954B376-1C4F-449E-B25D-0DF5CDA0FA59@.microsoft.com...
>I have an SQL server with a number of databses including :
> Sharepoint and SMS. I would like to move these databases to the D
> partition and they are currently in the C:\ partition.
> How can this be done ?|||options
1. Detach / Attach
2. Backup / Restore with MOVE
3. add files on d drive to file group
DBBC SHRINKFILE with EMPTRYFILE
drop old files
"scuba19" <scuba19@.discussions.microsoft.com> wrote in message
news:D954B376-1C4F-449E-B25D-0DF5CDA0FA59@.microsoft.com...
>I have an SQL server with a number of databses including :
> Sharepoint and SMS. I would like to move these databases to the D
> partition and they are currently in the C:\ partition.
> How can this be done ?|||Hi thanks for your response. How Do I move the databses using EM ? Also
How do I attach , detack with EM ?
"jaylou" wrote:
> The easiest way would be to detach the databases, Move the MDF and LDF files
> to the new location and re-attach the databases.
> You can do this all in Enterprise Manager. You can also set the default
> location to your new location of these databases thru EM Properties of the
> Server.
> HTH,
> Joe
>
> "scuba19" wrote:
> > I have an SQL server with a number of databses including :
> >
> > Sharepoint and SMS. I would like to move these databases to the D
> > partition and they are currently in the C:\ partition.
> >
> > How can this be done ?|||Hi , I found out how to detach but i am having the problem with one
datbase. A databse that is named tembdb which is 5GB in size
"jaylou" wrote:
> The easiest way would be to detach the databases, Move the MDF and LDF files
> to the new location and re-attach the databases.
> You can do this all in Enterprise Manager. You can also set the default
> location to your new location of these databases thru EM Properties of the
> Server.
> HTH,
> Joe
>
> "scuba19" wrote:
> > I have an SQL server with a number of databses including :
> >
> > Sharepoint and SMS. I would like to move these databases to the D
> > partition and they are currently in the C:\ partition.
> >
> > How can this be done ?|||The easiest way would be to detach the databases, Move the MDF and LDF files
to the new location and re-attach the databases.
You can do this all in Enterprise Manager. You can also set the default
location to your new location of these databases thru EM Properties of the
Server.
HTH,
Joe
"scuba19" wrote:
> I have an SQL server with a number of databses including :
> Sharepoint and SMS. I would like to move these databases to the D
> partition and they are currently in the C:\ partition.
> How can this be done ?|||tempdb is a system database that is used to proccess queryies...refer to
Books Online
to move this database you can simply use ALTER DATABASE...
if you restart your sql server ,this db will shrink back to its origional
size...determined by the settings of the model db
"scuba19" <scuba19@.discussions.microsoft.com> wrote in message
news:D3D4B487-6C03-41DE-AE62-BE5944C4D504@.microsoft.com...
> Hi , I found out how to detach but i am having the problem with one
> datbase. A databse that is named tembdb which is 5GB in size
> "jaylou" wrote:
>> The easiest way would be to detach the databases, Move the MDF and LDF
>> files
>> to the new location and re-attach the databases.
>> You can do this all in Enterprise Manager. You can also set the default
>> location to your new location of these databases thru EM Properties of
>> the
>> Server.
>> HTH,
>> Joe
>>
>> "scuba19" wrote:
>> > I have an SQL server with a number of databses including :
>> >
>> > Sharepoint and SMS. I would like to move these databases to the D
>> > partition and they are currently in the C:\ partition.
>> >
>> > How can this be done ?|||http://support.microsoft.com/default.aspx?scid=kb;en-us;224071#XSLTH3207121122120121120120
"David J. Cartwright" <davidcartwright@.hotmail.com> wrote in message
news:uFfhhZNAGHA.356@.TK2MSFTNGP12.phx.gbl...
> tempdb is a system database that is used to proccess queryies...refer to
> Books Online
> to move this database you can simply use ALTER DATABASE...
> if you restart your sql server ,this db will shrink back to its origional
> size...determined by the settings of the model db
> "scuba19" <scuba19@.discussions.microsoft.com> wrote in message
> news:D3D4B487-6C03-41DE-AE62-BE5944C4D504@.microsoft.com...
>> Hi , I found out how to detach but i am having the problem with one
>> datbase. A databse that is named tembdb which is 5GB in size
>> "jaylou" wrote:
>> The easiest way would be to detach the databases, Move the MDF and LDF
>> files
>> to the new location and re-attach the databases.
>> You can do this all in Enterprise Manager. You can also set the default
>> location to your new location of these databases thru EM Properties of
>> the
>> Server.
>> HTH,
>> Joe
>>
>> "scuba19" wrote:
>> > I have an SQL server with a number of databses including :
>> >
>> > Sharepoint and SMS. I would like to move these databases to the D
>> > partition and they are currently in the C:\ partition.
>> >
>> > How can this be done ?
>|||I am not able to do this to a databse named tempdb which is 5 GB in size ?
"David J. Cartwright" wrote:
> options
> 1. Detach / Attach
> 2. Backup / Restore with MOVE
> 3. add files on d drive to file group
> DBBC SHRINKFILE with EMPTRYFILE
> drop old files
> "scuba19" <scuba19@.discussions.microsoft.com> wrote in message
> news:D954B376-1C4F-449E-B25D-0DF5CDA0FA59@.microsoft.com...
> >I have an SQL server with a number of databses including :
> >
> > Sharepoint and SMS. I would like to move these databases to the D
> > partition and they are currently in the C:\ partition.
> >
> > How can this be done ?
>
>|||What problem are you having with TempDB? Did you move Master and model as
well?
I never tried to do this with system DBs only my own created DBs.
"scuba19" wrote:
> Hi , I found out how to detach but i am having the problem with one
> datbase. A databse that is named tembdb which is 5GB in size
> "jaylou" wrote:
> > The easiest way would be to detach the databases, Move the MDF and LDF files
> > to the new location and re-attach the databases.
> > You can do this all in Enterprise Manager. You can also set the default
> > location to your new location of these databases thru EM Properties of the
> > Server.
> >
> > HTH,
> > Joe
> >
> >
> > "scuba19" wrote:
> >
> > > I have an SQL server with a number of databses including :
> > >
> > > Sharepoint and SMS. I would like to move these databases to the D
> > > partition and they are currently in the C:\ partition.
> > >
> > > How can this be done ?

No comments:

Post a Comment