Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Transaction File

Status
Not open for further replies.

mkell1

Programmer
Mar 20, 2003
15
US
I'm hoping someone can point me in the correct direction. I need to move the primary transaction log file for each of several databases from one drive to another (basically from the E: drive to the D: drive). What are each of the steps that I need to go through to do this successfully without any negative impacts on the database? I am assuming that moving the physical file as well as changing the path where the database is pointing to are included in these steps, but I am sure there is more to it. If anyone could provide further guidance on this, it would be greatly appreciated!

Thanks,

Melissa
 
Nope ... not much more than that

Go into Enterprise Manager(EM) and drill down to the DB you need to move.

Right-click on the DB and choose All Tasks..Detach DB

Once detached, move the LDF (TLog) to it new home

In EM, right click on the Databases tree level and choose All Tasks..AttachDB.

Point to the location of your MDF (Data File). There should be a big red X on your tlog location. Change the drive letter from E: to D: where it now lives.

You should be done!


Thanks

J. Kusch
 
If these are important databases I would take a backup, test restore the backup on another server, delete the database then restore the backup with move to place the tr log on another location.

If you go for the detach/attach method make sure you backup the database first (I would also do a test restore of that database) so that you have a chance of getting the database back if the attach fails.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top