Share via


방법: 차등 데이터베이스 백업 복원(Transact-SQL)

이 항목에서는 차등 데이터베이스 백업을 복원하는 방법을 설명합니다.

차등 데이터베이스 백업을 복원하려면

  1. NORECOVERY 절을 지정하고 RESTORE DATABASE 문을 실행하여 차등 데이터베이스 백업에 앞서 전체 데이터베이스 백업을 복원합니다. 자세한 내용은 방법: 전체 백업 복원을 참조하십시오.

  2. RESTORE DATABASE 문을 실행하여 차등 데이터베이스 백업을 복원합니다. 이때 다음을 지정합니다.

    • 차등 데이터베이스 백업이 적용될 데이터베이스의 이름
    • 차등 데이터베이스 백업을 복원하는 백업 장치
    • 차등 데이터베이스 백업이 복원된 후 적용할 트랜잭션 로그 백업이 있을 경우 NORECOVERY 절, 그렇지 않으면 RECOVERY 절
  3. 전체 복구 모델이나 대량 로그 복구 모델을 사용할 경우 차등 데이터베이스 백업을 복원하면 차등 데이터베이스 백업이 완료된 시점까지 데이터베이스가 복원됩니다. 오류 지점까지 복구하려면 마지막 차등 데이터베이스 백업이 생성된 후에 만든 트랜잭션 로그 백업을 모두 적용해야 합니다. 자세한 내용은 방법: 트랜잭션 로그 백업 적용(Transact-SQL)을 참조하십시오.

1. 데이터베이스 및 차등 데이터베이스 백업 복원

다음은 MyAdvWorks 데이터베이스의 데이터베이스 및 차등 데이터베이스 백업을 복원하는 예입니다.

-- Assume the database is lost, and restore full database, 
-- specifying the original full database backup and NORECOVERY, 
-- which allows subsequent restore operations to proceed.
RESTORE DATABASE MyAdvWorks
   FROM MyAdvWorks_1
   WITH NORECOVERY
GO
-- Now restore the differential database backup, the second backup on 
-- the MyAdvWorks_1 backup device.
RESTORE DATABASE MyAdvWorks
   FROM MyAdvWorks_1
   WITH FILE = 2,
   RECOVERY
GO
2. 데이터베이스, 차등 데이터베이스, 트랜잭션 로그 백업 복원

다음은 MyAdvWorks 데이터베이스의 데이터베이스, 차등 데이터베이스, 트랜잭션 로그 백업을 복원하는 예제입니다.

-- Assume the database is lost at this point. Now restore the full 
-- database. Specify the original full database backup and NORECOVERY.
-- NORECOVERY allows subsequent restore operations to proceed.
RESTORE DATABASE MyAdvWorks
   FROM MyAdvWorks_1
   WITH NORECOVERY
GO
-- Now restore the differential database backup, the second backup on 
-- the MyAdvWorks_1 backup device.
RESTORE DATABASE MyAdvWorks
   FROM MyAdvWorks_1
   WITH FILE = 2,
   NORECOVERY
GO
-- Now restore each transaction log backup created after
-- the differential database backup.
RESTORE LOG MyAdvWorks
   FROM MyAdvWorks_log1
   WITH NORECOVERY
GO
RESTORE LOG MyAdvWorks
   FROM MyAdvWorks_log2
   WITH RECOVERY
GO

참고 항목

작업

방법: 차등 데이터베이스 백업 만들기(Transact-SQL)

개념

차등 데이터베이스 백업
SQL Server의 백업 및 복원 성능 최적화

관련 자료

RESTORE(Transact-SQL)
SQL Server Management Studio 자습서

도움말 및 정보

SQL Server 2005 지원 받기