Hi Adi
First you need to take backup of all databases.
a) For Master -
RUN SQLSERVR -c -m (in single mode)
Open query analyzer
RESTORE DATABASE MASTER FROM <BackUPFile>
WITH
MOVE 'master' TO <New Location>,
MOVE 'master' TO <New Location>,
REPLACE
Restart SQL SERVER AGAIN WITH
RUN SQLSERVR -c -f
Update Sysdatabases filename column with latest filename if not found
updated for Master .
Master Moved (Note : Logical and Physical Name of DB must be same use
Restore FileListOnly From <BackUPFile> before restoring )
b) For tempdb
Use Master
Update Sysdatabases SET FileName='New File Name with path.mdf' WHERE
NAME='tempdb'
ALTER DATABASE tempdb
Modify File (name=tempdev, filename='New Path with filename.mdf'
ALTER DATABASE tempdb
Modify File (name=templog, filename='New Path with filename.ldf'
Restart SQL SERVER Again. On Successful- DELETE old log file and old mdf
file of tempdb.
c) FOR MSDB, Model and User Defined Database
First deatch the Model database Using sp_detach_db
RESTORE DATABASE [MSDB/MODEL/User Defined Database] FROM <BackUPFile>
WITH
MOVE 'DatabaseFileName' TO <New Location>,
MOVE 'DatabaseLogicalFileName'' TO <New Location>,
REPLACE
Regards
Banga Balvinder
DBA, eMind eLearning Software Service Pvt Ltd
DELHI, INDIA
-----Original Message-----
From: Adil Basha [mailto:[Email Address Removed] Thursday, October 09, 2003 10:30 PM
To: LazyDBA.com Discussion
Subject: Moving Databases Urgent!!!
Hi,
sqlserver 7
wint NT
I want to move
1. master
2. model
3. northwind
4. pubs
5. tempdb
and other database from c drive to d drive as c drive
is full
how can i do tht pls advice
TIA
Adi
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page