move system databases from C drive to D drive

move system databases from C drive to D drive

Post by Biva » Fri, 02 Feb 2001 04:25:43



Hi,
Has anyone tried moving system databases (master, model, msdb, tempdb) from
C drive to D drive.  I have only 330 MB left on C drive.  Problem arose last
week when temdb log file got huge and filed up all the spaces in C drive.
Since I have over 6 GB left in D drive and for consistency purposes, I would
like to move my system databases to D drive where all the user databases
are.  I know I can't use backup and restore for tempdb.  I have not been
able to come up with any other way to do it.  Any help in this matter will
be greatly appreciated.

Thanks, Biva

 
 
 

move system databases from C drive to D drive

Post by Keith Kratochvi » Fri, 02 Feb 2001 04:57:51


I like BACKUP / RESTORE
sp_detach_db / sp_attach_db would probably also work.

For tempdb...
--sp_helpdb tempdb
alter database tempdb modify file (name = 'tempdev', filename =
'D:\TEMPDB.MDF')
go
alter database tempdb modify file (name = 'templog', filename =
'D:\TEMPLOG.LDF')
go

--
Keith
==============
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.


Quote:> Hi,
> Has anyone tried moving system databases (master, model, msdb, tempdb)
from
> C drive to D drive.  I have only 330 MB left on C drive.  Problem arose
last
> week when temdb log file got huge and filed up all the spaces in C drive.
> Since I have over 6 GB left in D drive and for consistency purposes, I
would
> like to move my system databases to D drive where all the user databases
> are.  I know I can't use backup and restore for tempdb.  I have not been
> able to come up with any other way to do it.  Any help in this matter will
> be greatly appreciated.

> Thanks, Biva


 
 
 

move system databases from C drive to D drive

Post by Doug Bas » Fri, 02 Feb 2001 06:14:32


master - shut down the server, move the files, then restart the server using
the -d and -l switches.  See SQL Server Startup Options in BOL.  You could
also do a backup and RESTORE WITH MOVE (so long as you start the server in
single-user mode using the -m switch).

model - do a backup and use RESTORE WITH MOVE.  See RESTORE in BOL for
syntax.

msdb - I think sp_detach_db and sp_attach_db might work, but you could also
do a backup and RESTORE WITH MOVE.

tempdb - see Keith's post.

--
Douglas Bass
QualChoice of NC
Database Administrator


Quote:> Hi,
> Has anyone tried moving system databases (master, model, msdb, tempdb)
from
> C drive to D drive.  I have only 330 MB left on C drive.  Problem arose
last
> week when temdb log file got huge and filed up all the spaces in C drive.
> Since I have over 6 GB left in D drive and for consistency purposes, I
would
> like to move my system databases to D drive where all the user databases
> are.  I know I can't use backup and restore for tempdb.  I have not been
> able to come up with any other way to do it.  Any help in this matter will
> be greatly appreciated.

> Thanks, Biva

 
 
 

move system databases from C drive to D drive

Post by Biva » Fri, 02 Feb 2001 06:33:30


Thanks for the prompt reply Keith..


> I like BACKUP / RESTORE
> sp_detach_db / sp_attach_db would probably also work.

> For tempdb...
> --sp_helpdb tempdb
> alter database tempdb modify file (name = 'tempdev', filename =
> 'D:\TEMPDB.MDF')
> go
> alter database tempdb modify file (name = 'templog', filename =
> 'D:\TEMPLOG.LDF')
> go

> --
> Keith
> ==============
> Please reply only to the newsgroups.
> When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
> can be cut and pasted into Query Analyzer is appreciated.



> > Hi,
> > Has anyone tried moving system databases (master, model, msdb, tempdb)
> from
> > C drive to D drive.  I have only 330 MB left on C drive.  Problem arose
> last
> > week when temdb log file got huge and filed up all the spaces in C
drive.
> > Since I have over 6 GB left in D drive and for consistency purposes, I
> would
> > like to move my system databases to D drive where all the user databases
> > are.  I know I can't use backup and restore for tempdb.  I have not been
> > able to come up with any other way to do it.  Any help in this matter
will
> > be greatly appreciated.

> > Thanks, Biva

 
 
 

move system databases from C drive to D drive

Post by Tibor Karasz » Fri, 02 Feb 2001 20:03:17


Biva,

In addition to the other posts:
Check out KB Q224071.

--
Tibor Karaszi, SQL Server MVP
FAQ from Neil at: http://www.sqlserverfaq.com
Please reply to the newsgroup only, not by email.


> Hi,
> Has anyone tried moving system databases (master, model, msdb, tempdb) from
> C drive to D drive.  I have only 330 MB left on C drive.  Problem arose last
> week when temdb log file got huge and filed up all the spaces in C drive.
> Since I have over 6 GB left in D drive and for consistency purposes, I would
> like to move my system databases to D drive where all the user databases
> are.  I know I can't use backup and restore for tempdb.  I have not been
> able to come up with any other way to do it.  Any help in this matter will
> be greatly appreciated.

> Thanks, Biva

 
 
 

1. How to move Databases from drive C: to drive D:

Hi.

I'm rather new into SQL-server, so I hope somebody can help me out here :

I'm running low on free space on my C-drive, and I would like to move the
SQL-server databases from drive C: to drive D: to free some space,  but I
can't figure out how.

Is there somebocy who can make a short punchlist containing a 'How-To-Do'
recipe ??

Thanks.

bye-bye from

Niels Krogh
Ramboll, Esbjerg, Denmark


2. SqlJunkies.com: Just Launched Web Logs

3. Moving database location from one drive to another drive

4. DTS job Access->SQL errors out

5. Moving Database from Drive E: to Drive F:

6. Report Builder

7. Moving System Databases to new hard drive

8. Sysmaster Disappearing!

9. Moving from one drive to another drive

10. Oracle File Systems Drive (Internet Drive)

11. Insert records from a database in floppy drive to hard drive

12. Moving Database to Different Partition/Drive

13. Moving replicated Database to another drive