Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

578


Part V: Enterprise Data Management


BACKUP LOG successfully processed 1 pages in 0.082 seconds (0.005
MB/sec).

Continuing:

SELECT * FROM T1;

Result:

PK Name
----------- ---------------
1 Full
2 Log 1
3 Log 2

(3 row(s) affected)

At this point the server is hit with a direct bolt of lightning, and all drives are fried, with
the exception of the backup fi les. The following recovery operation goes through the full
backup and the two transaction-log backups. Notice the NORECOVERY and RECOVERY
options:

-- NOW PERFORM THE RESTORE
Use Master;
RESTORE DATABASE Plan2Recover
FROM DISK = 'e:\P2R.bak'
With FILE = 1, NORECOVERY;

Result:

Processed 168 pages for database 'Plan2Recover', file 'Plan2Recover'
on file 1.
Processed 6 pages for database 'Plan2Recover', file 'Plan2Recover_
log' on file 1.
RESTORE DATABASE successfully processed 174 pages in 0.168 seconds
(8.050 MB/sec).

Continuing:

RESTORE LOG Plan2Recover
FROM DISK = 'e:\P2R.bak'
With FILE = 2, NORECOVERY;

Result:

Processed 0 pages for database 'Plan2Recover', file 'Plan2Recover' on
file 2.
Processed 6 pages for database 'Plan2Recover', file 'Plan2Recover_
log' on file 2.
RESTORE LOG successfully processed 6 pages in 0.028 seconds (1.586
MB/sec).

c21.indd 578c21.indd 578 7/31/2012 9:22:54 AM7/31/2012 9:22:54 AM


http://www.it-ebooks.info
Free download pdf