Automated monitoring of Bi system storage space

Source: Internet
Author: User

一个完备的BI系统有多种Log及监控机制,其中一种监控是监控BI系统存储的增长趋势,BI中所谓的存储可以分为数据仓库的存储OLAP数据库的存储


数据仓库

至少到目前为止,所有的数据仓库还是基于关系型数据库所构建的,只不过数据库的设计遵循了维度数据模型而已。所以我们可以使用SQLServer提供的一系列功能来收集数据仓库中表粒度的存储大小信息,要做到这一点我相信有很多方式,其中一种是使用系统视图:

  • sys.tables

    返回当前数据库所有的表

  • sys.partitions

    返回当前数据库中所有的分区,该视图具有rows属性标明该分区中有多少行数据。我们知道一个表至少含有一个分区,所以我们可以通过前两个视图找到表及其分区,因而也就知道一个表有多少行(当然如果只是为了找到表的行数完全没必要这么麻烦)。

  • sys.allocation_units

    返回所有的分配单元,分配单元具有很多关于数据页的信息,其中一个属性石total_pages,它标示该分配单元总共有多少个数据页面。一个分区具有一个或多个分配单元,所以我们可以通过前面三个视图找到每个表总共有多少个数据页,而每个数据页是8KB,这样就找到了每个表占多少空间。

下面是语句及返回结果展示了该种效果(因为每个表只有一个分区,所以没有做Group),我们只要将该语句封装到存储过程中就可以在ETL中使用从而自动获取DWH的存储信息:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4B/DF/wKioL1Q02PjSBew_AAJUMq9aNDw594.jpg" title="DWH Storage.png" alt="wKioL1Q02PjSBew_AAJUMq9aNDw594.jpg" />


OLAP数据库我们知道SSAS自打2008之后提供了一些系统函数可以查看类似于某个Server有多少个OLAP数据库,某个OLAP数据库有多少Cube,某个Cube有什么样的度量值组、度量值、维度等信息,但是很遗憾的是没有响应的存储信息,所以最好还是不得不使用AMO编程接口来获取OLAP数据库的存储信息。

在SSIS包的Data Flow任务中添加Script Component,然后使用如下的代码:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4B/DF/wKioL1Q029ChDfPcAAGwMAEhSG0944.jpg" title="AMP.png" alt="wKioL1Q029ChDfPcAAGwMAEhSG0944.jpg" />

最后获得的信息如下:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4B/DD/wKiom1Q026uRYQyYAAFey1plBgI752.jpg" title="OLAP INFOR.png" alt="wKiom1Q026uRYQyYAAFey1plBgI752.jpg" />


本文出自 “yubo的博客” 博客,请务必保留此出处http://yubowang.blog.51cto.com/8929119/1561215

自动化监控BI系统的存储空间

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.