Which three Transact-SQL segments should you use to develop the solution?

Posted by: Pdfprep Category: 70-764 Tags: , ,

DRAG DROP

You have a database named DB1. You complete a full backup on January1, 2018 to a backup set named DB1_Backup. You create a differential backup January 2, 2018 to the same backup set. You perform transaction log backups each day at 1:00 PM.

DB1 experiences a catastrophic failure.

You need to restore the database to January 3, 2018 at 11:00 AM.

Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segment from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

Answer:

Explanation:

This example restores a database, differential database, and transaction log backup of the MyAdvWorks database.

Step 1:

— 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

Step 2:

— 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;

Step 3:

— 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

References: https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/restore-a-differential-database-backup-sql-server

Leave a Reply

Your email address will not be published.