Manage SQL Server Agent
Manage SQL Server Agent
Introduction
Create, Maintain, and Monitor Jobs
Automate (Setup, Maintenance, Monitoring) Across Multiple Databases
and Multiple Instances
Summary
Introduction
The Manage SQL Server Agent module provides you with the instruction and server
hardware to develop your hands on skills in the defined topics. This module includes the
following exercises:
Lab Diagram
During your session you will have access to the following lab configuration. Depending
on the exercises you may or may not use all of the devices, but they are shown here in the
layout to get an overall understanding of the topology of the lab.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 1/82
7/23/2019 Print content
In this module you will be working on the following equipment to carry out the steps
defined in each exercise.
To start, simply choose a device and click Power on. In some cases, the devices may
power on automatically.
For further information and technical support, please see our Help and Support
page.
Copyright Notice
This document and its content is copyright of Practice-IT - © Practice-IT 2014. All rights reserved. Any
redistribution or reproduction of part or all of the contents in any form is prohibited other than the
following:
1) You may print or download to a local hard disk extracts for your personal and non-commercial use
only.
2) You may copy the content to individual third parties for their personal use, but only if you
acknowledge the website as the source of the material. You may not, except with our express written
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 2/82
7/23/2019 Print content
permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any
other website or other form of electronic retrieval system.
To get a better understanding of this technology, please refer to your course material or
use your preferred search engine to research this topic in more detail.
Step 1
Ensure you have powered on the required devices and Connect to PLABSQL01.
On the Connect to Server dialog box, enter PLABSQL01 in the Server name text
box, if already not entered, and click Connect.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 3/82
7/23/2019 Print content
Step 2
After the connection is successful, the PLABSQL01 server is displayed in Object
Explorer.
Check if SQL Server Agent is running. If not, right-click and then select Start.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 4/82
7/23/2019 Print content
Step 3
The Microsoft SQL Server Management Studio message dialog is displayed.
Click Yes.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 5/82
7/23/2019 Print content
Step 4
Please wait while SQL Server Agent is being started.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 6/82
7/23/2019 Print content
Step 5
After SQL Server Agent starts, right-click and select New and then select Job.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 7/82
7/23/2019 Print content
Step 6
The New Job dialog box is displayed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 8/82
7/23/2019 Print content
Step 7
In the left pane, click Steps to create the jobs
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 9/82
7/23/2019 Print content
Step 8
On the New Job Step dialog box, on the Step name box, type:
Task 1
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 10/82
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 11/82
7/23/2019 Print content
Step 9
Back on the New Job dialogue box, click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 12/82
7/23/2019 Print content
Note: If you receive a warning message regarding the action of this step, please
click Yes to accept.
Step 10
You are redirected back to the SQL Server Management Studio.
Step 1
On PLABSQL01, while SQL Server Management Studio is open, expand SQL
Server Agent in the left pane.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 13/82
7/23/2019 Print content
Expand the Jobs node and notice that SELECT TOP 1000 which you created earlier is
now available.
Step 2
Double-click Job Activity Monitor.
The Job Activity Monitor - PLABSQL01 window is now displayed. This window
displays the job activity.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 14/82
7/23/2019 Print content
Step 3
You can also work with individual jobs and maintain them as and when required.
To do this, in the left pane, right-click SELECT TOP 1000 and select Start Job at
Step.
Note: Since the job only has one step it will execute without prompting for which
step must be executed
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 15/82
7/23/2019 Print content
Step 4
The Start Jobs - PLABSQL01 dialog box is displayed.
Click Close.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 16/82
7/23/2019 Print content
Step 1
On PLABSQL01 server, while the Microsoft SQL Server Management Studio is
running, under SQL Server Agent node, click Alerts.
Note that there is no alert defined. You will need to first define an alert.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 17/82
7/23/2019 Print content
Step 2
The New Alert dialog box is displayed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 18/82
7/23/2019 Print content
Step 3
Select Response in the left pane of the dialog box.
Select Execute job and then select SELECT TOP 1000 (Data Collector).
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 19/82
7/23/2019 Print content
Step 4
Select Options in the left pane.
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 20/82
7/23/2019 Print content
Step 5
Note that the SELECT TOP 1000 alert is created under the Alerts node in the left
pane.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 21/82
7/23/2019 Print content
Step 6
To administer a job, first expand the Jobs node under SQL Server Agent in the left
pane of the Microsoft SQL Server Management Studio.
You can perform other actions also, such as Start Job at Step, Script Job as, or
Disable. You can also Rename or Delete. If you need to modify the selected job,
choose Properties.
Note: Please do not carry the commands indicated above. This is to just show you
the different options available.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 22/82
7/23/2019 Print content
Step 7
Similarly, you can perform the same actions on the alerts. Right-click SELECT TOP
1000 to get similar options, like the options you received for Jobs.
Note: Please do not carry the commands indicated above. This is to just show you
the different options available.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 23/82
7/23/2019 Print content
Leave the devices you have powered on in their current state and proceed to the next
exercise.
To get a better understanding of this technology, please refer to your course material or
use your preferred search engine to research this topic in more detail.
You need to change the service accounts configured on SQL Server engine and SQL
Server Agent to a domain account that can be authenticated on all SQL servers in the
domain.
Step 1
On PLABSQL01 server, click Start then go to All Programs > Microsoft SQL
Server 2012 > Configuration Tools and select SQL Server Configuration
Manager.
Step 2
On Sql Server Configuration Manager, click on SQL Server Services.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 25/82
7/23/2019 Print content
Step 3
On the SQL Server (MSSQLSERVER) Properties dialog box, while in Log On tab,
click Browse.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 26/82
7/23/2019 Print content
Step 4
On Select User, Service Account or Group dialogue box, ensure Locations is set to
Entire Directory.
Administrator
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 27/82
7/23/2019 Print content
Step 5
On the Multiple Names Found dialog box, select Administrator.
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 28/82
7/23/2019 Print content
Step 6
Back on the Select User, Service Account or Group, click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 29/82
7/23/2019 Print content
Step 7
On the SQL Server (MSSQLSERVER) Properties, in the Password and Confirm
password text boxes, type:
Passw0rd
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 30/82
7/23/2019 Print content
Step 8
Click Yes to Confirm Account Change dialog box.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 31/82
7/23/2019 Print content
Step 9
There will be momentary pause as the service account is changed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 32/82
7/23/2019 Print content
Step 10
To change the service account for SQL Server Agent, right-click on it and select
Properties.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 33/82
7/23/2019 Print content
Step 11
On the SQL Server Agent (MSSQLSERVER) Properties, click Browse.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 34/82
7/23/2019 Print content
Step 12
On Select User, Service Account or Group dialogue box, ensure that Locations is
set to Entire Directory.
administrator
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 35/82
7/23/2019 Print content
Step 13
On the Multiple Names Found dialogue box, select Administrator.
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 36/82
7/23/2019 Print content
Step 14
Back on the Select User, Service Account or Group dialogue box, click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 37/82
7/23/2019 Print content
Step 15
On the SQL Server Agent (MSSQLSERVER) Properties, in the Password and
Confirm password text boxes, type:
Passw0rd
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 38/82
7/23/2019 Print content
Step 16
On the Sql Server Configuration Manager, right-click on SQL Server Agent
(MSSQLSERVER) and select Start.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 39/82
7/23/2019 Print content
Step 17
Please wait while SQL Server Agent is starting up.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 40/82
7/23/2019 Print content
Step 18
The SQL Server Agent (MSSQLSERVER) is now on a Running state.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 41/82
7/23/2019 Print content
Step 19
You will repeat the same steps above this time on PLABSQL02 server.
From PLABSQL02 server, click Start then go to All Programs > Microsoft SQL
Server 2012 > Configuration Tools and select SQL Server Configuration
Manager.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 42/82
7/23/2019 Print content
Step 20
On Sql Server Configuration Manager, click on SQL Server Services.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 43/82
7/23/2019 Print content
Step 21
On the SQL Server (MSSQLSERVER) Properties dialog box, while in Log On tab,
click Browse.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 44/82
7/23/2019 Print content
Step 22
On the Select User, Service Account or Group dialogue box, click Locations.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 45/82
7/23/2019 Print content
Step 23
On the Locations dialog box, click Entire Directory. Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 46/82
7/23/2019 Print content
Step 24
Back on the Select User, Service Account or Group dialogue box, in the provided
text box, type:
Administrator
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 47/82
7/23/2019 Print content
Step 25
On the Multiple Names Found dialog box, select Administrator.
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 48/82
7/23/2019 Print content
Step 26
Back on the Select User, Service Account or Group, click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 49/82
7/23/2019 Print content
Step 27
On the SQL Server (MSSQLSERVER) Properties, in the Password and Confirm
password text boxes, type:
Passw0rd
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 50/82
7/23/2019 Print content
Step 28
Click Yes to restart the service
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 51/82
7/23/2019 Print content
Step 29
There will be momentary pause as the service account is being changed, please wait.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 52/82
7/23/2019 Print content
Step 30
To change the service account for SQL Server Agent, right-click on it and select
Properties.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 53/82
7/23/2019 Print content
Step 31
On the SQL Server Agent (MSSQLSERVER) Properties, click Browse.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 54/82
7/23/2019 Print content
Step 32
On the Select User, Service Account or Group dialogue box, click Locations.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 55/82
7/23/2019 Print content
Step 33
On the Locations dialogue box, select Entire Directory.
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 56/82
7/23/2019 Print content
Step 34
On Select User, Service Account or Group dialogue box, ensure that Locations is
set to Entire Directory.
administrator
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 57/82
7/23/2019 Print content
Step 35
On the Multiple Names Found dialogue box, select Administrator.
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 58/82
7/23/2019 Print content
Step 36
Back on the Select User, Service Account or Group dialogue box, click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 59/82
7/23/2019 Print content
Step 37
On the SQL Server Agent (MSSQLSERVER) Properties, in the Password and
Confirm password text boxes, type:
Passw0rd
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 60/82
7/23/2019 Print content
Step 38
On the Sql Server Configuration Manager, right-click on SQL Server Agent
(MSSQLSERVER) and select Start.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 61/82
7/23/2019 Print content
Step 39
The SQL Server Agent (MSSQLSERVER) changes to a Running state.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 62/82
7/23/2019 Print content
Step 1
On PLABSQL02 device and double-click on Microsoft SQL Server Management
Studio on desktop.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 63/82
7/23/2019 Print content
Step 2
When Microsoft SQL Server Management Studio is open, verify that SQL Server
Agent is started (green playback button is displayed).
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 64/82
7/23/2019 Print content
You need to modify the SQL Server agent encryption on PLABSQL02 which will be the
designated as the target server for the multi-server administration. This is because
database encryption is not configured on the SQL Server servers.
To change the SQL Server Agent encryption settings, follow these steps:
Step 1
On PLABSQL02, click Start and in the Search programs and files box, type:
regedit
Press Enter.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 65/82
7/23/2019 Print content
Step 2
On Registry Editor, navigate to this path:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 66/82
7/23/2019 Print content
Step 3
On the right details pane, locate MsxEncryptChannelOptions then right-click on it,
select Modify…
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 67/82
7/23/2019 Print content
Step 4
On the Edit DWORD (32-bit) Value dialog box, click in the Value data text box and
type:
Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 68/82
7/23/2019 Print content
Step 5
Close Registry Editor window.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 69/82
7/23/2019 Print content
To automate the setup, maintenance, monitoring across multiple databases and multiple
instances, perform the following steps:
Step 1
Switch to PLABSQL01 server, ensure that Microsoft SQL Server Management
Studio is open.
On the left pane, right-click SQL Server Agent, select Multi Server
Administration, and then select Make this a Master.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 70/82
7/23/2019 Print content
Step 2
The Welcome to the Master Server Wizard - PLABSQL01 appears.
Click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 71/82
7/23/2019 Print content
Step 3
On the Master Server Operator screen of the wizard, enter:
administrator@practicelabs.com
Click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 72/82
7/23/2019 Print content
Step 4
On the Target Servers screen, expand the Database Engine in Registered servers
section and then expand Local Server Groups.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 73/82
7/23/2019 Print content
Step 5
The Connect to Server dialog box is displayed.
Click Connect.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 74/82
7/23/2019 Print content
Step 6
Back on the Master Target Server Wizard - PLABSQL01 dialogue box, note that
PLABSQL02 appears in the Target servers section.
Click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 75/82
7/23/2019 Print content
Step 7
The Checking Server Compatibility dialog box appears, confirming Status -
Success.
Click Close.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 76/82
7/23/2019 Print content
Step 8
On the Master Server Login Credentials screen, keep the default selection and click
Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 77/82
7/23/2019 Print content
Step 9
On the Complete the Wizard screen, click Finish.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 78/82
7/23/2019 Print content
Step 10
On the Enlist TSX Progress page, wait for all the actions to be completed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 79/82
7/23/2019 Print content
Step 12
Back on the Microsoft SQL Server Management Studio window, press F5 to
refresh the screen.
Then expand SQL Server Agent, expand Jobs and notice a new folder called Multi-
Server Jobs.
Please note that there are no multi-server jobs configured at the moment. Therefore this
folder will not display any pending jobs.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 80/82
7/23/2019 Print content
Shutdown all virtual machines used in this lab, by using the power functions located in
the Tools bar before proceeding to the next module.
Summary
In this module, you covered carried the following practical tasks:
Also try
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 81/82
7/23/2019 Print content
Using the current lab setup you can try the following concepts at your own pace.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 82/82