DECLARE @CurrentTime VARCHAR(50), @FileName VARCHAR(200),@FileName2 VARCHAR(200) ,@FileName3 VARCHAR(200),@FileName4 VARCHAR(200),@FileName5 VARCHAR(200) SET @CurrentTime = REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR, GETDATE(), 120 ),'-','_'),' ','_'),':','') --(Temp2 数据库完整备份) SET @FileName = 'F:Temp2_FullBackup_Partial1_' + @CurrentTime+'.bak' SET @FileName2 = 'F:Temp2_FullBackup_Partial2_' + @CurrentTime+'.bak' SET @FileName3 = 'F:Temp2_FullBackup_Partial3_' + @CurrentTime+'.bak' SET @FileName4 = 'F:Temp2_FullBackup_Partial4_' + @CurrentTime+'.bak' SET @FileName5 = 'F:Temp2_FullBackup_Partial5_' + @CurrentTime+'.bak' BACKUP DATABASE [gongwuyuan] TO DISK=@FileName, DISK=@FileName2, DISK=@FileName3, DISK=@FileName4, DISK=@FileName5 WITH FORMAT
将数据库备份为几份便就分成几个数据组。盘符可指定为任意盘符,还原数据库时候,将所有备份文件一次性添加到备份位置下,如下图