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.

Chapter 1: Basics of <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong><br />

for databases that are simply too large to back up in a single operation. However, they are<br />

not required on every database you manage. Unless you have experience with them, or<br />

know definitively that you will gain significant performance with their use, then sticking<br />

to a single data file database will work for you most of the time (with the data being<br />

automatically striped across physical storage, via RAID).<br />

Finally, before we move on, it's important to note that <strong>SQL</strong> <strong>Server</strong> transaction log files<br />

are never members of a filegroup. Log files are always managed separately from the <strong>SQL</strong><br />

<strong>Server</strong> data files.<br />

Transaction log<br />

A transaction log file contains a historical account of all the actions that have been<br />

performed on your database. All databases have a transaction log file, which is created<br />

automatically, along with the data files, on creation of the database <strong>and</strong> is conventionally<br />

denoted with the LDF extension. It is possible to have multiple log files per database<br />

but only one is required. Unlike data files, where writes occur in a r<strong>and</strong>om fashion, <strong>SQL</strong><br />

<strong>Server</strong> always writes to the transaction log file sequentially, never in parallel. This means<br />

that it will only ever write to one log file at a time, <strong>and</strong> having more than one file will<br />

not boost write-throughput or speed. In fact, having more multiple files could result in<br />

performance degradation, if each file is not correctly sized or differs in size <strong>and</strong> growth<br />

settings from the others.<br />

Some inexperienced DBAs don't fully appreciate the importance of the transaction log<br />

file, both to their backup <strong>and</strong> recovery plan <strong>and</strong> to the general day-to-day operation of<br />

<strong>SQL</strong> <strong>Server</strong>, so it's worth taking a little time out to underst<strong>and</strong> how <strong>SQL</strong> <strong>Server</strong> uses the<br />

transaction log (<strong>and</strong> it's a topic we'll revisit in more detail in Chapter 5, Log <strong>Backup</strong>s).<br />

Whenever a modification is made to a database object (via Data Definition Language,<br />

DDL), or the data it contains (Data Manipulation Language, DML), the details of the<br />

change are recorded as a log record in the transaction log. Each log record contains<br />

24

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

Saved successfully!

Ooh no, something went wrong!