我有一个 sql 代理作业,它运行 Powershell 作为其第一步(总共有 3 个步骤)。
我已将此步骤设置为重试 2 次,重试间隔为 3 分钟。当我查看作业历史记录时,step_1 表明它仍在运行,并且已经完成。它在每次运行时(至少在去年)都这样做了。我在我的 powershell 中遗漏了什么吗?还是这与sql代理本身有关?
查询sysjobhistory
表的详细信息(管道分隔):
Step_name|step_id|run_date|run_time|run_duration|run_status
(Job outcome)|0|2014/02/12|01:20:00|5|Succeded
Record volume space to file|1|2014/02/12|01:20:00|2|In Progress
Record volume space to file|1|2014/02/12|01:20:00|2|Succeded
Load Volume Space|2|2014/02/12|01:20:02|1|Succeded
Record database data file space|3|2014/02/12|01:20:03|2|Succeded
Run Code Online (Sandbox Code Playgroud)
步骤 1 运行以下 Powershell:
gwmi win32_volume | select name, capacity, freespace | Export-Csv c:\temp.tmp
Run Code Online (Sandbox Code Playgroud)