Manage SQL Server Agent Flashcards

1
Q

How do you see what jobs are running and what the finished status was of ones that have completed?

A

Job Activity Monitor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the system table to get Job Information?

A

use [msdb]
go
SELECT * FROM SYSJOBS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What system table is used for the Job Setup (Including actions that it will take?)

A

SYSJOBSTEPS

USE [MSDB]
GO
SELECT * FROM SYSJOBSTEPS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What system table is used to see information about job time run from beginning to end?

A

SYSSESSIONS
SYSJOBACTIVITY
SYSJOBHISTORY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the system table that shows the schedules and types?

A

SYSSCHEDULES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax for RAISERROR?

A

RAISERROR(ID, SEVERITY, STATE) –STATE = 1 usually

For custom errors, you need to add a line to sys.messages using EXEC sp_addmessage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you get an alert to run when RAISERROR has happened?

A

Use WITH LOG in the RAISERROR command:

RAISERROR(50001, 16, 1) WITH LOG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the steps to be able to send an email from an alert or job?

A

Configure database mail from Management->Database Mail
Create a new Operator (Agent->Operators->New Operator)
Go into the alerts or jobs and set the operator as a receiver of emails

How well did you know this?
1
Not at all
2
3
4
5
Perfectly