Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Operations
Administration
 How to: Create a Transaction Log Ba...

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Other versions are also available for the following:
SQL Server 2008 Books Online (June 2009)
How to: Create a Transaction Log Backup (Transact-SQL)

This topic explains how to create a transaction log backup using a BACKUP LOG statement.

  1. Execute the BACKUP LOG statement to back up the transaction log, specifying the following:

    • The name of the database to which the transaction log that you want to back up belongs.
    • The backup device where the transaction log backup is written.
  2. Optionally, specify:

    • The INIT clause to overwrite the backup media, and write the backup as the first file on the backup media. If no existing media header exists, one is automatically written.
    • The SKIP and INIT clauses to overwrite the backup media even if there are either backups on the backup media that have not yet expired, or the media name does not match the name on the backup media.
    • The FORMAT clause, when you are using media for the first time, to initialize the backup media and rewrite any existing media header.
      The INIT clause is not required if the FORMAT clause is specified.
      ms191284.note(en-us,SQL.100).gifImportant:
      Use extreme caution when you are using the FORMAT or INIT clauses of the BACKUP statement as this destroys any backups previously stored on the backup media.

ms191284.note(en-us,SQL.100).gifImportant:
The MyAdvWorks_FullRM database is a copy of AdventureWorks, which uses the simple recovery model. To permit log backups, before taking a full database backup, the database was set to use the full recovery model by using: ALTER DATABASE MyAdvWorks_FullRM SET RECOVERY FULL.

This example creates a transaction log backup for the MyAdvWorks_FullRM database to the previously created named backup device, MyAdvWorks_FullRM_log1.

BACKUP LOG MyAdvWorks_FullRM
   TO MyAdvWorks_FullRM_log1
GO
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker