1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu MASTERING SQL SERVER 2000- P22 ppt

50 300 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 1,55 MB

Nội dung

CHAPTER 28 • ANALYSIS SERVICES 1070 FIGURE 28.15 Selecting training data in the Mining Model Wizard Click Next to move to the Create Dimension and Virtual Cube panel. This panel allows you to capture the results of the data-mining process for further analysis. In this example, you’ll name the dimension Customer Analysis and the virtual cube Mined Cube. A virtual cube, you’ll recall, is a cube that contains information from other cubes—in this case, the Sales_1998 cube and the mined data. Click Next to move to the finish panel of the Mining Model Wizard. Here you must assign a name to the model. You’ll choose Customer Analysis Model as a name. Select Save and Process Now, and click Finish to create the data-mining model. After the model has been processed, you can right-click it in Analysis Manager and choose Browse to see the results of the analysis. Figure 28.16 shows a data- mining model open in the Data Mining Model Browser. The different shadings used in the model indicate how strongly the input data correlates with the factor being predicted. Analysis Services automatically arranges factors to show you the most sig- nificant ones first. In this particular model, whether the customer had better than a partial high school education is the most significant factor in predicting yearly income. You can use the Content Navigator in the upper-right-hand corner of the Browser to drill down to increasingly less important factors. 2627ch28.qxd 8/22/00 11:29 AM Page 1070 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 1071 FIGURE 28.16 Browsing a data-mining model OLAP from the Client So far, all of the OLAP we’ve looked at has been done directly at a server running Microsoft SQL Server Analysis Services. However, there are alternatives that will retrieve OLAP information from a client. In this section, we’ll show you two of these alternatives. The first is an older technique that doesn’t use Analysis Services at all: T-SQL includes two operators, CUBE and ROLLUP, that let you perform some OLAP analysis without any software beyond SQL Server itself. The second technique we’ll demonstrate is that of using Microsoft Excel as a way to browse data that’s stored in Analysis Services cubes. OLAP FROM THE CLIENT Advanced Topics PART VI 2627ch28.qxd 8/22/00 11:29 AM Page 1071 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 28 • ANALYSIS SERVICES 1072 CUBE and ROLLUP Queries For quick cube analysis of data stored on SQL Server, you can use the CUBE and ROLLUP operators in a SELECT statement: SELECT <select clauses> GROUP BY expression WITH CUBE SELECT <select clauses> GROUP BY expression WITH ROLLUP Either CUBE or ROLLUP can be used with the full spectrum of clauses in the SELECT statement that you saw in Chapter 6: FROM, WHERE, ORDER BY, and so on. The exception to this rule is that you can’t use DISTINCT with an aggregate clause and either CUBE or ROLLUP. If you include, for example, COUNT(DISTINCT CustomerID) and CUBE in the same SQL statement, SQL Server will return an error message. CUBE and ROLLUP can be used only as part of a GROUP BY clause. They add addi- tional rows to the result set beyond those normally generated by the GROUP BY clause. If you specify WITH CUBE as part of a GROUP BY clause, each possible group- ing level is summarized in all possible combinations. If you specify WITH ROLLUP in a GROUP BY clause, a hierarchical set of summary rows is introduced. Some examples will make this clear. First, consider this query (performed on data from the Northwind sample database) without CUBE or ROLLUP: SELECT OrderDate, ShipCountry, EmployeeID, COUNT(OrderID) AS TotalOrders FROM Orders GROUP BY OrderDate, ShipCountry, EmployeeID ORDER BY OrderDate, ShipCountry, EmployeeID Figure 28.17 shows the results of running this query in SQL Server Query Analyzer. Each row in the result comes directly from taking one combination of the GROUP BY fields. For example, the first row shows that there was one order on July 4th shipped to France taken by employee number 5. 2627ch28.qxd 8/22/00 11:29 AM Page 1072 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 1073 FIGURE 28.17 Simple GROUP BY query If you add the WITH CUBE operator to this query, the SQL changes only slightly: SELECT OrderDate, ShipCountry, EmployeeID, COUNT(OrderID) AS TotalOrders FROM Orders GROUP BY OrderDate, ShipCountry, EmployeeID WITH CUBE ORDER BY OrderDate, ShipCountry, EmployeeID Figure 28.18 shows the results of this new SELECT statement. The first row of these results shows that there are 830 total orders. The second shows that 123 were taken by employee number 1. Row 11 in the result set shows that 16 orders were shipped to Argentina. Note that the NULL values can appear in any column of a WITH CUBE query. WITH CUBE summarizes the results along all possible axes. OLAP FROM THE CLIENT Advanced Topics PART VI 2627ch28.qxd 8/22/00 11:29 AM Page 1073 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 28 • ANALYSIS SERVICES 1074 FIGURE 28.18 GROUP BY WITH CUBE On the other hand, you can also add the WITH ROLLUP operator to the original query: SELECT OrderDate, ShipCountry, EmployeeID, COUNT(OrderID) AS TotalOrders FROM Orders GROUP BY OrderDate, ShipCountry, EmployeeID WITH ROLLUP ORDER BY OrderDate, ShipCountry, EmployeeID The results of this final query are shown in Figure 28.19. In this query, the loca- tions of the NULL values are constrained to be at the end of the hierarchy of ROLLUP columns. For example, you can have a NULL in EmployeeID alone, or in ShipCountry and EmployeeID, but not in ShipCountry alone. A WITH ROLLUP query is most use- ful for providing the information necessary for a report with subtotals, rather than the multidimensional analysis of a WITH CUBE query or a true cube produced with Analysis Services. 2627ch28.qxd 8/22/00 11:29 AM Page 1074 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 1075 FIGURE 28.19 GROUP BY WITH ROLLUP Using Excel to Retrieve Data from Analysis Services You can also use the full power of Analysis Services from client applications. This is made possible by the Microsoft PivotTable Service, a client-side implementation of Analysis Services. The PivotTable Service is included with Microsoft Excel 2000. New in SQL Server 2000 Analysis Services is the ability to connect the PivotTable Service to an analysis server using HTTP as the protocol—that is, to use the Internet to retrieve data from an analysis server. In this section, we’ll show you how to set this up and display information on a client across the Internet. First, you need to set up some prerequisites: 1. Internet Information Server must be running on the same computer as the analysis server. 2. You need to copy the msolap.asp file, installed by Analysis Services in the Program Files\OLAP Services\bin directory, to the Inetpub\wwwroot directory so that the file is accessible to Internet Information Services. OLAP FROM THE CLIENT Advanced Topics PART VI 2627ch28.qxd 8/22/00 11:29 AM Page 1075 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 28 • ANALYSIS SERVICES 1076 3. You must install the SQL Server 2000 Client Tools on the computer where you will design and display the Excel worksheet. Then, to display data from a remote analysis server on an Excel 2000 worksheet via HTTP, follow these steps: 1. Launch Microsoft Excel 2000 with a new, blank worksheet. 2. Select Data ➣ PivotTable and PivotChart Report. This will launch the PivotTable and PivotChart Report Wizard. 3. Select External Data Source as the source of the data. Click Next. 4. Click Get Data to open the Choose Data Source dialog box. 5. Select the OLAP Cubes tab of the Choose Data Source dialog box. 6. Select <New Data Source> and click OK. 7. Assign a name to your new data source. 8. Select Microsoft OLE DB Provider for OLAP Services 8.0 as the OLE DB provider to use. Be sure to select the provider with the 8.0 version number. 9. Click Connect to open the Multidimensional Connection dialog box, shown in Figure 28.20. Enter the Web address of the computer that’s running Analysis Ser- vices. You can use either the http://servername form or the http://IP Address form of the server address. You don’t need to enter authentication information if the Internet Information Server accepts anonymous connections. FIGURE 28.20 Multidimensional Connection dialog box 2627ch28.qxd 8/22/00 11:29 AM Page 1076 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 1077 10. Click Next. Select the Analysis Services database that contains the cube with the information that you wish to display and click Finish. 11. Select the cube that you wish to display and click OK twice to return to the PivotTable and PivotChart Wizard. 12. Click Next, select a location for the PivotTable, and click Finish. The result of this process will be an Excel PivotTable that’s connected to a cube on the analysis server via the HTTP protocol. You can drag fields from the PivotTable field well (the list of fields on the PivotTable toolbar) to the worksheet to define the display of the cube, just as if the data had originated in Microsoft Excel. Figure 28.21 shows a PivotTable based on an Analysis Services cube. FIGURE 28.21 Displaying a cube in Excel Summary In this chapter, you learned about online analytical processing (OLAP) and the tools that SQL Server 2000 provides to do this sort of analysis. The primary tool is Microsoft SQL Server 2000 Analysis Services, a full-featured OLAP analysis product. OLAP FROM THE CLIENT Advanced Topics PART VI 2627ch28.qxd 8/22/00 11:29 AM Page 1077 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 28 • ANALYSIS SERVICES 1078 You learned the basic terminology of OLAP and saw how to use Analysis Services to extract aggregate information from a large amount of data. You also saw how Analysis Services performs data mining and learned how to display OLAP results in client applications. In the next chapter, we’ll introduce another product that ships as part of the SQL Server 2000 package: Microsoft English Query, which allows you to pose questions in everyday language instead of the formal language of T-SQL. 2627ch28.qxd 8/22/00 11:29 AM Page 1078 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 29 Microsoft English Query FEATURING: What Is English Query? 1080 English Query Components 1081 Creating an English Query Application 1084 Deploying an English Query Application 1098 Summary 1100 2627ch29.qxd 8/22/00 11:30 AM Page 1079 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... Error logs in SQL Server 2000 are stored in two places—the first is the SQL Server error logs Use the following steps to access the SQL Server 2000 error logs: 1 Open Enterprise Manager from the Microsoft SQL Server menu under Programs on the Start menu 2 Expand your server under the SQL Server Group icon and then expand Management 3 Under Management, expand SQL Server Logs 4 Under SQL Server Logs,... users have with SQL Server is the need to use the T -SQL language when asking for information from a database Many hours of development effort have been invested in coming up with interfaces to hide the details of this process from the users SQL Server 2000 includes a tool named Microsoft English Query (completely overhauled from the tool of the same name that was shipped as part of SQL Server 7) that’s... Troubleshooting the Services (MSSQLServer and SQLServerAgent) 1117 Summary 1117 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark 2627ch30.qxd 8/22/00 11:32 AM Page 1102 E ven though Microsoft has developed one of the best database systems on the market, there will still be problems These problems may come from hardware failure, user error, or perhaps even SQL Server itself Regardless... your users to ask questions in plain English instead of Transact -SQL, and how to create and deploy an English Query application to a Web server In the book so far, you’ve learned how to use SQL Server to store and manage your information In the final chapter, we’ll discuss the troubleshooting steps that you can use to fix things when SQL Server does not behave as you expect Please purchase PDF Split-Merge... FrontPage extensions installed on your Web server • You must have permission to write to the root on the Web server • You must be an operator on the Web server Once you’ve met these requirements, you can follow this procedure to deploy your application to the Web server: 1 Select Project ➢ Deploy ➢ Web 2 On the first step of the Web Project Wizard, choose the server that you wish to use to deploy your... administrator to successfully set up SQL Server • Make sure that you have enough disk space to install SQL Server; this is a simple but common problem • If you are using a domain account for your services, make sure you have the right password and that the Caps Lock key is not on accidentally (simple, but common) If you are still having problems with setup, you need to read the sqlstp.log file, located in the... the control WARN ING You must make sure that every user of an English Query application has a SQL Server client access license Creating an English Query Application In this section, we’ll walk through the process of creating a typical English Query application, using the Northwind sample database from SQL Server 2000 as the underlying database We’ll cover five steps in this process: 1 Preparing the... Here you should select the appropriate OLE DB provider and database for your English Query project In this chapter, we’ll use the SQL Server provider to access a copy of the Northwind sample database After selecting the database, click OK to launch the Wizard itself The SQL Project Wizard uses only two panes (and it doesn’t use the familiar Next/Back/Finish Wizard interface) In the first pane, you... more common problems and offer some solutions so that you can get your server up and running as fast as possible Before we can get into specific areas, though, we need to discuss some troubleshooting methods that cover a broad scope of problems General Troubleshooting Imagine the results if you were to randomly apply fixes to SQL Server in hopes of solving a problem There would be chaos, and the problem... database by using plain English instead of SQL queries In this chapter, we’ll explain the basic concepts of English Query and show how you can use it to enable natural language querying for a database What Is English Query? English Query is a tool that builds specialized applications based on a relational database (the database may be stored on either SQL Server or Oracle) These applications allow . processing (OLAP) and the tools that SQL Server 2000 provides to do this sort of analysis. The primary tool is Microsoft SQL Server 2000 Analysis Services, a. users. SQL Server 2000 includes a tool named Microsoft English Query (completely overhauled from the tool of the same name that was shipped as part of SQL Server

Ngày đăng: 26/01/2014, 08:20

TỪ KHÓA LIÊN QUAN