Home > Archive > MS SQL Server > November 2005 > Moving Transaction Log to another Drive









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Moving Transaction Log to another Drive
Larry Bird

2005-11-29, 11:23 am

I have a SQL 2000 database in place running fine. However, the Database and
the Logs files are on the same drive. I want to move the Transaction log to
another drive seperate from my database location.

What is the best way to accomplish this?

Can I just detach the database and copy the log file to a different drive?
Re-attach the database and point the new location of the log file.

Thanks

Absar Ahmad

2005-11-29, 1:23 pm

Yes, this method is fine. However, remember that your database will remain
unavailable for the duration from being detached till being re-attached.

"Larry Bird" wrote:

> I have a SQL 2000 database in place running fine. However, the Database and
> the Logs files are on the same drive. I want to move the Transaction log to
> another drive seperate from my database location.
>
> What is the best way to accomplish this?
>
> Can I just detach the database and copy the log file to a different drive?
> Re-attach the database and point the new location of the log file.
>
> Thanks
>

Absar Ahmad

2005-11-29, 8:23 pm

You can also accomplish this while keeping the database available to the
application and users. But this method is slightly complicated and it will
take more time than the earlier method. Please take a Full Database Backup
before using this method.

Here are the steps for this:

1. Use ‘Alter Database … ADD LOG FILE…’ to add a new Log File. The New Log
File should be located on the other Hard Disk. Size of the New Log File
should be equal to (or greater than) the size of the existing Log File (Old
Log File).
2. Use ‘DBCC SHRINKFILE ..........EMPTYFILE’ to ‘empty’ the Old Log File.
3. Use ‘Alter Database … REMOVE FILE …’ to remove the Old Log File.

"Absar Ahmad" wrote:
[color=darkred]
> Yes, this method is fine. However, remember that your database will remain
> unavailable for the duration from being detached till being re-attached.
>
> "Larry Bird" wrote:
>
Bud Y. Zer

2005-11-29, 8:23 pm

Use GOOGLE. This question has been posted a million (milliard) times
before!


"Larry Bird" < LarryBird@discussion
s.microsoft.com> wrote in message
news:945B443F-146F-4861-84E3- 77A79579EE89@microso
ft.com...
>I have a SQL 2000 database in place running fine. However, the Database
>and
> the Logs files are on the same drive. I want to move the Transaction log
> to
> another drive seperate from my database location.
>
> What is the best way to accomplish this?
>
> Can I just detach the database and copy the log file to a different drive?
> Re-attach the database and point the new location of the log file.
>
> Thanks
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com