zoukankan      html  css  js  c++  java
  • 数据库备份和收缩日志作业。

    --备份数据库
    declare @db_filename nvarchar(100)
    declare @filename nvarchar(100)
    set @db_filename='E:\DB_bak62\AOSmith_MSCRM62_'+convert(char(8),getdate(),112) + '.bak'
    set @filename=N'AOSmith_MSCRM62_'+convert(char(8),getdate(),112)
    backup database [AOSmith_MSCRM] to disk=@db_filename
    WITH NOFORMAT, NOINIT ,NAME =@filename,SKIP, REWIND, NOUNLOAD, COMPRESSION, STATS = 10

    --(备份事务日志)
    declare @log_filename nvarchar(100)
    declare @filename nvarchar(100)
    set @log_filename='E:\DB_bak62\AOSmith_MSCRM62_log_'+convert(char(8),getdate(),112) + '.bak'
    set @filename=N'AOSmith_MSCRM62_log_'+convert(char(8),getdate(),112)
    backup log [AOSmith_MSCRM] to disk=@log_filename
    WITH NOFORMAT, NOINIT ,NAME =@filename,SKIP, REWIND, NOUNLOAD, COMPRESSION, STATS = 10


    -- 收缩日志到50个G
    dbcc shrinkfile(mscrm_log,50000)

  • 相关阅读:
    Gym
    HDU
    HDU
    POJ
    洛谷P3690 Link Cut Tree (动态树)
    Gym
    P4294 [WC2008]游览计划 (斯坦纳树)
    洛谷P3264 [JLOI2015]管道连接 (斯坦纳树)
    HDU
    Controller调试接口
  • 原文地址:https://www.cnblogs.com/guozh-bk/p/10135325.html
Copyright © 2011-2022 走看看