Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Move MS SQL server from C: to D: drive

Posted on 1998-12-16
7
Medium Priority
?
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 
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 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

705 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