--by chance, in the book, test
--Empty the backup record (execute a command on the line) and execute it in the test library. ~ use
msdb;
exec sp_delete_backuphistory ' 2014-10-27 ';
exec sp_delete_database_backuphistory ' TEST ';
--Note: Backup
DATABASE TEST to
DISK = ' E:\TEST2014 ' full-variance-log backup with the same name. BAK ' with
init,description = ' full backup '
backup DATABASE TEST to
DISK = ' E:\TEST2014. BAK ' with
differential,description = ' DIFF backup '
backup LOG TEST to
DISK = ' E:\TEST2014. BAK '
with DESCRIPTION = ' LOG BACKUP '-
-can be viewed, [TEST2014. BAK] is an external backup set.
SELECT * FROM msdb.dbo.backupmediafamily
SELECT *-msdb.dbo.backupmediaset
Select position, * from msdb.dbo.backupset--position Specifies the file order
RESTORE DATABASE TEST from
DISK = ' E:\TEST2014. BAK ' with
FILE = 1, NORECOVERY, REPLACE
RESTORE DATABASE TEST from
DISK = ' E:\TEST2014. BAK ' with
FILE = 2, NORECOVERY
--skips the previous differential direct restore log, restores the most recent variance by default, and this log
restore DATABASE TEST from
DISK = ' E:\TEST2014. BAK '
with FILE = 3, RECOVERY
When you restore a database from the interface, select what the source database can look at:
-- When the backup record is emptied out of the source database, only the backup set is found from the source device;-- you can see that previous backup of the same name is in the same set;
-- when you add a full backup, Noformat, Noinit does not work, so there can be only one full backup;