Wednesday, March 28, 2012

Moving Transaction Log to another Drive

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.
ThanksYes, 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 a
nd
> 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
>|||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 N
ew 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:
[vbcol=seagreen]
> 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:
>|||Use GOOGLE. This question has been posted a million (milliard) times
before!
"Larry Bird" <LarryBird@.discussions.microsoft.com> wrote in message
news:945B443F-146F-4861-84E3-77A79579EE89@.microsoft.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
>

No comments:

Post a Comment