Sie sehen die Flagge von Österreich

BMD
Österreich

Sie sehen die Flagge von Deutschland

BMD
Deutschland

Sie sehen die Flagge der Schweiz

BMD
Schweiz

Sie sehen die Flagge von Ungarn

BMD
Magyarország

Sie sehen die Flagge der Slowakei

BMD
Slovensko

Sie sehen die Flagge von Tschechien

BMD
Česko

Sie sehen die englische Flagge

BMD
International

Sie sehen die Flagge der Slowakei SK
Vyhľadaj

MS SQL: Setting up email notifications

Note:

This guide is for skilled computer administrators with experience in working with databases. It is intended to help you set up email notifications.

However, this guide is in no way a basis for claims in case of data loss. The customer is solely responsible for ensuring a full, correct and recoverable backup of all data.

1.1. Email notification for an SQL backup

As described in "Setting up an SQL backup for BMD NTCS", a correctly configured and working SQL backup is required!

In the following example, a local email server is used. Therefore, "localhost" is entered. If you want to use an individual email server (internal or external), you have to guarantee that the SQL Server is allowed to send emails to the desired recipient address via this email server. (Either you allow the SQL Server to use relaying (sending without authentication) or you define a separate user for sending emails.)

1.1.1. Configure Database Mail

From Windows 10 / Server 2016:
Search for "SQL Server Management Studio" in the Windows Start menu or in the Windows task bar search box.
Alternatively, you can also find the program in Windows Explorer under the following path:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server 20xx
Replace "xx" with the SQL version in use.

Older SQL Server versions have a slightly different path and name and can be found under the following path:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server 20xx

PLEASE NOTE!
If Windows User Account Control (UAC) is active, you have to start SQL Server Management Studio by right-clicking and selecting "Run as administrator"!


In SQL Management Studio → Management → right-click on "Database Mail" → Configure Database Mail:

Einrichten einer SQL-Mailbenachrichtigung

Confirm the start page of the dialogue and choose "Set up Database Mail by …" in the following window:

Einrichten einer SQL-Mailbenachrichtigung

Confirm with "Yes" in the next window:

Einrichten einer SQL-Mailbenachrichtigung

Enter "SQL-Mail" in "Profile name" and click "Add":

Einrichten einer SQL-Mailbenachrichtigung

Enter the appropriate values in the following dialogue and confirm with "OK".

The following values are mandatory:
Account name: SQL-Mail
E-Mail address: sender email address
Server name: IP address or server name of the email server
SMTP Authentication: depending on the email server configuration

Einrichten einer SQL-Mailbenachrichtigung

Confirm by clicking on "Next":

Einrichten einer SQL-Mailbenachrichtigung

Choose the public profile name here:

Einrichten einer SQL-Mailbenachrichtigung

In the system parameters, change the "Account Retry Attempts" value to 3 and, if required, change the value of "Account Retry Delay":

Einrichten einer SQL-Mailbenachrichtigung

Finish the assistant:

Einrichten einer SQL-Mailbenachrichtigung

1.1.2. Test email

Now, you can already send a test email to the future recipient address: In SQL Management Studio → Management → right-click on "Database Mail" → Send Test E-Mail → enter the future recipient in "To" and check whether the test email was sent and received correctly.

Einrichten einer SQL-Mailbenachrichtigung
Einrichten einer SQL-Mailbenachrichtigung

1.1.3. Activate emailing

Now, you have to activate emailing:
Right-click on SQL Server Agent → Properties → Alert System → Enable mail profile

Einrichten einer SQL-Mailbenachrichtigung

Mail system: Database Mail
Mail profile: SQL-Mail

Einrichten einer SQL-Mailbenachrichtigung

Afterwards, you have to restart the agent. Right-click on SQL Server Agent → Restart:

Einrichten einer SQL-Mailbenachrichtigung

1.1.4. Create recipient

Create the recipient now. Right-click again on SQL Server Agent → New… → Operator.
Enter here the address you have previously tested:

Einrichten einer SQL-Mailbenachrichtigung
Einrichten einer SQL-Mailbenachrichtigung

1.1.5. Store email notification

Finally, the email notification has to be stored in the two backup jobs:
SQL Server Agent → Jobs → right-click on "Full Backup BMD" → Properties → Notifications → Activate email and choose "When the job completes":

Einrichten einer SQL-Mailbenachrichtigung
Einrichten einer SQL-Mailbenachrichtigung

1.1.6. Transaction log backup

Follow the instructions for the Transaction log backup.
SQL Server Agent → Jobs → right-click on "Trans-Log-Backup BMD" → Properties → Notifications → activate "E-mail" and choose "When the job fails":

Einrichten einer SQL-Mailbenachrichtigung
Einrichten einer SQL-Mailbenachrichtigung

Section:

BMD NTCS Documentation


Author:

Technik BMD Systemhaus GesmbH



BMD Business Solutions s.r.o.

Nám. 1. mája 7991/9

SK-81106 Bratislava - Staré Mesto

+421 220 861 990

bratislava@bmd.com

Partner
Partner SKDP

Follow us

Folgen Sie uns auf LinkedIn
Folgen Sie uns auf YouTube