SQLSERVER errorlog讲解 很多时候诊断SQLSERVER问题都需要看SQLSERVER的错误日志 日志里面很多内容没有书本专门讲解,今天我就讲一下,可能里面的日志信息是从我个人的机器 里抓出来的,跟大家的机器环境会有所不同,但是SQLSERVER启动部分的日志大家都是一
SQLSERVER errorlog讲解
很多时候诊断SQLSERVER问题都需要看SQLSERVER的错误日志
日志里面很多内容没有书本专门讲解,今天我就讲一下,可能里面的日志信息是从我个人的机器
里抓出来的,跟大家的机器环境会有所不同,但是SQLSERVER启动部分的日志大家都是一样的
特别的说一下:2013-02-12 17:53:29.29 spid29s
这些spid指的是SQLSERVER内部的进程,因为SQLSERVER内部有SQL OS,所以称呼他自己内部的线程为“进程”
所以在Windows的任务管理器里是看不到这些“进程ID的”的,这些进程ID也会跟会话关联的,例如你在
SSMS里新建一个查询,SQLSERVER就会新建一个会话ID(SPID),这些“进程”可以kill的
<span>1</span> <span>KILL</span> spid <span>--</span><span>相应的spid</span>
相当于在cmd下运行:TASKKILL notepad.exe(进程ID)
不过这些kill命令是发给SQLSERVER去执行
在启动的时候,SQLSERVER会创建很多线程来进行初始化数据库或者其他工作,所以会看到下面的,但是spid会不同
2013-02-12 17:53:29.29 spid29s
开头:
<span>1</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server Microsoft SQL Server <span>2005</span> <span>-</span> <span>9.00</span>.<span>5069.00</span><span> (Intel X86) </span><span>2</span> Aug <span>22</span> <span>2012</span> <span>16</span>:<span>01</span>:<span>52</span> <span>3</span> Co<div>本文来源gaodai^.ma#com搞#代!码网</div>pyright (c) <span>1988</span><span>-</span><span>2005</span><span> Microsoft Corporation</span><span>4</span> Developer Edition <span>on</span> Windows NT <span>6.1</span> (Build <span>7601</span>: Service Pack <span>1</span><span>)</span><span>5</span> <span>6</span> <span>--</span><span>启动信息,记录了你当前机器的SQL版本 和操作系统版本 SP补丁版本</span>
<span>1</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server (c) <span>2005</span><span> Microsoft Corporation.</span><span>2</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server <span>All</span><span> rights reserved.</span><span>3</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server Server process ID <span>is</span> <span>5164</span><span>.</span><span>4</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server Authentication mode <span>is</span><span> MIXED.</span><span>5</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server Logging SQL Server messages <span>in</span> <span>file</span> <span>'</span><span>C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG</span><span>'</span><span>.</span><span>6</span> <span>2013</span><span>-</span><span>02</span><span>-</span><span>12</span> <span>17</span>:<span>53</span>:<span>22.26</span> Server This instance <span>of</span> SQL Server last reported using a process ID <span>of</span> <span>3756</span> at <span>2013</span><span>/</span><span>2</span><span>/</span><span>12</span> <span>15</span>:<span>38</span>:<span>30</span> (local) <span>2013</span><span>/</span><span>2</span><span>/</span><span>12</span> <span>7</span>:<span>38</span>:<span>30</span> (UTC). This <span>is</span> an informational message <span>only</span>; no <span>user</span> action <span>is</span><span> required.</span><span>7</span> <span>--</span><span>SQL进程ID是5164 登录SQLSERVER的验证模式是:混合模式</span><span>8</span> <span>--</span><span>errorlog存放的目录是:你懂的</span><span>9</span> <span>--</span><span>上次启动SQLSERVER使用的进程ID是3756</span>