30.06.2013 Views

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Taking Log <strong>Backup</strong>s<br />

Chapter 5: Log <strong>Backup</strong>s<br />

We're going to discuss taking log backups the "GUI way," in SSMS, <strong>and</strong> by using native<br />

T-<strong>SQL</strong> <strong>Backup</strong> comm<strong>and</strong>s. However, before taking that elusive first log backup, let's<br />

quickly insert ten new rows of data into each of our three tables, as shown in Listing<br />

5-5. Having done so, we'll have ten rows of data for each table that is captured in a full<br />

database backup, <strong>and</strong> another ten rows for each table that is not in the full database<br />

backup, but where the details of the modifications are recorded in the live transaction<br />

log file.<br />

USE [DatabaseForLog<strong>Backup</strong>s]<br />

GO<br />

INSERT INTO MessageTable1<br />

VALUES ('Second set of data for MessageTable1', GETDATE())<br />

GO 10<br />

INSERT INTO MessageTable2<br />

VALUES ('Second set of data for MessageTable2', GETDATE())<br />

GO 10<br />

INSERT INTO MessageTable3<br />

VALUES ('Second set of data for MessageTable3', GETDATE())<br />

GO 10<br />

Listing 5-5: A second data load.<br />

The GUI way: native SSMS log backups<br />

Open SSMS, connect to your test server, locate the DatabaseForLog<strong>Backup</strong>s database,<br />

right-click on it <strong>and</strong> select the Tasks | Back Up… option. Select the Back Up… menu item<br />

to bring up the General page of the Back Up Database window, with which you should<br />

be familiar from Chapter 3, when we performed full database backups. The first set of<br />

configurable options is shown in Figure 5-4.<br />

161

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!