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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Log File location

Status
Not open for further replies.

AnnTiSpam

Vendor
Jul 2, 2002
6
US
I have a customer who has the transaction logs on the same partition as the database. I created a new partition for them on the mirrored drives and want to move the transactions logs onto it. How do you move the log files over to the new partitions? I can't find any reference to that on the Technet website.
 
I find moving database files and transaction logs much easier to do by dumping and restoring.
The restore database command has a WITH MOVE option where you can change the location of the database & tran log files.
EG I've got a db called test-1, I want to move the tran log whose logical filename is test-1_Log to a new drive I can do the following


restore database [test-1] from disk = 'c:\test-1.bak' with move 'test-1_Log' to 'c:\test-1_newlog.LDF'
 
While I agree that Dump and Restore may be simpler, it can take much longer causing more down time than the Detach, Move, Attach method. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top