Sql Server 日志 和 代理错误日一般在实例重新启动后自己主动切换,假设实例久未重新启动,将可能积累太多的日志,不方便查看.
查看错误日志大小:
--查看日志大小
EXEC xp_enumerrorlogs --sqlserver错误日志
EXEC xp_enumerrorlogs 1 --sqlserver错误日志
EXEC xp_enumerrorlogs 2 --代理日志
日志切换:创建一个新的日志文件,并将最老的日志删除
-- "Sql Server 日志"切换
exec msdb.dbo.sp_cycle_errorlog
-- "代理错误日志"切换
exec msdb.dbo.sp_cycle_agent_errorlog
日志查看: