Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL 7.0 Database Location

Author  Topic 

ramlotte
Starting Member

2 Posts

Posted - 2001-12-07 : 12:41:52
How do I change the location where the databases reside from the
local C: Drive to the Local D: Drive. My C: Drive Partition is too
small to host the database.

Andraax
Aged Yak Warrior

790 Posts

Posted - 2001-12-10 : 02:12:35
Hi there!

Look up sp_detach_db in books online. You use that to disconnect the database file(s). After you detached the database, you can move the files to where you want them, and then use sp_attach_db.





Edited by - andraax on 12/10/2001 02:58:18
Go to Top of Page

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2001-12-10 : 06:43:31
i believe you could also use Access 2002 if you have a copy (XP version) as this has a built in feature for moving SQL Server databases.

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2001-12-10 : 07:50:09
Master Database
Startup parameters held at
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\Parameters

Master database location
-dD:\MSSQL7\data\master.mdf
-eD:\MSSQL7\log\ErrorLog
-lD:\MSSQL7\data\mastlog.ldf
Just change it and restart (can also change from enterprise manager)

tempDB
alter database tempdb modify file (name = tempdev, filename = '<newpath>.mdf')
Alter database tempdb modify file (name = templog, filename = '<newpath>.ldf')


Move Model / msdb (these cannot be dattached normally)
Start with trace flag
-T3608
This will stop the system recovering any database except master.
Restart sql server
You can then detach and reattach the databases

All other databases
Just dettach and reattach.


==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.

Edited by - nr on 12/10/2001 07:51:27
Go to Top of Page
   

- Advertisement -