목차

Lesson 1: Planning a Backup Strategy

SQL Server Backup Types

Backup Type Description
Full 모든 데이터 파일과 트랜잭션 로그의 일부분을 백업한다.
Transaction log 로그 파일에 기록된 데이터베이스 변화들을 백업한다.
Tail-log 로그의 활성부분(active portion)을 백업한다.
Differential The parts of the database that have changed since the last full database backup
File/Filegroup Specified files or filegroups
Partial The primary filegroup, every read/write filegroup, and any specified read-only filegroups
Copy-only The database or log (without affecting the backup sequence)

What Are Recovery Models?

Recovery Model Description
Simple Uses full or differential copies of the database. Truncates the transaction logs.
Full Includes both database backups and transaction log backups.
Bulk-logged Includes both database and transaction log backups, but uses less log space for some operations.

What Is a Full Database Backup Strategy?

What Is a Database and Transaction Log Backup Strategy?

What Is a Differential Bakcup Strategy?

What Is a File of Filegroup Backup Strategy?

Considerations for Backup Operators

Considerations for Backup Media

Lesson 2: Backing Up User Databases

How to Perform a Full Database Backup

How to Perform a Transaction Log Backup

How to Perform a Differential Backup

How to Perform File and Filegroup Backups

Options for Ensuring Backup Integrity

Lesson 3: Restoring User Databases

How the Restore Process Works

How to Restore a Database

How to Restore a Transaction Log

Lesson 4: Performing Online Restore Operations

Overview of Online Restore Operations

                              Database
                       +--------------------+
Primary filegroup      |      Primary       |
online, database     -------> Filegrup      |
available              |                    |
                       |                    |
                       |                    |
File unavailable,    -------> Filegroup A   |<------- Restoring file [백업장치(테이프,디스크)]
filegroup offline      |                    |
                       |                    |
                       |                    |
All files available, -------> Filegroup B   |
filegroup online       |                    |
                       +--------------------+

How to Restore a Damaged Page

  1. Identify ID of damaged page
  2. Restore page from a full or differential backup
    Use PAGE clause to specify pages to restore
    Specify NORECOVERY
    RESTORE DATABASE AdventureWorks
    PAGE = '1:610'
    FROM AWBack
    WITH NORECOVERY
  3. Restore transaction logs
  4. Backup transaction log tail
  5. Restore transaction log tail

How to Restore a File

  1. Restore damaged file from a full or differential backup
    Use FILE clause to specify file to restore
    Specify NORECOVERY
    RESTORE DATABASE AdventureWorks
    FILE = AW2
    FROM AWBack
    WITH NORECOVERY
  2. Backup transaction log tail
    Specify COPY_ONLY
  3. Restore transaction logs
  4. Restore transaction log tail

How to Restore a Filegroup

  1. Backup transaction log tail
    Specify NORECOVERY
  2. Restore filegroup from a full or differentail backup
    Use FILEGROUP clause to specity filegroup to restore
    Specify PARTIAL and NORECOVERY
    RESTORE DATABASE AdventureWorks
    FILEGROUP = 'DYNAMIC_DATA'
    FROM AWBackDynamic
    WITH PARTIAL, NORECOVERY
  3. Restore transaction logs
  4. Restore transaction log tail

How to Perform a Piecemeal Restore

Lesson 5: Recovering Data from Database Snapshots

What Is a Database Snapshot?

How Database Snapshots Work

           Source DB                     Snapshot DB
           +--------+                    +--------+
           |  +--+  |                    |        |
           |  |  | <--------------------------------- SELECT...
           |  +--+  |                    |        |
           |        |   Copy-On-Write    |        |
           |  +--+  | (first time only)  |  +--+  |
UPDATE... --> |  | - - - - - - - - - - - -> |  | <--- SELECT...
           |  +--+  |                    |  +--+  |
           +--------+                    +--------+

How Data Can Be Recovered from a Database Snapshot

Undelete a row Insert original data from snapshot
Undo an update Get original values from snapshot
Recover a dropped object Generate script from snapshot, then copy data
Revert to snapshot Restore database from snapshot

Lesson 6: System Databases and Disaster Recovery

Considerations for Backing Up System Databases

Considerations for Restoring System Databases

How to Restore the master Database