Solved

Move MS SQL server from C: to D: drive

Posted on 1998-12-16
7
301 Views
Last Modified: 2010-03-19
I have MS SQL 6.5 installed on the C: drive of my server, which is running out of space,(200MB). I would like to reinstall it onto the D: drive (2GB) what is the best way of doing this, transfering the databases etc?
0
Comment
Question by:mursell
7 Comments
 

Expert Comment

by:kt1230
ID: 1092289
I would suggest one methods:

(1)Keep you existing SQL system and data file intact; Build a
   new device file on D drive, and expand your database to this
   newly created device. ( No need to reinstall, might get
   some perfomance boot and less hassle).
 


0
 
LVL 4

Expert Comment

by:dwwang
ID: 1092290
If you want to free the disk space of C:, I have a solution, I have done this before:

1. Delete your original database and then the corresponding device from Enterprise Manager. NOTE: the DAT file is not deleted when you delete the database and the device :)

2. Create a new device in D: of exactly the SAME NAME AND SIZE as the original one, then create the database, (also of exactly the same name of the original one)

3. Shutdown SQL server, then copy the old DAT file from C: to D: to overwrite the newly created DAT file.

4. Restart SQL Server and you can see every thing is OK now!

Anyway, you take your own risk to do all this.

You can first do some tests before take out the real task, also be sure to backup all schema/data before doing the transfer, it's always better than sorrow :)
0
 
LVL 1

Expert Comment

by:ivanh
ID: 1092291
I had the same problem, but all I did was move my database devices to another drive.  Microsoft has some stored proc that assist in this, but I had problems in even finding those stored procs (I think it was called sp_movedevice, or something like that), anyway, I move my master.dat and all my other dats manually and it works just fine.

Steps I took:
1.  Shut down SQL Server.  
2.  COPY (don't move) all your dats to the new location.  Master as well, if you want
3.  Go into the registry \\HKEY_LOCAL_MACHINE\Microsoft\MSSQLServer\Parameters.  Change SQLArg0 to the new location of your master.dat
4.  Start SQL Server
5.  In the master database, do a select * from sysdevices.  You will see all your dats and their path.  Change these to the new location of your dats with an update statement.
6.  stop and restart SQL Server

Poke around and make sure none of your DB's are suspect.  If so, then you will need to make a change in sysdatabases (status column).  

Just for kicks, I also ran a dbcc checkdb just to make sure everything was still okay.

If you want to leave your master.dat where it is, then just do 1,2,5,6

I've been running fine for about 3 weeks now.

0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 1

Expert Comment

by:ivanh
ID: 1092292
when you feel confident, delete the old dats.
0
 
LVL 1

Expert Comment

by:ivanh
ID: 1092293
I would also suggest before updating sysdevices that you make a copy of the table by doing a select into.
0
 
LVL 3

Accepted Solution

by:
traygreen earned 100 total points
ID: 1092294
If you want the server engine on th new drive, go ahead and install it there

then/or
1) Create a device on the D Drive
2) Create a database on the new device (must be as large as the source database - not actual data)
3) (if you created new server)make sure both servers are registered in one of the servers
4) Right click on the database on your c drive and select the "transfer" option
5) Verify the Source and set the target database
6) Click "Start Transfer"

Then you can delete the database on C and remove the device etc.
0
 
LVL 3

Expert Comment

by:traygreen
ID: 1092295
Other option is just to create a new device on the new drive and then Alter the database to include space from the new drive.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question