Thông tin tài liệu
LESSON: 3A
ADDITIONAL FEATURES OF SQL
SERVER 2000
Objectives
Additional Features of SQL Server
2000
Objectives
In this lesson, you will learn about:
•
•
•
•
Configuring
Configuring
Configuring
Introducing
(XML)
©NIIT
and Using SQLMail
and Using SQLAgentMail
and Managing Linked Servers
IIS virtual directories to support Extensible Markup Language
Additional Features of SQL Server
Lesson 3A / Slide 1 of 26
In this lesson, you will learn about:
Configuring
Configuring
Configuring
Introducing
3A.1
and Using SQL Mail
and Using SQLAgentMail
and Managing Linked Servers
IIS virtual directories to support Extensible Markup Language (XML)
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Pre-Assessment Questions
©NIIT
1.
Which of the following SQL Server 2000 job step helps SQL Server
Agent to find the application source?
a)
Operating system commands
b)
Transact-SQL statements
c)
Microsoft ActiveX scripts
d)
Replication tasks
2.
Which of the following attributes of SQL Server alerts and their
messages contains the name of the stored procedure, if the error has
occurred in a stored procedure?
a)
State code
b)
Procedure name
c)
Line number
d)
Message string
Additional Features of SQL Server
Lesson 3A / Slide 2 of 26
Administering and Troubleshooting SQL Server 2000
3A.2
Additional Features of SQL Server
2000
Pre-Assessment Questions
3.
©NIIT
3A.3
Which of the following functions state the code attribute of the SQL
Server alert and their messages?
a)
It contains information about the cause of the error, place
where the error has occurred, and the object concerned with
this error.
b)
It is used to find the source code location of the error and is
used by Microsoft support engineers.
c)
It indicates the line number of the Transact-SQL statement in
the stored procedure, which has caused the error.
d)
It contains the name of the stored procedure if the error has
occurred in a stored procedure.
Additional Features of SQL Server
Lesson 3A / Slide 3 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Pre-Assessment Questions
4.
5.
©NIIT
From the following options, which attribute of the SQL Server alert
contains the name of the stored procedure that has generated the
error?
a)
Severity
b)
Message string
c)
Procedure name
d)
State code
From the following options which job step of SQL Server 2000 contains
the full path to all the executable files and command?
a)
CMDExec commands
b)
Transact-SQL statements
c)
Microsoft ActiveX scripts
d)
Replication tasks
Additional Features of SQL Server
Lesson 3A / Slide 4 of 26
Administering and Troubleshooting SQL Server 2000
3A.4
Additional Features of SQL Server
2000
Solutions to Pre-assessment Questions:
Ans 1. a. Operating system commands
Ans 2. b. Procedure name
Ans 3. b. It is used to find the source code location of the error and is used by
Microsoft support engineers.
Ans 4. c. Procedure name
Ans 5. a. CMDExec commands
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 5 of 26
INSTRUCTOR NOTES
Before beginning the session ensure that Employee.mdb is saved under C:. Start the
session by telling the students about the additional functions performed by SQL Server
2000, such as sending and receiving mails and integrating different mail servers. Then
tell the students that SQL Server performs these functions using the following
components:
SQL Mail
SQLAgentMail
Linked Server
SQL Server XML support in IIS
Discuss the functions of SQL Mail and tell the students about the xp_sendmail system
stored procedures used by it during its execution. Then discuss the functions of
3A.5
Administering and Troubleshooting SQL Server 2000
SQLAgentMail. Also tell the students about the various system-stored procedures used
by SQLAgentMail during its execution. Now tell the students that before using SQL Mail
and SQL AgentMail you need to configure MAPI clients on SQL Server 2000. Then
discuss linked server and SQL Server XML support in IIS in brief.
Ensure that the following datafiles are installed on the student nodes:
Employee.mdb
Customers.mdb
Administering and Troubleshooting SQL Server 2000
3A.6
INTRODUCING SQL SERVER 2000
MAIL SERVICES
Additional Features of SQL Server
2000
Additional Components of SQL Server
2000
•
•
SQL Server 2000 provides features to send and receive e-mail messages
between multiple database users.
To take advantage of all these features, you need to configure the following
components:
•
•
•
•
©NIIT
3A.7
SQLMail
SQLAgentMail
Linked Server
SQL Server XML support in IIS
Additional Features of SQL Server
Lesson 3A / Slide 6 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Additional Components of SQL Server
2000 (Contd.)
•
•
•
©NIIT
SQL Server 2000 sends and receives messages by establishing a connection
with mail servers.
SQL Mail is the mail service of SQL Server 2000 that sends messages to
mailboxes and e-mail pagers using the Transact-SQL commands and
xp_sendmail extended stored procedure.
You can also create a scheduled job for automatic process of e-mail.
Additional Features of SQL Server
Lesson 3A / Slide 7 of 26
Administering and Troubleshooting SQL Server 2000
3A.8
Additional Features of SQL Server
2000
Additional Components of SQL Server
2000 (Contd.)
•
Descriptions
xp_sendmail
Sends e-mail messages from Transact-SQL batches, scripts, triggers, and
procedures to the designated user
xp_readmail
Reads the message
xp_startmail
Starts the session of SQL Mail
xp_stopmail
Stops the session of SQL Mail
xp_processmail
Processes queries as an incoming messages and sends the result set to
the designated recipients as an outgoing message
xp_deletemail
Deletes specified messages
xp_findnextmsg
Finds the next message in the SQL Server inbox for processing
©NIIT
3A.9
The following table lists the SQL Mail stored procedures and their description:
Stored Procedures
Additional Features of SQL Server
Lesson 3A / Slide 8 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Additional Components of SQL Server
2000 (Contd.)
•
•
•
©NIIT
SQLAgentMail is the mail service of SQL Server 2000 that is used for SQL
Server Agent services.
Before configuring SQL Mail and SQLAgentMail, you need to install MAPI clients
on the SQL Server 2000 computer.
Linked server is a component of SQL Server 2000 that links multiple database
servers to facilitate exchange of information.
Additional Features of SQL Server
Lesson 3A / Slide 9 of 26
Administering and Troubleshooting SQL Server 2000
3A.10
Additional Features of SQL Server
2000
Additional Components of SQL Server
2000 (Contd.)
•
Besides database servers, you can also link SQL Server 2000 database to a text
file or a spreadsheet as shown in the following figure:
Oracle DB
Server
OLEDB Provider
SQL Server
OLEDB Provider
OLEDB Provider
©NIIT
3A.11
Additional Features of SQL Server
Text Files
SQL Server
Lesson 3A / Slide 10 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Additional Components of SQL Server
2000 (Contd.)
•
SQL Server 2000 supports XML to convert an SQL Server 2000 instance into an
XML enabled database server.
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 11 of 26
SQL Server 2000 provides features to send and receive e-mail messages between
multiple database users. It provides features to link multiple databases, such as
Oracle, or MS Access for the execution of distributed queries. In addition, SQL Server
2000 supports XML for exchange of information across platforms. SQL Server 2000
also provides features for accessing databases through Internet servers, such as IIS.
To take advantage of all these features, you need to configure the following
components:
SQL Mail
SQLAgentMail
Linked Server
SQL Server XML support in IIS
SQL Server 2000 sends and receives messages by establishing a connection with mail
servers. SQL Server 2000 supports mail servers such as, Microsoft Exchange Server,
Microsoft Windows Mail, or Post Office Protocol 3 (POP3). The mails are sent and
received using two separate services, SQL Mail and SQLAgentMail. Both these services
require Messaging Application Programming Interface (MAPI) client applications, such
as Microsoft Outlook and MAPI messaging profile on SQL Server 2000 computer.
Administering and Troubleshooting SQL Server 2000
3A.12
MAPI is an interface of Microsoft Windows program that enables you to send and
receive e-mail within Windows application. The services also require Windows NT 4.0
or Windows 2000 domain user account to logon to an instance of SQL Server 2000.
SQL Mail
SQL Mail is the mail service of SQL Server 2000 that sends messages to mailboxes
and e-mail pagers using the Transact-SQL commands and xp_sendmail extended
stored procedure. It receives and processes mails from a mail system and sends the
query response to the designated mail account by creating a reply mail. You can use a
result set from a query, a message string, a Transact-SQL statement, or a page for an
electronic pager as the content of an e-mail message. For example, consider the
following statements:
EXEC xp_sendmail ‘Scott@Macaluminium.USA’,
@subject = ’Database Login Information’,
@query = ‘Select * from master.dbo.master’
The Transact-SQL statement in the preceding example is a part of the content of the
e-mail message. You can also create a scheduled job for automatic process of e-mail.
The following table lists the SQL Mail stored procedures and their description:
Stored Procedures
Descriptions
xp_sendmail
Sends e-mail messages from Transact-SQL batches,
scripts, triggers, and procedures to the designated
user.
xp_readmail
Reads the message.
xp_startmail
Starts the session of SQL Mail.
xp_stopmail
Stops the session of SQL Mail.
xp_deletemail
Deletes specified messages.
xp_findnextmsg
Finds the next message in the SQL Server inbox for
processing.
3A.13
Administering and Troubleshooting SQL Server 2000
SQLAgentMail
SQLAgentMail is the mail service of SQL Server 2000 that is used for SQL Server
Agent services. SQL Server Agent services are server components that run scheduled
SQL Server 2000 administrative tasks. SQLAgentMail is used to send e-mail
notifications to the designated users when any scheduled task, such as database
backup or recovery, succeeds or fails. You can configure SQLAgentMail to send SQL
Server alerts when specific event occurs. For example, you can use SQLAgentMail to
send an alert to the operators when a particular database event needs immediate
action. SQLAgentMail uses its own mail profile and domain account. These mail
profiles and domain accounts are different from that of SQL Mail.
Prerequisite for Configuring SQL Mail and
SQLAgentMail
Before configuring SQL Mail and SQLAgentMail, you need to install MAPI clients on the
SQL Server 2000 computer. In addition, you must also configure the mail or
messaging profile of the domain user account. SQL Mail and SQLAgentMail use these
configured domain user accounts. You can create the message profile by using MAPI
client interface or Mail program from the Control Panel.
Apart from stored procedures, triggers and alerts can also be
coded to send messages using the SQL Mail system.
Administering and Troubleshooting SQL Server 2000
3A.14
Linked Server
Linked server is a component of SQL Server 2000 that links multiple database servers
to facilitate exchange of information. Using this component you can connect or link
multiple database servers, such as Oracle, and Microsoft Access using OLEDB data
source and OLEDB data providers. While you configure the linked server, you need to
register the connection and data source information of the OLEDB data source with
SQL Server 2000. After successful registration, you can always refer the data source
with a single logical name. Besides database servers, you can also link SQL Server
2000 database to a text file or a spreadsheet, as shown in the following figure:
Oracle DB
Server
OLEDB Provider
SQL Server
OLEDB Provider
OLEDB Provider
Text Files
SQL Server
You can create and configure the linked server, using SQL Server 2000 Enterprise
Manager. You can also create and configure a linked server using the
sp_addlinkedserver system stored procedure.
SQL Server XML Support in IIS
SQL Server 2000 supports XML to convert an SQL Server 2000 instance into an XML
enabled database server. With the help of XML enabled database server, you can
present the data on the web as XML pages in response to HTTP queries. The
generated XML page can be used for exchanging information across different
platforms and organizations. To do this, you need to configure IIS virtual directory.
The configured IIS virtual directory creates an association with the instance of SQL
Server 2000 server that enables access to SQL Server 2000 database objects, such as
tables through (Hypertext Transfer Protocol) HTTP. In addition, you can also access
the XML document consisting of one or more SQL statements.
3A.15
Administering and Troubleshooting SQL Server 2000
INSTRUCTOR NOTES
Additional Inputs
Using URL to Access SQL Server 2000
You can access SQL Server 2000 using the Uniform Resource Locator (URL) over the
Hyper Text Transfer Protocol (HTTP). Using the URL you can:
1. Directly access the database objects, such as tables, view, or triggers of a SQL
Server 2000 database. However, this is not recommended due to security
reasons.
2. Execute the XML files containing Transact-SQL statements, known as
Templates.
3. Execute XML queries.
INSTRUCTOR NOTES
Now that you have introduced the additional components of SQL Server 2000, you can
now tell the students about configuring SQL Mail and SQL AgentMail using SQL Server
2000 Enterprise Manager. Explain the configuration process of both the components in
detail.
Administering and Troubleshooting SQL Server 2000
3A.16
CONFIGURING SQL MAIL AND
SQLAGENTMAIL
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail
•
•
Before configuring SQL Mail and SQLAgentMail, you need to install
MAPI clients on the SQL Server 2000 computer.
To configure SQL Mail, perform the following steps:
1.
©NIIT
3A.17
Select Start->Programs->Microsoft SQL
Server->Enterprise Manager, to open the Enterprise
Manager console.
Additional Features of SQL Server
Lesson 3A / Slide 12 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail (Contd.)
2.
3.
©NIIT
Expand the Microsoft SQL Server Group->Support Services option.
Right-click the SQL Mail option, and select the Properties option to
open the SQL Mail Configuration dialog box.
Additional Features of SQL Server
Lesson 3A / Slide 13 of 26
Administering and Troubleshooting SQL Server 2000
3A.18
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail (Contd.)
©NIIT
3A.19
4.
Select the profile name from Profile name list as shown. (Enter your
user name.)
5.
Click the Test button to verify the session of mail service.
Additional Features of SQL Server
Lesson 3A / Slide 14 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail (Contd.)
•
©NIIT
To configure SQLAgentMail, perform the following steps:
1. Select Start->Programs->Microsoft SQL Server->Enterprise
Manager, to open the Enterprise Manager console.
2. In the Enterprise Manager console, expand the Microsoft SQL Server
Group->Management container option.
Additional Features of SQL Server
Lesson 3A / Slide 15 of 26
Administering and Troubleshooting SQL Server 2000
3A.20
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail (Contd.)
3.
©NIIT
3A.21
Right-click the SQL Server Agent option, and then click the
Properties option to open the SQL Server Agent
Properties dialog box.
Additional Features of SQL Server
Lesson 3A / Slide 16 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail (Contd.)
4.
©NIIT
In the Mail Session section, from the Mail profile drop-down list box
select the messaging profile as shown:
Additional Features of SQL Server
Lesson 3A / Slide 17 of 26
Administering and Troubleshooting SQL Server 2000
3A.22
Additional Features of SQL Server
2000
Configuring SQL Mail and
SQLAgentMail (Contd.)
5.
©NIIT
Click the Test button to verify the session of mail service.
Additional Features of SQL Server
Lesson 3A / Slide 18 of 26
Before configuring SQL Mail and SQLAgentMail, you need to install MAPI clients on the
SQL Server 2000 computer. In addition, you need to configure the mail or messaging
profile of the domain user account. SQL Mail and SQLAgentMail use these domain user
accounts. You can create the message profile using MAPI client interface or using Mail
program in Control Panel.
Configuring SQL Mail
To configure SQL Mail, perform the following steps:
1. Select StartÆAll ProgramsÆMicrosoft SQL ServerÆEnterprise Manager,
to open the Enterprise Manager console.
2. Expand the Microsoft SQL ServersÆSQL Server Group. Expand Support
Services under default instance of SQL Server, as shown.
3A.23
Administering and Troubleshooting SQL Server 2000
3. Right-click the SQL Mail option, and select the Properties option to open the
SQL Mail Configuration dialog box.
4. Select the profile name from Profile name list box.
5. Click the Test button to verify the session of mail service.
Administering and Troubleshooting SQL Server 2000
3A.24
Configuring SQLAgentMail
To configure SQLAgentMail, perform the following steps:
1. Select StartÆAll ProgramsÆMicrosoft SQL ServerÆEnterprise Manager,
to open the Enterprise Manager console.
2. Expand the Microsoft SQL ServersÆSQL Server Group. Expand
Management under default instance of SQL Server.
3. Right-click the SQL Server Agent option, and then click the Properties
option to open the SQL Server Agent Properties dialog box.
4. In the Mail session section, from the Mail profile drop-down list box select
the messaging profile, as shown.
5. Click the Test button to verify the session of mail service.
3A.25
Administering and Troubleshooting SQL Server 2000
INSTRUCTOR NOTES
Next, tell the students about configuring linked server in SQL Server 2000. To explain
the configuration process of linked server, present the students with a business
problem that requires configuring linked server. Explain the solution of the problem in
detail by breaking the solution in to several logically related tasks and then discussing
these tasks in detail.
Administering and Troubleshooting SQL Server 2000
3A.26
CONFIGURING LINKED SERVER
Additional Features of SQL Server
2000
Configuring Linked Server
The Payroll department of Mac Aluminium, Inc., wants to prepare salary slips for the
employees of Refractory department. To do this, the Payroll department wants to
collect the employee names and salaries of all the employees belonging to the
Refractory department. The Payroll department stores the data in SQL Server 2000
database, whereas the Refractory department uses MS Access database. The
system administrator of Payroll department wants to collect the required data from
the Employee table stored in Employee.mdb database. For easy identification, the
system administrator wants to provide the name of the link as SQLMSACCESS. As
the system administrator is already authenticated by Windows operating system,
the connection to SQL Server 2000 database will be a trusted connection.
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 19 of 26
Problem Statement
The Payroll department of Mac Aluminium, Inc., wants to prepare salary slips for the
employees of Refractory department. To do this, the Payroll department wants to
collect the employee names and salaries of all the employees belonging to the
Refractory department. The Payroll department stores the data in SQL Server 2000
database, whereas the Refractory department uses MS Access database. The system
administrator of Payroll department wants to collect the required data from the
Employee table stored in Employee.mdb database. For easy identification, the system
administrator wants to provide the name of the link as SQLMSACCESS. As the system
administrator is already authenticated by Windows operating system, the connection
to SQL Server 2000 database will be a trusted connection.
3A.27
Administering and Troubleshooting SQL Server 2000
Solution
Additional Features of SQL Server
2000
Task List
•
•
•
•
©NIIT
Create a link between SQL Server 2000 and MS Access database server.
Specify the connection information.
Specify the connection mapping.
Retrieve employee name and salary from Employee table.
Additional Features of SQL Server
Lesson 3A / Slide 20 of 26
To solve the preceding problem, perform the following tasks:
1. Create a link between SQL Server 2000 and MS Acesss database server.
2. Specify the connection information.
3. Specify the connection mapping.
4. Retrieve employee name and salary from Employee table.
1: Create a link between SQL Server 2000 and MS ACCESS
database.
Action:
1. Select StartÆAll ProgramsÆMicrosoft SQL ServerÆEnterprise Manager,
to open the SQL Server 2000 Enterprise Manager console.
Administering and Troubleshooting SQL Server 2000
3A.28
2. Expand Microsoft SQL Servers from Console Root and then expand SQL
Server Group.
3. Expand the default instance of SQL Server 2000 and then expand the
Security option, to display the Linked Servers option.
4. Right-click the Linked Servers option, and click the New Linked Server
option, as shown, to display the Linked Server Properties dialog box.
2: Specify the connection information
The General tab screen of the Linked Server Properties dialog box displays the
following options:
Linked Server: This option specifies the name of the linked server.
SQL Server: This option enables you to specify the default instance of SQ
Server 2000 in the Linked server name text box.
Other data source: This option allows you to define the linked server using the
OLEDB provider.
Provider name: This option allows you to specify the provider name for other
database servers.
3A.29
Administering and Troubleshooting SQL Server 2000
Product name: This option allows you to provide the product name for the
OLEDB data source that you want to add as a linked server.
Data source: This option allows you to specify
corresponding to the linked server.
the OLEDB data source alias
Provider string: This option allows you to specify
property for the corresponding linked server.
the OLEDB provider string
Action:
1. In the Linked server text box, specify the server name as SQLMSACCESS.
2. In the Server type section, select the Other data source option.
3. Verify that Microsoft Jet 4.0 OLE DB Provider is selected from the
Provider name drop-down list, as shown.
4. Enter OLEDB Provider for Jet in the Product name text box and
C:\Employee.mdb in the Data source text box, as shown.
Administering and Troubleshooting SQL Server 2000
3A.30
Verify that employee.mdb file is saved in the C drive.
3: Specify the connection mapping.
The Security tab on the Linked Server Properties dialog box displays the following
options:
Local Login: This option allows you to connect with the linked server with the
local login id.
Impersonate: This option verifies the local login id with the login id on the
linked server.
Remote User: This option enables you to define login id for remote user.
Remote password: This option allows you to specify
users who are not logged in with local login ID.
password for remote
Not be made: This option identifies that a connection will not be made for
undefined logins.
3A.31
Administering and Troubleshooting SQL Server 2000
Be made without using a security context: For undefined logins, this option
enables to connect to the linked server without using security context.
Be made using the login’s current security settings: This option allows
connecting to linked server using the security settings.
Be made using this security context: This option allows you to specify login
id and password in the Remote login and with password text boxes.
Action:
1. Select the Be made without using a security context option, as shown.
2. Click the OK button to close the Linked Server Properties dialog box.
3. The linked Server, SQLMSACCESS, will appear in the linked server node.
Administering and Troubleshooting SQL Server 2000
3A.32
4: Retrieve employee name and salary from Emp table.
Action:
To retrieve data from the Employee table, in the Query Analyzer window, write the
following Transact-SQL statement:
INSTRUCTOR NOTES
Additional Inputs
Using Transact-SQL to Configure a Linked Server
You can configure a linked server using the sp_addlinkedserver system stored
procedure of Transact-SQL. The following is the syntax of the sp_addlinkedserver
system stored procedure:
sp_addlinkedserver [@server = ] ‘’
In the above syntax:
The [@server = ] keyword takes the value of the server_name variable.
The server_name variable refers to the default or named instance of SQL Server
2000 that is to be configured as a linked server.
3A.33
Administering and Troubleshooting SQL Server 2000
INSTRUCTOR NOTES
Finally, tell the students about setting up an Internet Information Server (IIS) virtual
directory for Extensible Markup Language (XML) support in SQL Server 2000. Your
system should have IIS installed to before you explain the students about the method
to setup IIS virtual directory. To explain the process of setting the IIS virtual directory
for XML support, present the students with a business problem that requires setting
up an IIS virtual directory. Discuss the solution of the problem in detail. You can break
the solution in to number of small tasks to help the students to effectively understand
the process of setting up the IIS virtual directory for XML support in SQL Server 2000.
Administering and Troubleshooting SQL Server 2000
3A.34
SETTING UP IIS VIRTUAL
DIRECTORY FOR XML SUPPORT
Additional Features of SQL Server
2000
Setting up IIS Virtual Directory for
XML Support
The head of the Sales department, Derek wants to create a report on the sales
transaction of aluminium products that he has to present to the chairman of the
organization. Since Derek wants to show the up-to-date sales transaction, he wants
to access the recent data and generate the report through a browser. To perform
this task, Derek wants to write queries on browser to retrieve the desired data from
the Sales table of Customer database. In addition, Derek wants the retrieved data
to be in XML format. As Derek has an authenticated user account in Windows
operating system, he wants to connect to the SQL Server 2000 database server
using Windows domain account. To perform all these operations with ease, Derek
hands over this job to the Database Administrator, James.
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 21 of 26
Problem Statement
The head of the Sales department, Derek wants to create a report on the sales
transaction of aluminium products that he has to present to the chairman of the
organization. Since Derek wants to show the up-to-date sales transaction, he wants to
access the recent data and generate the report through a browser. To perform this
task, Derek wants to write queries on browser to retrieve the desired data from the
Sales table of Customer database. In addition, Derek wants the retrieved data to be in
XML format. As Derek has an authenticated user account in Windows operating
system, he wants to connect to the SQL Server 2000 database server using Windows
domain account. To perform all these operations with ease, Derek hands over this job
to the Database Administrator, James.
3A.35
Administering and Troubleshooting SQL Server 2000
Solution
Additional Features of SQL Server
2000
Task List
•
•
•
•
•
•
©NIIT
Open the IIS Virtual Directory Management for SQL Server Console.
Specify the virtual name and path of the database.
Specify the authentication for connecting to the database.
Specify the server and database name.
Specify the type of accessibility to the database server.
Verify and access the database through browser.
Additional Features of SQL Server
Lesson 3A / Slide 22 of 26
To solve the preceding problem, perform the following tasks:
1. Open the IIS Virtual Directory Management for SQL Server Console.
2. Specify the virtual name and path of the database.
3. Specify the authentication for connecting to the database.
4. Specify the server and database name.
5. Specify the type of accessibility to the database server.
6. Verify and access the database through browser.
Administering and Troubleshooting SQL Server 2000
3A.36
1: Open the IIS Virtual Directory Management for SQL Server
Console.
Action:
1. Click StartÆAll ProgramsÆMicrosoft SQL ServerÆConfigure SQL XML
Support in IIS to display the IIS virtual directory management console.
2. Expand the default server from the console tree, as shown.
2: Specify the virtual name and path of the database
1. Right click the Default Web Site and select the NewÆ Virtual Directory
option, as shown, to open the New Virtual Directory Properties dialog box.
3A.37
Administering and Troubleshooting SQL Server 2000
2. The General tab is selected by default. In the Virtual Directory Name
section, enter the virtual directory name as Customers in the text box
provided. In the Local Path section, enter the full path of the directory
containing the files that will be accessible through the virtual directory. Specify
the directory name as D:\Inetpub\Customers (The Customers directory
should be existing under Inetpub folder of IIS installation drive.)
Administering and Troubleshooting SQL Server 2000
3A.38
3: Specify the authentication for connecting to the database
Action:
1. Select the Security tab to select the authentication method for data access.
2. Verify that Use Windows Integrated Authentication option is selected, as
shown.
4: Specify the server and database name.
1. Select the Data Source tab.
2. In the SQL Server section of Data Source tab, select the default instance of
SQL Server 2000 and in the Database section, select the Customers
database from the drop-down list box.
3A.39
Administering and Troubleshooting SQL Server 2000
5: Specify the type of accessibility to the database server.
The Settings tab screen allows you to select the type of access you want to provide
to the SQL Server 2000 database server through the virtual directory. The Settings
tab screen has the following option:
Allow URL queries: This option allows you to execute queries by writing SQL
statements in the URL.
For example, consider the following statement:
http://localhost/Cutomers?sql=SELECT+Customers.Name+,+Customers.Ad
dress+From+Customers
In the above stated example, the http://localhost/Customers specifies the
virtual root connection between IIS and SQL Server 2000. The portion after sql=
specifies the SQL Server query. The + sign represents the blank spaces because
URLs does not support blank spaces.
Allow template queries: This option allows you to use an XML template file
instead of writing query directly on the URL. An XML template file is a simple file
containing the SQL statements along with some XML directives.
Administering and Troubleshooting SQL Server 2000
3A.40
Allows XPATH: This option allows controlling the structure and appearance of
the returned document. You can also embed XPATH queries in a URL query or a
template.
Allow Post: This option allows you to pass user input for the processing of
query. You can also define the maximum user input size in kilobytes.
Action:
1. Select the Settings tab.
2. Select the Allow URL queries option to execute queries through browser.
3. Select the Allow template queries option to execute queries defined in the
XML template, as shown.
4. Click the OK button to create virtual directory.
3A.41
Administering and Troubleshooting SQL Server 2000
6: Verify and access the database through browser.
Action:
1. Open Internet Explorer and enter the following query in the address bar.
http://localhost/customers?sql=SELECT+Prod_id,+sales_fig+FROM+Sale
s+FOR+XML+RAW+&root=sales
2. The output of the query is shown in the figure.
INSTRUCTOR NOTES
FAQs
1. What is the use of configuring a messaging profile?
Ans: The messaging profile contains information that is used by the MAPI client to
connect to the different mail servers, such as Microsoft Exchange Server, Microsoft
Windows Mail, or a Post Office Protocol (POP3) Server.
2. Can SQL Mail be set up using Transact-SQL?
Ans: Yes, you can set up SQL Mail using Transact-SQL. The xp_startmail system
stored procedure of Transact-SQL is used to set up the SQL Mail.
Administering and Troubleshooting SQL Server 2000
3A.42
3. How can you view the listing of linked servers in the current instance of SQL
Server 2000?
Ans: You can view the listing of all the configured linked servers using the
sp_linkedservers system stored procedure of Transact-SQL.
3A.43
Administering and Troubleshooting SQL Server 2000
SUMMARY
Additional Features of SQL Server
2000
Summary
In this lesson, you learned that:
•
The additional features of SQL Server 2000 are:
• It enables you to send and receive e-mail messages between multiple
database users.
• It enables you to link multiple databases, such as Oracle, or MS Access for
the execution of distributed queries.
• It supports XML for exchange of information across platforms.
• It also provides features for accessing databases through Internet servers,
such as IIS.
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 23 of 26
Administering and Troubleshooting SQL Server 2000
3A.44
Additional Features of SQL Server
2000
Summary (Contd.)
•
The following components of the additional features need to be configured:
• SQLMail
• SQLAgentMail
• Linked Server
• SQL Server XML support in IIS
•
SQL Mail, the mail service of SQL Server 2000, sends messages to mailboxes
and e-mail pagers using the Transact-SQL commands and xp_sendmail
extended stored procedure.
©NIIT
3A.45
Additional Features of SQL Server
Lesson 3A / Slide 24 of 26
Administering and Troubleshooting SQL Server 2000
Additional Features of SQL Server
2000
Summary (Contd.)
•
•
•
SQLAgentMail is the mail service used for SQL Server Agent services. SQL
Server Agent services are the server component that runs scheduled task of
SQL Server 2000 administration.
SQL Mail and SQLAgentMail configuration requires installation of MAPI client
such as, Microsoft Outlook on the SQL Server 2000 computer.
The system stored procedures used by SQL Mail are:
• xp_sendmail
• xp_readmail
• xp_startmail
• xp_stopmail
• xp_processmail
• xp_deletemail
• xp_findnextmsg
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 25 of 26
Administering and Troubleshooting SQL Server 2000
3A.46
Additional Features of SQL Server
2000
Summary (Contd.)
•
•
Linked server is a component that links multiple database servers to exchange
information.
SQL Server 2000 supports XML to convert an SQL Server 2000 instance into an
XML enabled database server.
©NIIT
Additional Features of SQL Server
Lesson 3A / Slide 26 of 26
In this lesson, you have learnt that:
The additional features of SQL Server 2000
are:
x
It enables you to send and receive e-mail messages between multiple
database users.
x
It enables you to link multiple databases, such as Oracle, or MS Access for
the execution of distributed queries.
x
x
It supports XML for exchange of information across platforms.
It also provides features for accessing databases through Internet servers,
such as IIS.
The following components of the additional features need to be configured:
x
x
x
x
3A.47
SQL Mail
SQLAgentMail
Linked Server
SQL Server XML support in IIS
Administering and Troubleshooting SQL Server 2000
SQL Mail, the mail service of SQL Server 2000, sends messages to mailboxes
and e-mail pagers using the Transact-SQL commands and xp_sendmail
extended stored procedure.
SQLAgentMail is the mail service used for SQL Server Agent services. SQL
Server Agent services are the server component that runs scheduled task of SQL
Server 2000 administration.
SQL Mail and SQLAgentMail configuration requires installation of MAPI client
such as, Microsoft Outlook on the SQL Server 2000 computer.
The system stored procedures used by SQL Mail are:
x xp_sendmail
x xp_readmail
x xp_startmail
x xp_stopmail
x xp_processmail
x xp_deletemail
x xp_findnextmsg
Linked server is a component that links multiple database servers to exchange
information.
SQL Server 2000 supports XML to convert an SQL Server 2000 instance into an
XML enabled database server.
Administering and Troubleshooting SQL Server 2000
3A.48
[...]... Troubleshooting SQL Server 2000 Additional Features of SQL Server 2000 Additional Components of SQL Server 2000 (Contd.) • SQL Server 2000 supports XML to convert an SQL Server 2000 instance into an XML enabled database server ©NIIT Additional Features of SQL Server Lesson 3A / Slide 11 of 26 SQL Server 2000 provides features to send and receive e-mail messages between multiple database users It provides features. . .Additional Features of SQL Server 2000 Additional Components of SQL Server 2000 (Contd.) • Besides database servers, you can also link SQL Server 2000 database to a text file or a spreadsheet as shown in the following figure: Oracle DB Server OLEDB Provider SQL Server OLEDB Provider OLEDB Provider ©NIIT 3A.11 Additional Features of SQL Server Text Files SQL Server Lesson 3A / Slide 10 of 26 Administering... Microsoft SQL Server Group->Management container option Additional Features of SQL Server Lesson 3A / Slide 15 of 26 Administering and Troubleshooting SQL Server 2000 3A.20 Additional Features of SQL Server 2000 Configuring SQL Mail and SQLAgentMail (Contd.) 3 ©NIIT 3A.21 Right-click the SQL Server Agent option, and then click the Properties option to open the SQL Server Agent Properties dialog box Additional. .. Additional Features of SQL Server Lesson 3A / Slide 16 of 26 Administering and Troubleshooting SQL Server 2000 Additional Features of SQL Server 2000 Configuring SQL Mail and SQLAgentMail (Contd.) 4 ©NIIT In the Mail Session section, from the Mail profile drop-down list box select the messaging profile as shown: Additional Features of SQL Server Lesson 3A / Slide 17 of 26 Administering and Troubleshooting SQL. .. Start->Programs->Microsoft SQL Server- >Enterprise Manager, to open the Enterprise Manager console Additional Features of SQL Server Lesson 3A / Slide 12 of 26 Administering and Troubleshooting SQL Server 2000 Additional Features of SQL Server 2000 Configuring SQL Mail and SQLAgentMail (Contd.) 2 3 ©NIIT Expand the Microsoft SQL Server Group->Support Services option Right-click the SQL Mail option, and... the SQL Mail Configuration dialog box Additional Features of SQL Server Lesson 3A / Slide 13 of 26 Administering and Troubleshooting SQL Server 2000 3A.18 Additional Features of SQL Server 2000 Configuring SQL Mail and SQLAgentMail (Contd.) ©NIIT 3A.19 4 Select the profile name from Profile name list as shown (Enter your user name.) 5 Click the Test button to verify the session of mail service Additional. .. Administering and Troubleshooting SQL Server 2000 3A.22 Additional Features of SQL Server 2000 Configuring SQL Mail and SQLAgentMail (Contd.) 5 ©NIIT Click the Test button to verify the session of mail service Additional Features of SQL Server Lesson 3A / Slide 18 of 26 Before configuring SQL Mail and SQLAgentMail, you need to install MAPI clients on the SQL Server 2000 computer In addition, you need... messages xp_findnextmsg Finds the next message in the SQL Server inbox for processing 3A.13 Administering and Troubleshooting SQL Server 2000 SQLAgentMail SQLAgentMail is the mail service of SQL Server 2000 that is used for SQL Server Agent services SQL Server Agent services are server components that run scheduled SQL Server 2000 administrative tasks SQLAgentMail is used to send e-mail notifications to... button to verify the session of mail service Additional Features of SQL Server Lesson 3A / Slide 14 of 26 Administering and Troubleshooting SQL Server 2000 Additional Features of SQL Server 2000 Configuring SQL Mail and SQLAgentMail (Contd.) • ©NIIT To configure SQLAgentMail, perform the following steps: 1 Select Start->Programs->Microsoft SQL Server- >Enterprise Manager, to open the Enterprise Manager... instance of SQL Server 2000 server that enables access to SQL Server 2000 database objects, such as tables through (Hypertext Transfer Protocol) HTTP In addition, you can also access the XML document consisting of one or more SQL statements 3A.15 Administering and Troubleshooting SQL Server 2000 INSTRUCTOR NOTES Additional Inputs Using URL to Access SQL Server 2000 You can access SQL Server 2000 using
Ngày đăng: 16/10/2015, 21:33
Xem thêm: Additional Features Of SQL Server 2000, Additional Features Of SQL Server 2000