---1.查看作業歷史記錄
SELECT TOP 1000 [instance_id]
,[job_id]
,[step_id]
, [step_name]
,[sql_message_id]
, [sql_severity]
,[message]
, [run_status]
,[run_date]
, [run_time]
,[run_duration]
, [operator_id_emailed]
,[operator_id_netsent]
,[operator_id_paged]
,[retries_attempted]
,[server]
FROM [msdb].[dbo].[sysjobhistory]
delete from [msdb].[dbo].[sysjobhistory]
---2.查看維護計劃日志
SELECT TOP 1000 [task_detail_id]
,[plan_id]
,[subplan_id]
,[start_time]
,[end_time]
,[succeeded]
,[logged_remotely]
,[source_server_name]
,[plan_name]
,[subplan_name]
FROM [msdb].[dbo].[sysmaintplan_log]
delete from [msdb].[dbo]. [sysmaintplan_log]
---3.查看維護計劃日志詳情
SELECT TOP 1000 [task_detail_id]
,[line1]
,[line2]
,[line3]
,[line4]
,[line5]
,[server_name]
, [start_time]
,[end_time]
, [error_number]
,[error_message]
, [command]
,[succeeded]
FROM [msdb].[dbo]. [sysmaintplan_logdetail]
delete from [msdb].[dbo]. [sysmaintplan_logdetail]
查看本欄目