Sql Server 代理错误日志知多少
一 概述 默认情况下,SQL Server 代理创建错误日志来记录警告和错误。日志中显示下列警告和错误: 警告消息,提供有关潜在问题的信息,例如作业 在执行时被删除。 错误消息,通常需要系统管理员干预,例如无法启动邮件会话。可以通过 net send 将错误消息发
一 概述
默认情况下,SQL Server 代理创建错误日志来记录警告和错误。日志中显示下列警告和错误:
警告消息,提供有关潜在问题的信息,例如“作业 在执行时被删除”。
错误消息,通常需要系统管理员干预,例如“无法启动邮件会话”。可以通过 net send 将错误消息发送给特定用户或计算机。
默认情况下,执行跟踪消息不写入 SQL Server代理日志错误,因为它们会将日志填满。如果错误日志已满,会降低选择和分析更严重的错误的能力。因为日志会增加服务器的处理负荷,所以请务必仔细考虑是否值得将执行跟踪消息捕获到错误日志中。通常,最好仅在调试某个特定问题时捕获所有消息。
二 错误日志的存放目录和个数
SQL Server 最多可以维护 1个当前错误日志记录 和 9个 SQL Server 代理错误日志历史记录。每个存档日志都有一个扩展名,指示该日志的相对存在时间。例如,扩展名 .1 表示最新的存档错误日志,而扩展名 .9 表示最旧的存档错误日志。
SQL Server 代理停止后,可以修改 SQL Server 代理错误日志的位置。如果错误日志为空,则无法打开日志。可以随时循环访问 SQL Server 代理日志,无需停止 SQL Server 代理。
三 基本管理任务
查看 SQL Server 代理错误日志 :企业管理器;通过openrowset读取文件;xp_cmdshell下执行dos输出的type命令等;xp_cmdshell下bcp进入数据库系统的表中;exec xp_cmdshell 'type "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGSQLAGENT.out"'
重命名 SQL Server 代理错误日志 ,重启sql代理后生效 :企业管理器;EXEC msdb.dbo.sp_set_sqlagent_properties @errorlog_file=N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGSQLAGENT.OUT'
发送 SQL Server 代理错误消息 ,使用net send 发送消息,依赖于windows的messenges 服务 :企业管理器;EXEC msdb.dbo.sp_set_sqlagent_properties @error_recipient=N'jinsen'
将执行跟踪消息写入到 SQL Server 代理错误日志中 :配置sql代理,记录跟踪内容;
配置代理错误日志的信息内容类型(错误 1、警告 2、信息(包含错误跟踪) 4),类型可以叠加:企业管理器;EXEC msdb.dbo.sp_set_sqlagent_properties @errorlogging_level={1|2|4|3|5|7|6}
配置代理错误日志的信息内容的编码类型 :企业管理器;EXEC msdb.dbo.sp_set_sqlagent_properties @oem_errorlog={0|1}
回收错误日志的空间 :使用企业管理器;EXEC msdb.dbo.sp_cycle_agent_errorlog
配置代理错误日志文件记录数的大小(行数):企业管理器;EXEC msdb.dbo.sp_set_sqlagent_properties @jobhistory_max_rows=1000,
配置代理错误日志文件记录每个作业的最大记录的大小(行数):企业管理器;EXEC msdb.dbo.sp_set_sqlagent_properties @jobhistory_max_rows_per_job=100
四 常见问题
q:为什么sql代理错误日志文件的内容始终为空,,无法进行错误信息的日志记录?
a:重新配置sql代理错误日志文件的编码格式为非oem——即配置为unicode编码,可以解决问题
q:为什么在使用企业管理器查看sql代理错误日志时,日志查看器出现异常,“unicode file expected”?
a:重新配置sql代理错误日志文件的编码格式为非oem——即配置为unicode编码,可以解决问题
q:为什么企业管理器、sms 无法回收sql2000的sql代理错误日志文件?
a:sqlserver2000的sql 代理错误日志的文件 不支持回收!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



If you encounter an error message when using your printer, such as the operation could not be completed (error 0x00000771), it may be because the printer has been disconnected. In this case, you can solve the problem through the following methods. In this article, we will discuss how to fix this issue on Windows 11/10 PC. The entire error message says: The operation could not be completed (error 0x0000771). The specified printer has been deleted. Fix 0x00000771 Printer Error on Windows PC To fix Printer Error the operation could not be completed (Error 0x0000771), the specified printer has been deleted on Windows 11/10 PC, follow this solution: Restart Print Spool

Table of Contents Solution 1 Solution 21. Delete the temporary files of Windows update 2. Repair damaged system files 3. View and modify registry entries 4. Turn off the network card IPv6 5. Run the WindowsUpdateTroubleshooter tool to repair 6. Turn off the firewall and other related anti-virus software. 7. Close the WidowsUpdate service. Solution 3 Solution 4 "0x8024401c" error occurs during Windows update on Huawei computers Symptom Problem Cause Solution Still not solved? Recently, the web server needs to be updated due to system vulnerabilities. After logging in to the server, the update prompts error code 0x8024401c. Solution 1

Title: Analysis of Oracle Error 3114: Causes and Solutions When using Oracle database, you often encounter various error codes, among which error 3114 is a relatively common one. This error generally involves database link problems, which may cause exceptions when accessing the database. This article will interpret Oracle error 3114, discuss its causes, and give specific methods to solve the error and related code examples. 1. Definition of error 3114 Oracle error 3114 pass

The display error is a problem that may occur in the Xiangxiang Fuzhai app. Some users are not sure why the Xiangxiang Fuzhai app displays errors. It may be due to network connection problems, too many background programs, incorrect registration information, etc. Next, This is the editor’s introduction to how to solve app display errors for users. Interested users should come and take a look! Why does the Xiangxiang Fuzhai app display an error answer: network connection problem, too many background programs, incorrect registration information, etc. Details: 1. [Network problem] Solution: Check the device connection network status, reconnect or choose another network connection to use. Can. 2. [Too many background programs] Solution: Close other running programs and release the system, which can speed up the running of the software. 3. [Incorrect registration information

LinuxOops: Detailed explanation of the meaning of this error, need specific code examples What is LinuxOops? In Linux systems, "Oops" refers to a situation where a serious error in the kernel causes the system to crash. Oops is actually a kernel crash mechanism that stops the system when a fatal error occurs and prints out relevant error information so that developers can diagnose and fix the problem. Oops usually occur in kernel space and have nothing to do with user space applications. When the kernel encounters

WindowsServerBackup is a function that comes with the WindowsServer operating system, designed to help users protect important data and system configurations, and provide complete backup and recovery solutions for small, medium and enterprise-level enterprises. Only users running Server2022 and higher can use this feature. In this article, we will explain how to install, uninstall or reset WindowsServerBackup. How to Reset Windows Server Backup If you are experiencing problems with your server backup, the backup is taking too long, or you are unable to access stored files, then you may consider resetting your Windows Server backup settings. To reset Windows
![Streaming server throws error [FIXED]](https://img.php.cn/upload/article/000/465/014/171133083740341.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
Are you getting a streaming server throwing an error on your computer? Stremio is a cross-platform video streaming service that you can use to stream and watch movies, TV shows, live TV, and more. Some users have reported getting this error when trying to launch the application. Errors can occur under a variety of circumstances, including Internet and server issues. This error may also be encountered when using the web version of Stremio. Interference from antivirus software or firewalls can also cause errors to occur. Whatever the case, you can fix the problem with this guide. Streaming Server Throws Error While running Stremio application on Windows, you may encounter “Stremio Streaming Server threw error

In Linux systems, you can use the following command to view the contents of the log file: tail command: The tail command is used to display the content at the end of the log file. It is a common command to view the latest log information. tail [option] [file name] Commonly used options include: -n: Specify the number of lines to be displayed, the default is 10 lines. -f: Monitor the file content in real time and automatically display the new content when the file is updated. Example: tail-n20logfile.txt#Display the last 20 lines of the logfile.txt file tail-flogfile.txt#Monitor the updated content of the logfile.txt file in real time head command: The head command is used to display the beginning of the log file
