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)
 Transfering MDF& LDF files in SQL server 2000

Author  Topic 

yonee33
Starting Member

1 Post

Posted - 2009-07-16 : 08:33:01

Hello, guys how are you doing? i am new to this website and i have a problem of transfering the MDF and LDF files from drive "C" to "D" drive. the reason why i want to transfer this file is, because My HDD "c" is getting small However, I have a Big capacity( 155GB)in drive "D". one thing i want to tell you is that i have tried to use the " detach and attach database" gave error and i lost data. if you want to know what the error is;
First I detach my Accounting database and the command was successfully executed but when I run the ‘attach' command, this ERROR massage says “Device activation error. The physical file name 'D:\DB_restored\Accounting.mdf' may be in correct. Because of this error, I lost data and again I restored with the backed up data that I had earlier.
right now, my question is there is an way step but before doing this i want to make sure that whether it is ok, or not and i don't want let my self in to big trouble. cause i am handling customer database. any how, please take a look the steps which i like to use
USING SQL SERVER 2000 BACK UP & RESTORE METHOD
1. Open enterprise manager and databases (Back up my database) and Put it in to “D" drive and then create a new folder for Database restore. Example: - (D:\DB_RESTORED)
2. Restore the Backed up Data from “D" drives using the following steps
A. Select the database you want to restore and go to restore option
B. Click the radio button of “leave database read-only and able to restore additional transaction logs"
C. Click an icon beside undo file and select a place you want to save the data and click OK. Then copy the path of the data you choose (D:\DB_RESTORED)
D. click the radio button for "leave database operational. No additional transaction logs can be restored"
E. Go to the logical file name and there are two databases MDF and LDF
F. Paste the Database but leave the .MDF and .LDF files and then Click OK. That is it.

Please Help

Thanks



tripodal
Constraint Violating Yak Guru

259 Posts

Posted - 2009-07-16 : 10:25:56
The best way to do this, would be to take a recent backup and use
Restore with move.

Here is a thread that will help you.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=48404
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2009-07-16 : 14:02:24
Or de-attach the database (or take offline), copy the mdf/ldf files to the new drive, select attach database and point the database to the new mdf/ldf files. In my experience, it's faster - but whatever works best for you. Once complete and verified, delete the old files.

Terry

-- Procrastinate now!
Go to Top of Page

shalagur
Starting Member

0 Posts

Posted - 2009-07-18 : 04:13:51


Thank you very much guys
Go to Top of Page
   

- Advertisement -