惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog RSS Feed
Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
AWS News Blog
AWS News Blog
Jina AI
Jina AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
Netflix TechBlog - Medium
雷峰网
雷峰网
Vercel News
Vercel News
Latest news
Latest news
S
Security @ Cisco Blogs
W
WeLiveSecurity
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Schneier on Security
Schneier on Security
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
L
Lohrmann on Cybersecurity
T
Tor Project blog
Hugging Face - Blog
Hugging Face - Blog
TaoSecurity Blog
TaoSecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Hacker News
The Hacker News
J
Java Code Geeks
美团技术团队
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
H
Hacker News: Front Page
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CERT Recently Published Vulnerability Notes
S
Secure Thoughts
Microsoft Security Blog
Microsoft Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
B
Blog
博客园 - 三生石上(FineUI控件)
The Register - Security
The Register - Security
G
Google Developers Blog
Webroot Blog
Webroot Blog

博客园 - Robert.H.fu

国内最大的免费空间站,国内最便宜最稳定的空间 编程连接远程SQL服务器出现问题及对策 SQL Server 中的时间算法 sql server 2008 CDC sql server & excel 保持一颗好学之心 log4net 配置 在ubuntu 下安装Oracle 11g 在oracle中使用自增字段 今年国庆过得特别快 J2EE中的13种技术规范 Oracle常用数据字典表 怎样提高自己-驱动你的同事 七个爱情故事 人生拥有的,是不断的抉择 中国书信礼仪 (三) 中国书信礼仪 (二) 中国书信礼仪 (一) 学会提问
AMO 对象模型
Robert.H.fu · 2008-09-09 · via 博客园 - Robert.H.fu

SQL Server 2005中,Analysis Management ObjectAMO)是一种全新的编程对象模型。开发人员可以使用AMO创建维度,立方体,分区等Analysis Services对象。本文主要介绍AMO的对象模型,对象模型中的类,以及类中的属性和方法。
[Quick Tips]
    当你使用AMO对象进行编程的时候,如果需要处理数据库中的所有的对象,可以调用Database对象的Process()方法,并将ProcessType的属性设置为ProcessFull。如果仅仅需要处理一个单独的对象(比如维度),可以调用Process()方法,例如objDimension.Process()而不需要设置维度对象的Process属性。
简介
   
SQL Server 2000ADOMD后,AMO成为了SQL Server 2005的强大开发工具;AMO对象模型基于XML/A协议。XML/A是依据于XML协议的一个简单对象访问协议,主要用于客户端应用程序与Analysis Services进行数据交互。AMO使用XML/AAnalysis Services实现连接。AMO提交的所有操作命令都将转换成XML/A的格式。开发人员可以使用AMO自动地创建和处理Analysis Services对象模型。AMO也取代了在SQL Server 2000中使用的决策支持对象(DSO)。虽然在SQL Server 2005中同时支持DSOAMO,但是微软已经明确表示,在SQL Server 2005的下一个版本中,将全面废弃DSO,SQL Server 2005中的DSO也仅仅是为了能够将SQL Server2000种的数据迁移到SQL Server 2005中。因此,如果你正在做一个托管或者非托管的应用程序,或者你想要使用Analysis Services 2005的新特性,那么你就应该毫不犹豫地使用AMO
AMO对象模型
      AMO提供了对Analysis Services 2005对象进行管理的完整的类库,AMO的所有的类位于Microsoft.Analysis命名空间下。下图是AMO对象模型的一个高层次的视图

The Server Class

l         Is the main class in the AMO

l        Exposes the server functionality of Analysis Services

l        Contains a collection of Database objects

Property/Method

Description

Connected

Checks the current connection state (whether it's open or closed) and returns a Boolean value of true or false

Name

Retrieves the Analysis Services name

ConnectionString

Retrieves the server connection information

Connect()

Connects to Analysis Services

Disconnect()

Disconnects from Analysis Services

Add()

Adds a database to Analysis Services

Restore()

Restores a database to Analysis Services from a backup

Reconnect()

Reconnects to Analysis Services

The Database Class

l        Provides the functionality of a Database in Analysis Services

l        Contains a collection of DataSource , DataSourceView , Dimension , and Cube objects

Property/Method

Description

Name

Retrieves the Database name

Backup()

Backs up a Database to a specific location

Drop()

Drops a Database

Process()

Processes a Database and all the objects contained in the Database

Update()

Saves the Database to Analysis Services

Add()

Adds a DataSource , DataSourceView , Dimension , or Cube object to the database

The RelationalDataSource Class

l        Represents the DataSource object in Analysis Services

l        Inherits properties and methods from the DataSource class of the AMO

l         Should be used instead of the DataSource class when creating a DataSource object

Property/Method

Description

ConnectionString

Sets the data source information

Update()

Saves the DataSource object to Analysis Services

The DataSourceView Class

l        Represents the DataSourceView object in Analysis Services

Property/Method

Description

DataSourceID

Associates a DataSource with the DataSourceView ; also retrieves the current DataSource associated with the DataSourceView

Schema

Assigns a table schema to the DataSourceView

Update()

Saves the DataSourceView to Analysis Services

The Dimension Class

l        Represents the Dimension object in Analysis Services

l        Contains a collection of Attribute and Hierarchy objects

Property/Method

Description

Source

Sets the Dimension 's source

ProcessingMode

Sets the processing mode of the Dimension ; possible values are Regular and LazyAggregation

StorageMode

Sets the storage mode of the Dimension ; possible values are ROLAP and MOLAP

WriteEnabled

Write-enables a Dimension

Update()

Saves a Dimension to Analysis Services

Process()

Processes a Dimension

The Hierarchy Class

l        Represents the Hierarchy object in Analysis Services

l        Is associated with the Dimension

Property/Method

Description

Name

Sets the name of the Hierarchy

AllMemberName

Sets the name of the AllMemberName in the Hierarchy

Add()

Adds a Level to the Hierarchy

The Level Class

l        Represents the Level object in Analysis Services

l        Is associated with a Hierarchy

Property/Method

Description

Name

Sets the name of the Level

SourceAttribute

Sets the source Attribute for the Level

The DimensionAttribute Class

l        Represents the Attribute object in Analysis Services

l         Is used as the source for the Level in the Hierarchy , or as a MemberProperty in the Level

Property/Method

Description

KeyColumns

Sets the key column for an Attribute

NameColumn

Sets the name column for an Attribute

Usage

Sets the Attribute usage. Possible Attribute values are Regular , Key , Parent , and Account

DefaultMember

Sets the DefaultMember in the Attribute

Add()

Adds a MemberProperty

The AttributeRelationships Class

l        Represents the MemberProperty object in Analysis Services

Property/Method

Description

Name

Retrieves the MemberProperty name

Visible

Retrieves the visibility of the MemberProperty (whether it's visible to the browser/client application)

AttributeID

Retrieves the AttributeID that is used by the MemberProperty

Parent

Retrieves the Level that contains the MemberProperty

The Cube Class

l        Represents the Cube object in Analysis Services

l        Contains a collection of MeasureGroup objects

Property/Method

Description

StorageMode

Sets the default storage mode of the Cube ; possible values are ROLAP , HOLAP , and MOLAP

ProcessingMode

Sets the default processing mode of the Cube ; possible values are Regular and LazyAggregation

Source

Sets the source of the Cube

Process()

Processes the Cube and all objects contained in the Cube

Add()

Adds a MeasureGroup and MDX script into the Cube

Update()

Saves the Cube and all the objects contained in the Cube to Analysis Services

The MeasureGroup Class

l        Represents the MeasureGroup object in Analysis Services

l         Contains a collection of Measure and Partition objects

Property/Method

Description

StorageMode

Sets the storage mode of the MeasureGroup ; the storage mode can be ROLAP , HOLAP , or MOLAP

Add()

Adds a Dimension , a Measure , and a Partition into the MeasureGroup

The Measure Class

l        Represents the Measure object in Analysis Services

Property/Method

Description

Source

Sets the Measure class's source

FormatString

Formats the Measure

Visible

Sets the visibility of the Measure ; if set to visible, the Cube browser and client application will be able to view the Measure

DisplayFolder

Creates a folder to group and categorize the Measure

The Partition Class

l        Represents the Partition object in Analysis Services

Property/Method

Description

Source

Sets the source of the Partition

ProcessingMode

Defines the processing mode of the Partition ; possible values are Regular and LazyAggregation

StorageMode

Defines the Partition class's storage mode; the storage modes can be ROLAP , HOLAP , or MOLAP

Slice

Specifies the data slice or portion of data contained in the Partition ; is used when creating two or more Partition classes