简体   繁体   English

SQL Server代理作业监视(作业是否开始了?)

[英]SQL Server Agent Job Monitoring (did a Job even start?)

I am a BI developer and was entrusted with a task of a DBA. 我是一名BI开发人员,并被委派了DBA的任务。 It's about monitoring SQL Server Agent jobs respectively getting information about the following key figures, which are to be prepared after all frontend: 这是关于分别监视SQL Server代理作业以获取有关以下关键指标的信息,这些指标将在所有前端之后准备:

  1. Failed Server Agent Jobs and Jobsteps 服务器代理作业和作业步骤失败
  2. Run-time of jobs and Jobsteps 作业的运行时间和作业步骤
  3. Find out if a job has even started 找出工作是否已经开始
  4. Memory allocation: evaluation and monitoring of the moving and stored data volumes 内存分配:评估和监视移动和存储的数据量

The goal is to monitor and, if necessary, provide an indication of any discrepancies in the key figures. 目的是监视并在必要时指出关键数据中的任何差异。

I got the first two points. 我得到了前两点。 In each case I show in a table whether a job or whether steps are enabled/disabled. 在每种情况下,我都在表中显示是否作业或步骤是否启用/禁用。 I have also recorded the terms of each step and thresholds can be used to warn if critical ranges are reached. 我还记录了每个步骤的术语,可以使用阈值来警告是否达到临界范围。

The biggest problems for me are the jobs that did not even start (Point 3.). 对我来说最大的问题是什至没有开始的工作(第3点)。 To my knowledge, these are not recorded in the MSDB tables. 据我所知,这些没有记录在MSDB表中。 I would like to know when a job or jobstep has not even started. 我想知道什么时候工作或工作步骤还没有开始。 Can you tell me how to get this info? 您能告诉我如何获取此信息吗? Maybe someone already has a suitable script for this problem ready? 也许有人已经准备好适合该问题的脚本?

On the subject of memory usage, I'm interested in how much free space is left on the hard disk, how big the partition is and how the consumption changes over time. 在内存使用方面,我对硬盘上剩余多少可用空间,分区有多大以及消耗随时间的变化感兴趣。

On the internet, I could find nothing to the points 3rd and 4th. 在互联网上,我找不到第三和第四点。 I would be very grateful for your help! 我将非常感谢您的帮助! (and forgive me my bad english :) ) (原谅我我的英语不好:)

I get as a result, when the next run of Job xy is planned. 结果,当计划下次运行Job xy时。 He does not appear in the table. 他没有出现在表格中。 However, he appears on the SQL Server Agent in the job history. 但是,他出现在作业历史记录的SQL Server代理中。 There, however, the information is missing when he should run the next time. 但是,在他下次运行时,该信息丢失了。 My plan was to take the next_scheduled_run_date column from the sysjobactivity table and then compare a run later to the run_requested_Date column. 我的计划是从sysjobactivity表中获取next_scheduled_run_date列,然后将稍后的运行与run_requested_Date列进行比较。 But obviously some records are missing in the sysjobactivity table. 但是很显然,sysjobactivity表中缺少一些记录。 The other table, which otherwise contains target_start times, is the sysjobschedules. 另一个包含target_start时间的表是sysjobschedules。 Unfortunately, this only has the currently scheduled date. 不幸的是,这只有当前的计划日期。 I have not found another table that contains a history of the target run_dates. 我还没有找到另一个包含目标run_dates历史的表。 Of course, one could have manual tables (analogous to the target values) but that would be too much effort. 当然,可以有一个手动表(类似于目标值),但这会花费很多精力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM