Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Submitted By:-
Vishal
Roll No. – RC1601A38
Reg. No. – 3050071019
B.T-M.T (CSE)
[HOME WORK-3]
• Database Mail can be configured with multiple profiles and multiple SMTP accounts, which
can be on several SMTP servers. In the case of failure of one SMTP server, the next available
server will take up the task of sending e-mails. This increases the reliability of the mailing
system.
• SQL Server continues to queue messages when the external mailing process fails. Whenever
the process is successful, it starts to send queued messages.
• Mailing is an external process so it does not decrease your database performance. This
external process is handled by an executable called DatabaseMail90.Exe located in the
MSSQL\Bin directory.
• Availability of an auditing facility is a major enhancement in Database Mail. Previously,
DBAs could not verify whether the system had sent an e-mail. All mail events are logged so
that DBAs can easily view the mail history. In addition, DBAs can view the errors to fix
SMTP related issues. Plus, there is the capability to send HTML messages.
• Database Mail has the option of limiting files sizes to prevent sending large files that would
degrade mail server performance. In addition, you have the option of limiting files by their
extensions. For example, .exe.com can be prevented from being sent from the database
server.
Answer: In Database Mail, the Account holds information that the database engine uses to send e-mail
messages. An Account holds information for only one e-mail server, such as the account name, e-mail
address, reply-to e-mail address, server name or IP address, and some optional security settings.
To send a Database Mail e-mail, a Profile must be used. A Profile is set up of one or more Accounts. This
Profile-Account setup is very useful for a couple of reasons. It allows you to associate more than one
Account to a profile, which means that you can associate more than one e-mail server to a profile. So, when
you try to send an e-mail, each Account for the profile is tried until the message is successfully sent, which is
great in case one or more of your SMTP servers is unavailable. It also allows you to develop your application
code for sending e-mails without worrying about changing the Profile name for different environments. You
can use the same Profile name for your Development and Production environments; the only difference is
that the Accounts contained in the profiles will be different
EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = 'SQL2005_Email_ProfileName',
@description = 'Notification service for SQL Server'
EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = 'SQL Server Notification Service',
@description = 'SQL Server Notification Service',
@email_address = 'john.doe@domain_name.com',
@replyto_address = 'john.doe@domain_name.com',
@display_name = 'SQL Server Notification Service',
@mailserver_name = 'smtpserver.domain_name.com' ;
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = 'SQL2005_Email_ProfileName',
@account_name = 'SQL Server Notification Service',
@sequence_number =1 ;
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@profile_name = 'SQL2005_Email_ProfileName',
@principal_id = 0,
@is_default = 1 ;
Q3. Briefly explain different mail sending options for SQL 2005 ?
Answer:
Step 2 - Doing so will launch the Configure Database Mail Wizard. It may look a little confusing at first, but
once we step through it the script at the end of this tip will make more sense.
Step 3 - Since we're setting up Database Mail for the first time, select the Setup option as recommended
Step 5 - Click the Add button to assign an SMTP account to the profile you're creating. You may need to
work with your Server Technicians and/or Security Teams to collect some of the information you'll need.
It's best to have this ahead of time so as not to hold up the process of configuring Database Mail. You will
need the account name, description, email address (both incoming and outgoing), display name, and
SMTP server name for this account. Be sure to confirm the port number with your Server Technicians as
well. Typically, the default of port 25 will work. Select how you want to authenticate to the SMTP server
and then click OK to proceed
Step 6 - You will notice that the account information is now listed. You can set up multiple accounts for the
Database Mail profile to allow for failover if you so choose. Click Next to continue onto setting up security for
the Database Mail profile. I've already taken the liberty of setting this up as a Public Profile. This means that
all users of the SQL instance will have access to this Database Mail profile. You have the option of creating
Private Profiles that are only accessible to certain users of the instance. In our environment we have a default
Database Mail profile that is used across all SQL instances. Your environment may differ. A Future tip will
outline creation and use of Private Database Mail Profiles.
• New in SQL Server 2005, Event Notifications provide a flexible and powerful way of
capturing and handling events that occur inside of SQL Server.
• Event Notifications execute for DDL Events and Trace Events inside of the database engine
and can be used instead of DDL triggers or SQL Trace to capture information about the event
being fired. However, unlike DDL triggers and SQL Trace which process synchronously,
Event Notifications utilize Service Broker to asynchronously capture event information.
2. Notification Services help subscribers by providing them with timely, customized, and
personalized services.
3. Notification applications allow users to communicate with mobile subscribers over a wide
variety of devices.
4. Notification Services keep subscribers alert by providing them with information whenever
and wherever they need it. This helps businesses be more productive.
Answer: Multiserver administration requires that you set up a master server and one or more target
servers. Jobs that will be processed on all the target servers are first defined on the master server and
then downloaded to the target servers.
To create a Multiserver environment, use the Master Server Wizard. For information about using the
Master Server Wizard, see How to: Make a Master Server (SQL Server Management Studio). Full
Secure Sockets Layer (SSL) encryption and certificate validation are enabled for connections
between master servers and target servers by default. For more information, see Setting Encryption
Options on Target Servers.
• Checking the security settings for the SQL Server Agent service and the SQL Server service
on all servers intended to become target servers. We recommend that both services should be
running in Microsoft Windows domain accounts. For more information, see Choosing the
Right SQL Server Agent Service Account for Multiserver Environments.
• Each target server reports to only one master server. You must defect a target server from one
master server before you can enlist it into a different one.
• When changing the name of a target server, you must defect it before changing the name and
re-enlist it after the change.
• If you want to dismantle a Multiserver configuration, you must defect all the target servers
from the master server.
• If you want to distribute maintenance plans additional configuration is required.
1. From Object Explorer, expand your server, and then expand SQL Server Agent.
2. Expand Jobs.
3. Right-click Simple Backup and select Properties.
4. Under the Select a Page list, select Steps.
5. Click the New button.
❑ CmdExec
❑ Replication Distributor
❑ Replication Merge
❑ Replication Snapshot