Ask the Expert

Improve SQL Server performance by creating a transaction log file

When you create a second location for a transaction log, how does SQL handle it? How do I make sure the database starts to write transactions to the new file? I created the second log file because we have run out of disk space.

    Requires Free Membership to View

Creating an additional file for databases and transaction logs can not only provide additional space, it can also improve database performance. Note that performance can improve for a database when you create multiple files on distinct hard disk or RAID devices. But performance will not improve for a transaction log when you do the same thing. Why? As it turns out, transaction logs only write to the last active page of the transaction log at any given moment. Thus, the transaction log can only write on one file at any given time. SQL Server will automatically start to write to the new file as space on the original file is consumed. You will not need to do any sort of manual switch over. Also, make sure you have a good backup routine in place, so your transaction log will be frequently cleaned out. In my production systems, my rule of thumb is to do a full database backup nightly and transaction log backups every 15 minutes.


Do you have comments on this Ask the Expert Q&A? Let us know.

This was first published in August 2005

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: