--完整备份 BACKUP DATABASE JINWEI TO DISK='D:BAKJINWEIFULL.bak' --日志备份 BACKUP LOG JINWEI TO DISK='D:BAKJINWEILOG.bak' --差异备份 BACKUP DATABASE JINWEI TO DISK='D:BAKJINWEIDIFF.bak' WITH DIFFERENTIAL
--备份数据库并压缩
backup database 数据库名称 to disk='备份的路径和文件名' with stats=1,compression
--查看备份记录 --type D:数据库备份 I;差异备份 L:日志备份 F:文件备份 SELECT DISTINCT S.FIRST_LSN,S.LAST_LSN,S.DATABASE_BACKUP_LSN,s.backup_finish_date,s.type,y.physical_device_name FROM msdb..backupset AS S INNER JOIN msdb..backupfile AS f ON f.backup_set_id=s.backup_set_id INNER JOIN msdb..backupmediaset AS m ON S.media_set_id=M.media_set_id INNER JOIN msdb..backupmediafamily AS y ON m.media_set_id=y.media_set_id WHERE (s.database_name='JINWEI') ORDER BY s.backup_finish_date DESC