如何让Log shipping成功的备份信息不出现在SQL Server error log
配置了SQL Server 日志传送后,因为备份的数据库比较多而且时间频繁所以造成SQL Server日志非常大。如下图:由于我们已经有了Log shipping的监控,所以这些备份信息对于我们来说基本上没什么用处。 那有没有办法使这些信息部出现在数据库错误日志中呢? 答案是 Trace Flag3226
下面内容来自MSDN:
3226
By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log. If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic.
With this trace flag, you can suppress these log entries. This is useful if you are running frequent log backups and if none of your scripts depend on those entries.
在我的数据库服务器上启用Trace flag3226,错误日志中成功的备份信息不再显示:
dbcc traceon(3226,-1)
go
backup database DBAtodisk='d:\mssql\dba.bak'---执行三次完整备份
go 3
backup log DBAtodisk='d:\mssql\dba_log.trn'--执行四次日志备份
go 4
sp_readerrorlog--查看SQL Server错误日志
也可以在启动参数中添加:
-T 3226
如果只想影响当前的会话使用下面的命令:
DBCC TRACEON(3226)
不懂 不错不错,楼主您辛苦了。。。 自从我变成了狗屎,就再也没有人踩在我头上了。 长大了娶唐僧做老公,能玩就玩一玩,不能玩就把他吃掉。 如果没有毛片,中国的性教育简直就是一片空白! 月经不仅仅是女人的痛苦,也是男人的痛苦。
页:
[1]