Académique Documents
Professionnel Documents
Culture Documents
Practicum Case
COMP6119
Database Administration
Computer Science O161-COMP6119-DI01
Learning Outcomes
Apply SQL server features
Topic
Session 03 – Automating SQL Server
Sub Topics
Configuration Tasks
Automating Routine Maintenance Tasks
Creating jobs, Operators, and Alerts
Automating Multi Server Jobs
Page 1 of 10
180917 FM-BINUS-AA-FPT-66/R7
Soal
Case
IndBook
IndBook has implemented the new system for a month. They found that it’s very difficult to manage
the database if you have to watch over it every time. So, you are assigned to find out the way to manage the
database automatically. After some research, you know that you can use SQL Server Agent to do particular
jobs automatically. So, you are requesting training about SQL Server Agent for all the DBA in order to ease
their work. The training is about Jobs, Operators and Alerts.
Page 2 of 10
180917 FM-BINUS-AA-FPT-66/R7
CREATE JOBS
A job is a specified series of actions that SQL Server Agent performs. Use jobs to define an
administrative task that can be run one or more times and monitored for success or failure. A job can run
on one local server or on multiple remote servers. This is step by step how to create a new job:
Expand SQL Server Agent and right click on Jobs folder and choose New Job.
Page 3 of 10
180917 FM-BINUS-AA-FPT-66/R7
Move to the Targets page to specify the server. Choose Target local server if you want the job running
just in your server. Choose Target multiple servers if you want the job running in the several servers.
This option can be chosen if you have more than one server. Click OK to finish creating the job.
You will find your job in the Jobs folder. Expand it to see all jobs you have created.
CREATE OPERATORS
Operators are aliases for people or groups that can receive electronic notification when jobs have
completed or alerts have been raised. The SQL Server Agent service supports the notification of
Page 4 of 10
180917 FM-BINUS-AA-FPT-66/R7
administrators through operators. Operators enable notification and monitoring capabilities of SQL Server
Agent. This is step by step how to create a new operator.
Right click on the Operator folder and choose New Operator.
Page 5 of 10
180917 FM-BINUS-AA-FPT-66/R7
Fill in the operator name. Check the Enable if you want the operator start right after you are creating
the operator. Fill the email address, net send address and pager e-mail name to specify who will receive
the notification.
Check the day you want the operator working. The Workday begin and Workday end specify the
working time of the operator.
Go to the Notifications page and you will see a window like this.
Choose Alerts if you want the operator sends notification after an alert has been raised or choose Jobs
if you want the operator sends notification after a job completed. Click OK to finish creating new
operator.
You will find your new operator inside the Operators folder. Expand it to see your new operator.
Page 6 of 10
180917 FM-BINUS-AA-FPT-66/R7
Page 7 of 10
180917 FM-BINUS-AA-FPT-66/R7
CREATE ALERTS
An alert is an automatic response to a specific event. For example, an event can be a job that starts or
system resources that reach a specific threshold. You define the conditions under which an alert occurs.
This is step by step how to create a new alert.
Right click on the Alerts folder and choose New Alert.
Fill the alert name. Same with jobs and operators, check Enable if you want the alert running right after
you create it. Choose the type, SQL Server event alert for alert when an event contains errors, SQL
Server performance condition alert for alert when a performance reaches some state and WMI event
alert for alert when a WMI event happens. For example, we choose SQL Server event alert.
Page 8 of 10
180917 FM-BINUS-AA-FPT-66/R7
Fill the database name with the database where the alert works. Specify the Error number or choose
one of the Severities.
Go to the Response page and check the Notify operators if you want to send some notifications to
operators and check the Execute job to run a particular job when the alert rises. Click OK if you finish
editing the new alert properties.
Go to the Alerts folder and expand it. You will see your alerts inside the folder.
Page 9 of 10
180917 FM-BINUS-AA-FPT-66/R7
PRACTICE
1. Create a new job with specified steps. The step’s configuration is up to you.
2. Create a new alert that has SQL Server performance condition alert.
3. Create a new operator that has alert notification just for the operator’s email.
Page 10 of 10