AMO Concepts and Object Model
Applies To: SQL Server 2016 Preview
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 Analysis Services, 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 setup installs the files, under the folder \100\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 Developing with ADOMD.NET.
This topic contains the following sections:
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 Developing with 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.
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:
|AMO Fundamental Classes||Classes required in order to work with any other set of classes.|
|AMO OLAP Classes||Classes that let you manage the OLAP objects in Analysis Services.|
|AMO Data Mining Classes||Classes that let you manage the data mining objects in Analysis Services.|
|AMO Security Classes||Classes that let you control access to other objects and maintain security.|
|AMO Other Classes and Methods||Classes and methods that help OLAP or data mining administrators to complete their daily 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 can use AMO to automate the processing of Analysis Services databases. For designing and deploying Analysis Services databases, you should use SQL Server Data Tools (SSDT).
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 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.
For data mining advanced users, AMO is most useful if you have large sets of models that periodically have to be re-trained.
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.
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.
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.
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 SQL Server Data Tools (SSDT).
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.
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 Developing with ADOMD.NET.