zoukankan      html  css  js  c++  java
  • SQL SERVER-数据库备份及记录

    --完整备份
    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
  • 相关阅读:
    OS-lab4
    OS-lab3
    OS-lab2
    OS-lab1
    OO第四单元总结
    OO第三单元总结
    OO第二单元总结
    HTTP_POST
    实习日志1(2020.7.27-2020.9.31)
    Web app ------ 从Servlet读取Json数据并显示,生成历史数据曲线图
  • 原文地址:https://www.cnblogs.com/JinweiChang/p/10873482.html
Copyright © 2011-2022 走看看