zoukankan      html  css  js  c++  java
  • 创建错误日志循环

      Whenever SQL Server is restarted, it creates a new error log. If theserver stays up for a while, this can make for a very large error log. I create a job that runs on a daily or weekly basis that executes the sp_cycle_errorlog stored procedure in the master database. This will create a new error log without having to restart SQL Server.

      

    sp_cycle_errorlog

    关闭当前的错误日志文件,并循环错误日志扩展编号(就像重新启动服务器)。新错误日志包含版本和版权信息,以及表明新日志已创建的一行。


    注释
    每次启动 SQL Server 时,都会将当前错误日志重命名为 errorlog.
    1;errorlog.1 变为 errorlog.2,errorlog.2 变为 errorlog.3,依次类推。sp_cycle_errorlog 可使您循环访问错误日志文件,而不必停止和启动服务器。

    权限
    sp_cycle_errorlog 的执行许可权限仅限于 sysadmin 固定服务器角色的成员。

    示例
    以下示例将循环 SQL Server 错误日志。

    复制代码
    EXEC sp_cycle_errorlog ;
    GO

      

  • 相关阅读:
    【翻译】让你的网站飞起来
    理解ASP.NET MVC中的模型绑定
    【转载】创建定制ASP.NET MVC视图引擎
    修改STM32主频
    Cortex系列ARM核心及体系结构介绍
    递归
    NFD模拟兴趣包的转发
    NX 笔记
    MicroPython 8266 配置
    Python JSON操作
  • 原文地址:https://www.cnblogs.com/Amaranthus/p/1999500.html
Copyright © 2011-2022 走看看