Introducing AMO Concepts
Mis à jour : 14 avril 2006
This topic provides a definition of Analysis Management Objects (AMO), how AMO is related to other tools and libraries provided in the architecture of Microsoft SQL Server 2005 Analysis Services (SSAS), and a conceptual explanation of all major objects in AMO.
AMO is a complete collection of management classes for Analysis Services that can be used programmatically, under the namespace of Microsoft.AnalysisServices, in a managed environment. The classes are included in the AnalysisServices.dll file, which is usually found where the SQL Server 2005 setup installs the files, under the folder \90\SDK\Assemblies\. To use the AMO classes, include a reference to this assembly in your projects.
By using AMO you are able to create, modify, and delete objects such as cubes, dimensions, mining structures, and Analysis Services databases; over all these objects, actions can be performed from your application in the .NET Framework. You can also process and update the information stored in Analysis Services databases.
With AMO you cannot query your data. To query your data, use ADOMD.NET.
This topic contains the following sections:
AMO in the Analysis Services Architecture
Automating Administrative Tasks with AMO
AMO in the Analysis Services Architecture
An Analysis Services instance runs as a stand-alone service and communication with the service occurs through XML for Analysis (XMLA), by using either HTTP or TCP. AMO is a layer between the user application and the Analysis Services instance. This layer provides access to Analysis Services administrative objects. AMO is a class library that takes commands from a client application and converts those commands into XMLA messages for the Analysis Services instance. AMO presents Analysis Services instance objects as classes to the end user application, with method members that run commands and property members that hold the data for the Analysis Services objects.
The following illustration shows the Analysis Services components architecture, including all major elements running within the Analysis Services instance and all user components that interact with the instance. The illustration also shows that the only way to access the instance is by using the XML for Analysis (XMLA) Listener, either by using HTTP or TCP.
By design, AMO is only intended for object management and not for querying data. If the user needs to query Analysis Services data from a client application, the client application should use ADOMD.NET.
AMO is a complete library of classes designed to manage an instance of Analysis Services from a client application in managed code under the .NET Framework version 2.0.
The AMO library of classes is designed as a hierarchy of classes, where certain classes must be instantiated before others in order to use them in your code. There are also auxiliary classes that can be instantiated at any time in your code, but you will probably have instantiated one or more of the hierarchy classes before using any one of the auxiliary classes.
The following illustration is a high-level view of the AMO hierarchy that includes major classes. The illustration shows the placement of the classes among their containers and their peers. A Dimension belongs to a Database and a Server, and can be created at the same time as a DataSource and MiningStructure. Certain peer classes must be instantiated before you can use others. For example, you have to create an instance of DataSource before adding a new Dimension or MiningStructure.
A major object is a class that represents a complete object as a whole entity and not as a part of another object. Major objects include Server, Cube, Dimension, and MiningStructure, because these are entities on their own. However, a Level is not a major object, because it is a constituent part of a Dimension. Major objects can be created, deleted, modified, or processed independent of other objects. Minor objects are objects that can only be created as part of creating the parent major object. Minor objects are usually created upon a major object creation. Values for minor objects should be defined at creation time because there is no default creation for minor objects.
The following illustration shows the major objects that a Server object contains.
An instance of Analysis Services can contain multiple databases, and a database can have OLAP objects and data mining objects at the same time, with a set of helper objects. Your AMO application will connect to one of the instances in the server and a database to work with the OLAP or data mining objects. A server computer can host multiple instances of Analysis Services, and each instance of Analysis Services is seen as a different server object in AMO; each different instance is connected to a Server object by a different connection. Instances of Analysis Services are named as "<ServerName>\<InstanceName>". The following illustration shows all mentioned relationships between AMO running objects.
When programming with AMO, the association between classes and contained classes uses collection type attributes, for example Server and Dimension. To work with one instance of a contained class, you first acquire a reference to a collection object that holds or can hold the contained class. Next, you find the specific object that you are looking for in the collection, and then you can obtain a reference to the object to start working with it.
AMO is a library of classes designed to manage an instance of Analysis Services from a client application. The AMO library can be thought of as logically-related groups of objects that are used to accomplish a specific task. AMO classes can be categorized in the following way:
Classes required in order to work with any other set of classes.
Classes that let you manage the OLAP objects in Analysis Services.
Classes that let you manage the data mining objects in Analysis Services.
Classes that let you control access to other objects and maintain security.
Classes and methods that help OLAP or data mining administrators to complete their daily tasks.
Moving from DSO 8.0
For users coming from earlier versions of Analysis Services, AMO is the successor of Decision Support Objects (DSO). DSO 8.0 is a COM-type set of components that runs in an unmanaged environment, usually from a scripting environment (for example, DTS Script task) or a developed application written in VB 6 or VC++ 6 languages. By contrast, AMO objects run in a managed environment.
Applications developed in DSO 8.0 can continue to run in SQL Server 2005 Analysis Services by using DSO 9.0. However, DSO 9.0 is being deprecated.
DSO developers are encouraged to do all new development by using AMO. They are also encouraged to port their applications to a managed environment by using AMO, in any one of the available languages such as Microsoft Visual Basic .NET or Microsoft C#, or into a set of Integration Services tasks.
AMO is especially useful for automating repetitive tasks, for example creating new partitions in a measure group based on new data in the fact table, or re-training a mining model based on new data. These tasks that create new objects are usually performed on a monthly, weekly, or quarterly basis, and the new objects can easily be named, based in the new data, by the application.
Analysis Services administrators
Analysis Services administrators can use AMO to automate the processing of Analysis Services databases. For designing and deploying Analysis Services databases, you should use Business Intelligence Development Studio.
Developers can use AMO to develop administrative interfaces for specified sets of users. These interfaces can restrict access to Analysis Services objects and limit users to certain tasks. For example, by using AMO you could create a Backup application that enables a user to see all database objects, select any one of the databases, and backup it to any one of a specified set of devices.
Developers can also embed Analysis Services logic in their applications. For this, developers can create cubes, dimensions, mining structures, and mining models based on user input or other factors.
OLAP advanced users
OLAP advanced users are usually data analysts or other experienced data users who have a strong programming background and who want to enhance their data analysis with a closer usage of the data objects. For users who are required to work offline, AMO can be very useful to automate creating local cubes before going offline.
Data mining advanced users
For data mining advanced users, AMO is most useful if you have large sets of models that periodically have to be re-trained.
Automating Administrative Tasks with AMO
Most repetitive tasks are best designed, deployed, and maintained if they are developed by using Integration Services than if they are developed as an application in any language of your choice. However, for repetitive tasks that cannot be automated by using Integration Services, you can use AMO. AMO is also useful for when you want to develop a specialized application for business intelligence by using Analysis Services.
Automatic object management
With AMO is very easy to create, update or delete Analysis Services objects (for example Database, Dimension, Cube, mining MiningStructure, and MiningModel, or Role) based on user input or on new acquired data. AMO is ideal for setup applications that have to deploy a developed solution, from an independent software vendor to a final customer. The setup application can verify that an earlier version exists and can update the structure, remove no longer useful objects, and create new ones. If there is no earlier version then can create everything from scratch.
AMO can be powerful to create new partitions based on new data, and can remove old partitions that had gone beyond the scope of the project. For example, for a finance analysis solution that works with the last 36 months of data, as soon as a new month of data is received, the 37th old month could be removed. To optimize performance, new aggregations can be designed based on usage and applied to the last 12 months.
Automatic object processing
Object processing and updated availability can be achieved by using AMO to respond to certain events beyond the ordinary flow data and scheduled tasks that use Integration Services.
Automatic security management
Security management can be automated to include new users to roles and permissions, or to remove other users as soon as their time has expired. New interfaces can be created to simplify security management for security administrators. This can be simpler than using Business Intelligence Development Studio.
Automatic Backup management
Automatic backup management can be done by using Integration Services tasks, or by creating specialized AMO applications that run automatically. By using AMO you can develop Backup interfaces for operators that help them in their daily jobs.
Tasks AMO is not intended for
AMO cannot be used to query the data. To query Analysis Services data, including cubes and mining models, use ADOMD.NET from a user application. For more information, see ADOMD.NET.
14 avril 2006