本例创建了一个数据库和日志的完整备份。将数据库备份到称为 MyNwind_2 的逻辑备份设备上,然后将日志备份到称为 MyNwindLog1 的逻辑备份设备上。 说明 创建逻辑备份设备需要一次完成。 -- Create the backup device for the full MyNwind backup. USE master EXEC sp_addumpdevice 'disk', 'MyNwind_2', 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_2.dat'--Create the log backup device. USE master EXEC sp_addumpdevice 'disk', 'MyNwindLog1', 'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwindLog1.dat'-- Back up the full MyNwind database. BACKUP DATABASE MyNwind TO MyNwind_2-- Update activity has occurred since the full database backup.-- Back up the log of the MyNwind database. BACKUP LOG MyNwind TO MyNwindLog1
-- Create the backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_2',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_2.dat'--Create the log backup device.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwindLog1',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwindLog1.dat'-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_2-- Update activity has occurred since the full database backup.-- Back up the log of the MyNwind database.
BACKUP LOG MyNwind
TO MyNwindLog1