Opis DSO w usługach Analysis Services
To use Decision Support Objects (DSO) it is essential that you first understand the concepts behind migrating Microsoft SQL Server 2000 Usługi Analysis Services databases to SQL Server Usługi Analysis Services databases.When a user runs a DSO 8.0 application for SQL Server 2000 Usługi Analysis Services in SQL Server Usługi Analysis Services, whenever the application processes an object, that object is migrated from the SQL Server 2000 Usługi Analysis Services repository to a SQL Server Usługi Analysis Services database and processed.However, all other actions in the application that affect the repository have no impact in SQL Server Usługi Analysis Services database.
All users who have legacy applications that are running on SQL Server Usługi Analysis Services have to know how to set up DSO in SQL Server Usługi Analysis Services.This topic is intended for Usługi Analysis Services database administrators and OLAP developers with experience administering, developing, and using SQL Server 2000 Usługi Analysis Services.Aby uzyskać więcej informacji, zobacz Konfigurowanie obiektów Decision Support Objects (DSO) w usługach Analysis Services, i Jak Konfigurowanie DSO w usługach Analysis Services.
Model koncepcyjny obiektów DSO
DSO 8.5 in SQL Server Usługi Analysis Services, formerly known as DSO9 in pre-release documentation, is an upgrade to the DSO libraries that were included with SQL Server 2000 Usługi Analysis Services and the service packs of that product.DSO nowe pliki w SQL Server wersja ma numer wersji 8.5.0.1054.
The following illustration shows the conceptual model of the new DSO 8.5, compared to DSO 8.0 in SQL Server 2000 Usługi Analysis Services.
Nowy model składa się z:
Metadata manager, which is the same object model that was provided with SQL Server 2000 Usługi Analysis Services service pack 4.
Menedżer procesów i migracji zastępuje Menedżera wystąpienie w DSO 8.0.
Jak pokazano na poprzedniej ilustracji, aplikacje użytkownika DSO połączyć się z 8,5 DSO łączenia się z tego samego interfejs DSO 8.0.After establishing a connection to DSO, all DSO applications actions are directed towards the SQL Server 2000 Usługi Analysis Services repository database that was installed when you set up your SQL Server Usługi Analysis Services instance to work with DSO.Unless a process method, in the DSO application, is invoked, there is no interaction with data in the SQL Server Usługi Analysis Services database.
When a process method is invoked on any object, the Process/Migration Manager reads the SQL Server 2000 Usługi Analysis Services repository.Po odczytuje repozytorium, Menedżer procesów i migracji używa SQL Server obiekt migracji serwera analizy wszystkich obiektów, które są niezbędne do przetwarzania obiektu wywołano metoda procesu migracji.The Migration Object uses AMO 9.0 to access the SQL Server Usługi Analysis Services instance.Obiekt migracji tworzy bazę danych, jeśli jest wymagana i tworzy wszystkie obiekty, które są niezbędne do jednego wywołano metoda procesu przetwarzania.Zaraz po utworzeniu wszystkich niezbędnych obiektów DS0 uruchamia przetwarzanie obiektów za pomocą przetwarzania opcja domyślne.DSO kontynuuje przetwarzanie aż do napotkania obiekt wywołujący jest przetwarzany przy użyciu opcji w metoda.
Efekty użycia obiektu aplikacji DSO
Użycie obiektu można podzielić na trzy typy:
Operacje odczytu, które szukać wartości właściwości obiektu.
Modyfikacja operacji, które zmiany metadane w repozytorium.
Przetwarzanie operacji, które należy użyć metoda procesu obiektu usługa przetwarzania obiektu.
Ostrzeżenie
In order for you to run the VBS script samples in the next sections, you must have a testing environment that includes databases from SQL Server 2000 Usługi Analysis Services that were migrated to SQL Server Usługi Analysis Services.The sample database FoodMart 2000 must be part of the SQL Server 2000 Usługi Analysis Services repository for some of the scripts to work.The testing environment must have at least one server that has SQL Server 2000 Usługi Analysis Services installed on it and one server that has SQL Server Usługi Analysis Services installed on it.DSO 8.5 musi być zainstalowany i musi być zestaw się na serwerze z systemem SQL Server.
Odczyt właściwości obiektu
All DSO read operations to any object's properties are resolved from the SQL Server 2000 Usługi Analysis Services repository and never use the SQL Server Usługi Analysis Services instance to obtain object properties.
A mixed environment in SQL Server Usługi Analysis Services with DSO enabled is defined as an environment in which there are SQL Server 2000 Usługi Analysis Services databases that have been migrated to SQL Server Usługi Analysis Services as well as other new databases that were created by using SQL Server Usługi Analysis Services.Then running a DSO application that lists all databases in a server will produce a list that contains all databases that are defined in the SQL Server 2000 Usługi Analysis Services repository, regardless of whether or not they have been migrated to SQL Server Usługi Analysis Services.However, the list will not contain any newly created SQL Server Usługi Analysis Services databases.Które można wypróbować, uruchamiając próbki DSO_ListDB.vbs i porównanie pliku dziennika wyprodukowane przed zobacz w SQL Server Management Studio w SQL Server.
Jeśli repozytoria zarówno na serwerze z systemem SQL Server i serwera z systemem SQL Server 2000, następnie skrypt daje te same wyniki, uruchomienie na obu serwerach.
Tworzenie, modyfikowanie lub upuszczanie obiektów
Using DSO to modify objects does not change them in SQL Server Usługi Analysis Services, it only changes them in the SQL Server 2000 Usługi Analysis Services repository.When your DSO application issues any command to change the structure of the existing objects in Usługi Analysis Services databases, that command connects to the SQL Server 2000 Usługi Analysis Services repository and changes the object in the repository, but the existing structure in the SQL Server Usługi Analysis Services instance is not modified.
For example, if you use DSO to create a new Sales cube in the FoodMart 2000 database and then read from the SQL Server 2000 Usługi Analysis Services repository, you will see the new cube there.However, when you review the existing objects in SQL Server Usługi Analysis Services by using SQL Server Management Studio, you will see no new Sales cube created, because nothing has been processed in DSO.
You can try this concept by first running the script DSOCreateNewSimplifiedSalesCube.vbs, then using SQL Server Management Studio to review the existing cubes in the FoodMart 2000 database on the SQL Server Usługi Analysis Services instance, You will not find the new Sales cube in it yet.However, if you read from the SQL Server 2000 Usługi Analysis Services repository running the DSOListDimensionsAndCubesProperties.vbs script, you will find that the new cube was created.
Przetwarzanie obiektów
The only moment that DSO 8.5 connects to SQL Server Usługi Analysis Services is when a process method from an object is invoked.At that time, the migration logic starts to work, reading the repository and using AMO to create objects in SQL Server Usługi Analysis Services.Minimalny wymagany następnie przetwarzane są obiekty do przetwarzania obiektów, od którego wywołano metoda procesu.
If you have been following the previous explanations and running the scripts, then by now you will have created the New Sales cube in the SQL Server 2000 Usługi Analysis Services repository, though it is not yet visible in SQL Server Usługi Analysis Services instance.Jeśli poprzednie kroki nie zostały wykonane, należy przejść wstecz do Tworzenie, modyfikowanie lub upuszczanie obiektów i uruchom skrypty opisano tam.
Uruchamianie DSOProcessFull_NewSalesCube.vbs skrypt wykonuje pełny proces na modułu NewSales, który powoduje, że moduł NewSales są widoczne w SQL Server Management Studio.If you use SQL Server Management Studio to look at the NewSales cube that was created by the script, it appears no different from any other cube that you created in SQL Server 2000 Usługi Analysis Services; it is just a regular cube with two shared dimensions.To understand how DSO is related to migration, drop the FoodMart 2000 database from SQL Server Usługi Analysis Services using SQL Server Management Studio and run again DSOProcessFull_NewSalesCube.vbs.After you run the script, you will find that all FoodMart 2000 has been migrated to SQL Server Usługi Analysis Services; only the customers and product dimensions, and the NewSales cube are processed.Now, compare the virtual cubes 'Warehouse and Sales' and 'Trained Cube' in SQL Server 2000 Usługi Analysis Services to the real cubes created in SQL Server Usługi Analysis Services.You can see that the cubes in SQL Server Usługi Analysis Services have linked measure groups defined rather than being virtual cubes, because virtual cubes no longer exist in SQL Server Usługi Analysis Services.Look for the location in SQL Server Usługi Analysis Services of the virtual dimensions 'Store Size in SQFT' and 'Store Type' from SQL Server 2000 Usługi Analysis Services.Znajdują się one zostały przekonwertowane do hierarchii w magazynie wymiar, wykrywanie, to trzeba albo procesu w magazynie wymiar za pomocą SQL Server Management Studio, lub do skryptów poza wymiar jako instrukcja create i przejrzyj XML for Analysis script. (XMLA)
As you have seen in the previous sample, every time that the process method of an object is invoked in a DSO application, the migration logic is used to create corresponding objects in SQL Server Usługi Analysis Services.For more information about the known considerations for migrating databases from SQL Server 2000 Usługi Analysis Services to SQL Server Usługi Analysis Services, see Dzielenie zmienia Analysis Services funkcji programu SQL Server 2008 R2, Zachowanie zmienia Analysis Services funkcji programu SQL Server 2008 R2, Zaprzestać Analysis Services funkcji w programie SQL Server 2008 R2, and Zdeprecjonowanej funkcji Analysis Services w programie SQL Server 2008 R2.
Skryptami VBS
Oto skryptami VBS w efekt użycia obiektu aplikacji DSO.
DSO_ListDB.vbs
Aby uruchomić skrypt, można zapisać skrypt w pliku DSO_ListDB.vbs i, w wiersz polecenia uruchom poniższy wiersz w tym samym folderze, w którym zapisano skryptu:
cscript DSO_ListDB.vbs <OLAP_ServerName>
The following code creates a log file that lists all Usługi Analysis Services databases in a SQL Server 2000 Usługi Analysis Services repository.Plik dziennika o nazwie po nazwa serwera dostarczanym jako argument.
Dim dsoServer, strServerName
Dim dsoDB, strDBName
Dim dsoCube, strCubeName
Dim dsoPartition, strPartitionState
Dim oArguments
Dim fsoOutput, fileOutput, strOutputFileName, strOutputLine
set oArguments = wscript.Arguments
if oArguments.Count < 1 then
msgbox "DSOListDB <Server Name>",,"DSO List DataBases: Sintaxis"
err.Raise 100,"DSOListDB", "Wrong Number of Arguments!."
End if
strServerName = oArguments(0)
strOutputFileName = "DSOListDB_" & strServerName & "_" & cstr(year(date)) & right("0" & cstr(month(date)),2) & right("0" & cstr(day(date)),2) & "_" & right("0" & cstr(hour(time)),2) & "_" & right("0" & cstr(minute(time)),2) & ".txt"
set dsoServer = CreateObject("DSO.Server")
set fsoOutput = CreateObject("Scripting.FileSystemObject")
Set fileOutput = fsoOutput.OpenTextFile(strOutputFileName, 8, True)
' Connect to the server.
dsoServer.Connect strServerName
fileOutput.WriteLine "Server Name: " & vbTab & dsoServer.Name
' List databases:
fileOutput.WriteLine "Database Info"
for each dsoDB in dsoServer.MDStores
fileOutput.WriteLine vbTab & "Database Name: " & dsoDB.Name
next' dsoDB
' Close connection to server.
dsoServer.CloseServer
DSOCreateNewSimplifiedSalesCube.vbs
The following code assumes that you are running it on the server that is running SQL Server Usługi Analysis Services, with DSO enabled, and with FoodMart 2000 in the SQL Server 2000 Usługi Analysis Services repository.
Poniższy kod tworzy nowy, uproszczonego moduł sprzedaży w bazie danych FoodMart 2000 bez przetwarzania go.Można zapisać kod w pliku o nazwie DSOCreateNewSimplifiedSalesCube.vbs i uruchom go bezpośrednio z ikony w Eksploratorze Windows.
Dim dsoServer
Dim dsoDB
' Initialize server.
Set dsoServer = CreateObject("DSO.Server")
dsoServer.Connect "localhost"
' Get to Work with FoodMart 2000 database
set dsoDB = dsoServer.MDStores("FoodMart 2000")
' Add the New Sales cubes, check for existence first
if dsoDB.MDStores.Find("NewSales") Then
dsoDB.MDStores.Remove("NewSales")
end if'dsoDB...Find
' Add the cube to the database.
Set dsoCube = dsoDB.MDStores.AddNew("NewSales")
dsoDB.Update
' Further define the cube.
' Set Description for new cube
dsoCube.Description = "simplified sales cube"
' Provide the data source for the cube.
dsoCube.DataSources.AddNew dsoDB.DataSources("FoodMart").Name
' Set the quoting characters from the datasource.
sLQuote = dsoCube.DataSources(1).OpenQuoteChar
sRQuote = dsoCube.DataSources(1).CloseQuoteChar
' Provide the fact table for the cube.
strSourceTable = sLQuote & "sales_fact_1997" & sRQuote
dsoCube.SourceTable = strSourceTable
' Set the estimated number of rows from the fact table
dsoCube.EstimatedRows = 86837
' Add the "product" dimension.
Set dsoProductCubeDim = dsoCube.Dimensions.AddNew("product")
' Add the "customer" dimension.
Set dsoCustomerCubeDim = dsoCube.Dimensions.AddNew("customers")
' Set the list of all tables used in this cube
' this list includes the fact table and the dimension tables
strFromClause = strSourceTable & ", " & dsoProductCubeDim.FromClause & ", " & dsoCustomerCubeDim.Fromclause
dsoCube.FromClause = strFromClause
' Define the joins between tables used by the cube.
' First, define the join between the fact table and the Customer table.
strJoinClause = "(" & strSourceTable & "." & sLQuote & "customer_id" & sRQuote & _
" = " & sLQuote & "customer" & sRQuote & "." & sLQuote & "customer_id" & sRQuote & ")"
' Define the join between the fact table and the Product table
strJoinClause = strJoinClause _
& " AND (" & strSourceTable & "." & sLQuote & "product_id" & sRQuote & _
" = " & sLQuote & "product" & sRQuote & "." & sLQuote & "product_id" & sRQuote & ")" _
& " AND (" & sLQuote & "product" & sRQuote & "." & sLQuote & "product_class_id" & sRQuote & _
" = " & sLQuote & "product_class" & sRQuote & "." & sLQuote & "product_class_id" & sRQuote & ")"
' Assign to .JoinClause
dsoCube.JoinClause = strJoinClause
Set dsoMeasure = dsoCube.Measures.AddNew("Store_Sales")
dsoMeasure.Description = "Store Sales"
dsoMeasure.SourceColumn = dsoCube.SourceTable & ".""Store_Sales"""
dsoMeasure.SourceColumnType = 3'ADODB adInteger
dsoMeasure.AggregateFunction = 0' aggSum
dsoMeasure.FormatString = "#,###"
' Update the repository.
dsoCube.Update
' Close connection to server.
dsoServer.CloseServer
msgbox "Done creating new simplified sales cube"
DSOListDimensionsAndCubesProperties.vbs
Poniższy kod zawiera listę wszystkich wymiarów i wszystkich modułów w bazie danych.Dla każdego z wymiarów lista zawiera wszystkie poziomy.Dla każdego moduł Lista zawiera wymiary, środki i partycji w module.Lista zostanie zapisana w pliku dziennika o nazwie po argumentów przedstawionych przez serwer i bazę danych.
Kod można zapisać w pliku o nazwie DSOListDimensionsAndCubesProperties.vbs.W wiersz polecenia Uruchom plik w tym samym katalogu, w którym go zapisano, z następującą składnią:
cscript DSOListDimensionsAndCubesProperties.vbs <ServerName | localhost> <DatabaseName | "FoodMart 2000">
Kod skryptu rozpoczyna się tutaj:
Dim dsoServer, strServerName
Dim dsoDB, strDBName
Dim dsoCube, strCubeName
Dim dsoPartition, strPartitionState
Dim oArguments
Dim fsoOutput, fileOutput, strOutputFileName, strOutputLine
set oArguments = wscript.Arguments
if oArguments.Count < 2 then
msgbox "DSOListDimensionsAndCubeProperties <Server Name> <OLAP DB> ",," DSO List Dimensions And Cube Properties: Sintaxis"
err.Raise 100," DSOListDimensionsAndCubeProperties ", "Wrong Number of Arguments!."
End if
strServerName = oArguments(0)
strDBName = oArguments(1)
strOutputFileName = "DSOListDimensionsAndCubesProperties_" & strServerName & "_" & strDBName & "_" & cstr(year(date)) & right("0" & cstr(month(date)),2) & right("0" & cstr(day(date)),2) & "_" & right("0" & cstr(hour(time)),2) & "_" & right("0" & cstr(minute(time)),2) & ".txt"
set dsoServer = CreateObject("DSO.Server")
set fsoOutput = CreateObject("Scripting.FileSystemObject")
Set fileOutput = fsoOutput.OpenTextFile(strOutputFileName, 8, True)
' Connect to the server.
dsoServer.Connect strServerName
' Set up the MDStore objects:
' database, cube, and partition.
Set dsoDB = dsoServer.MDStores.Item(strDBName)
fileOutput.WriteLine "Server Name: " & vbTab & dsoServer.Name
fileOutput.WriteLine "Database Name: " & vbTab & dsoDB.Name
fileOutput.WriteLine
fileOutput.WriteLine
fileOutput.WriteLine "Dimensions Info"
fileOutput.WriteLine
for each dsoDimension in dsoDB.Dimensions
fileOutput.WriteLine "Dimension: " & dsoDimension.Name
for each dsoLevel in dsoDimension.Levels
fileOutput.WriteLine vbTab &"Level: " & vbTab & dsoLevel.Name
next' dsoLevel
fileOutput.WriteLine
fileOutput.WriteLine
next' dsoDimension
fileOutput.WriteLine "Cubes Summary"
fileOutput.WriteLine
for each dsoCube in dsoDB.MDStores
fileOutput.WriteLine "Cube: " & dsoCube.Name
fileOutput.WriteLine vbTab & "# of Dimensions: " & cstr( dsoCube.Dimensions.count)
fileOutput.WriteLine vbTab & "# of Measures: " & cstr( dsoCube.Measures.count)
fileOutput.WriteLine vbTab & "# of Partitions: " & cstr( dsoCube.MDStores.count)
fileOutput.WriteLine
fileOutput.WriteLine
next' dsoCube
fileOutput.WriteLine "Cubes Info"
fileOutput.WriteLine
for each dsoCube in dsoDB.MDStores
fileOutput.WriteLine "Cube: " & dsoCube.Name
for each dsoDimension in dsoCube.Dimensions
fileOutput.WriteLine vbTab & "Dimension: " & dsoDimension.Name
for each dsoLevel in dsoDimension.Levels
fileOutput.WriteLine vbTab & vbTab &"Level: " & vbTab & dsoLevel.Name
next' dsoLevel
fileOutput.WriteLine
fileOutput.WriteLine
next' dsoDimension
for each dsoMeasure in dsoCube.Measures
fileOutput.WriteLine vbTab &"Measure: " & vbTab & dsoMeasure.Name
next' dsoPartition
fileOutput.WriteLine
fileOutput.WriteLine
for each dsoPartition in dsoCube.MDStores
fileOutput.WriteLine vbTab &"Partition: " & vbTab & dsoPartition.Name
next' dsoPartition
fileOutput.WriteLine
fileOutput.WriteLine
next' dsoCube
' Close connection to server.
dsoServer.CloseServer
DSOProcessFull_NewSalesCube.vbs
Poniższy przykładowy kod przetwarza pełni NewSales moduł w bazie danych FoodMart 2000.Można zapisać kod w pliku o nazwie DSOProcessFull_NewSalesCube.vbs i uruchom go bezpośrednio z ikony w Eksploratorze Windows.
The code assumes that you are running it on the server that is running SQL Server Usługi Analysis Services, with DSO enabled, and FoodMart 2000 in the SQL Server 2000 Usługi Analysis Services repository.Moduł NewSales mogą być tworzone przez uruchomienie DSOCreateNewSimplifiedSalesCube.vbs.
Dim dsoServer, strServerName
Dim dsoDB, strDBName
Dim dsoCube, strCubeName
Dim dsoPartition, strPartitionState
Dim oArguments
Dim fsoOutput, fileOutput, strOutputFileName, strOutputLine
strServerName = "localhost"
strDBName = "FoodMart 2000"
strCubeName = "NewSales"
' Setup log file
strOutputFileName = "DSOProcessFull_NewSalesCube_" & strServerName & "_" & strDBName & "_" & cstr(year(date)) & right("0" & cstr(month(date)),2) & right("0" & cstr(day(date)),2) & "_" & right("0" & cstr(hour(time)),2) & "_" & right("0" & cstr(minute(time)),2) & ".txt"
set fsoOutput = CreateObject("Scripting.FileSystemObject")
Set fileOutput = fsoOutput.OpenTextFile(strOutputFileName, 8, True)
fileOutput.WriteLine "Starting Job @ " & cstr(Time)
' Connect to the server.
set dsoServer = CreateObject("DSO.Server")
dsoServer.Connect strServerName
' Set up the MDStore objects:
' database, cube, and partition.
Set dsoDB = dsoServer.MDStores.Item(strDBName)
fileOutput.WriteLine "Server Name: " & vbTab & dsoServer.Name
fileOutput.WriteLine "Database Name: " & vbTab & dsoDB.Name
fileOutput.WriteLine
fileOutput.WriteLine
Set dsoCube = dsoDB.MDStores( strCubeName)
fileOutput.WriteLine "Starting to process @" & cstr(Time) & ": " & strCubeName
dsoCube.Process 1' processFull
fileOutput.WriteLine "Finished processing @" & cstr(Time) & ": " & strCubeName
msgbox "New Sales cube processed!"
Zobacz także