Quantcast
Channel: Tom Carpenter's Blog » sql server
Viewing all articles
Browse latest Browse all 4

SQL Server Transaction Log Backups

0
0

When you backup the SQL Server transaction log, the log is truncated by default. The space that has been consumed by transactions is freed once those transactions are backed up. Backing up the transaction log of a database throughout the day allows you to recover to the point of failure or any point in time. In addition, because databases that are set to full or bulk logged recovery models do not truncate the transaction log during full or differential backups, it may be essential to backup the transaction log periodically just to truncate the log.

If you allow the transaction log of a database to become completely filled, users will be denied write access to the database until you clear the transaction log. Scheduling regular backups of the transaction log can prevent this from happening. When the log is full, users may still execute read-only SELECT statements against the database. You can also prevent the transaction log from filling up by enabling autogrowth on the transaction log.

Just as you can backup the database using SQL Server Management Studio (SSMS), you can backup a transaction log in the graphical interface. Just be sure to select the Backup Type of Transaction Log. The T-SQL command for backing up the transaction log for the AdventureWorks database is as follows:

BACKUP LOG AdventureWorks To DISK='C:BACKUPSAWorksTlog.bak';

The preceding content excerpted from SQL Server 2008 Administration by Tom Carpenter.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images