SQL Server Analysis Services SSAS Processing Error Configurations
转载:https://www.mssqltips.com/sqlservertip/3476/sql-server-analysis-services-ssas-processing-error-configurations/
Problem
What are the different methods of dealing with errors in SQL Server Analysis Services (SSAS) processing and should I change the default options? What are the SSAS error processing options for a cube, a partition, or a dimension? How can you change the SSAS error processing configuration?
Solution
SQL Server Analysis Services (SSAS) actually offers an array of various error handling techniques for common issues that surface when processing a cube, a partition, or a dimension. These properties allow you to set various error number thresholds for stopping processing while at the same time telling SSAS how to handle specific errors that occur. As with many features, you need to be careful to use these options appropriately and with full knowledge of the impact on your data. Many of the options often would violate foreign key constraint issues that normally would surface in a normalized OLTP database. To the contrary, the error processing options provide a great way for cube processing to continue when only minor or immaterial errors occur during cube processing which in turn provides for great "up and running" time for the cubes themselves.
We will use the Adventure Works databases as the basis for our SSAS cube processing. The 2014 versions of the regular and data warehouse databases, along with the SSAS cube database backups are available on Codeplex at https://msftdbprodsamples.codeplex.com/releases/view/125550. Once you download and install the SQL Server databases and the MultiDimensional SSAS cube database, we will subsequently use SQL Server Data Tools (SSDT-BI) for Visual Studio 2013 to work through the cube processing examples.
Setting the SSAS ErrorConfiguration Properties
As shown in the next illustration the default error configuration for an SSAS cube is not surprisingly "default". In actuality, 9 properties make up the error configuration setting and each property has its own default value as shown in the second illustration below.
Each of the 9 properties controls slightly different processing results and several of the settings have the same potential values that can be selected. The properties include:
- CalculationError - Determines what occurs when an error is found in a calculation created on the Calculation tab.
- KeyDuplicate - Determines what occurs when duplicate keys are found in a dimension.
- KeyErrorAction - Determines what action is implemented when a KeyNotFound error occurs. The two options are ConvertToUnknown and DiscardRecord.
- KeyErrorLimit - Determines how many errors can be recorded before processing stops, -1 allows for unlimited errors.
- KeyErrorLogFile - Notes the location of the SSAS processing error log file, the SSAS service account must have access to the directory.
- KeyNotFound - Determines what occurs when a foreign key in the fact table does not have a matching primary key value in the related dimension table.
- NullKeyConvertedToUnknown - Determines what occurs when null values are converted to unknown members.
- NullKeyNotAllowed - Determines what occurs when null values are not allowed.
The option grid below shows the actions available for the CalculationError, KeyNotFound, KeyDuplicate, NullKeyNotAllowed, and NullKeyConvertedToUnknow:
|
Error Option |
Log Error? | Count Error? | Continue Processing? |
|---|---|---|---|
| IgnoreError | No | No | Yes |
| ReportAndContinue | Yes | Yes | Yes |
| ReportAndStop | Yes | Yes | No |
The difficult thing with setting the error configurations is that they can be set in one or more of all the following places:
- Cube properties
- Dimension properties
- Partition properties
- During processing of any of the above
Furthermore, NULL processing methods always occur first before the error configurations are implemented and in some cases the Unknown Member settings in a dimension must be set in a specific way to interact with the error configuration properties.
SQL Server Analysis Services Error Processing Example
So what does all this mean; it means that you need to make sure you understand and use the proper setting when you process your cubes, partitions, and dimensions.
Let us look at a few examples; I am going to make changes to the PromotionKey field in the FactInternetSales fact table and the related primary key, PromotionKey in the DimPromotion table. To be able to show you the various examples, I did need to remove the constraint on the PromotionKey field in the fact table. I then updated the PromotionKey in the fact table to a value that I knew was not a valid primary key value in the Promotion Dimension source table. As illustrated below, I updated the value to 88888.
Now when the cube is processed the below attribute key not found error results.
One option, which is shown below, is to change the KeyNotFound to IgnoreError. This change means that any key not found errors will not be counted in the error count nor will they be logged. Also, based on the KeyErrorAction field which is set to ConvertToUnknown, the invalid PromotionKey value will be converted to Unknown.
The result of this setting is that the cube processes without reporting any errors as shown below. Of course, this result is a false positive, in that the cube did process fine; however, the offending data row was actually "quarantined" so to speak and the data is not included in the fact table measure values reported to the client application and report. The row is absent from the data, and we actually have no knowledge that a problem even existed.
We could create a similar situation processing wise while at least getting a report of the errors by changing two fields: 1) change the KeyNotFound property to ReportAndContinue and 2) Adjusting the KeyErrorLimit to a number below which we will accept errors. In this scenario, we are requesting that the error be reported (both via the processing window and the log, which we will discuss later) and also that processing will stop if we see more than 10 errors.
Now when the cube is processed, the processing still completes and the row is still removed from the measure data. However, we receive a notification that a key error does exist, as displayed next. An error message is displayed in the processing window, that specifically tells us what error occurred, i.e. the missing promotion value.
Next, by adding a path and file name to the KeyErrorLogFile property, the errors will get logged to a log file.
The below error log clearly shows the PromotionKey error while still processing the cube to completion. Even so, the invalid row is still removed from the cube results; using the cube browser a copy of the data results are displayed in the second screen print below and do not include the invalid key data row.
Up to this point, the offending row has been removed from the dataset returned to the client application. We could allow the row to show as an "Unknown" value by making two adjustments to the dimension that is causing the error, Promotion for our example. First, within the dimension properties, the UnknownMember property needs to be set to Visible. Second, the UnknownMemberName should be updated to a relevant value for your situation as this name will be what is displayed to the end user.
Now when the cube data is reviewed, the offending row is displayed with, in the below example, with a specific name of "NEED TO BE UPDATED IN NEXT RUN".
Although we concentrated on KeyNotFound property, similar error configuration processing methods could be followed with the KeyDuplicate, CalculationError, NullKeyConvertedToUnknown, and NullKeyNotAllowed error properties, and thus will not go over those in detail.
In addition to the cube error configuration property settings, these same setting can be adjusted both at the partition and dimension level, as shown in the next two figures, which can override the cube settings.
Furthermore, during the actual cube processing, we can adjust / override how errors are handled. First, the cube processing must be initiated and then the Change Settings button clicked as illustrated below.
Next, clicking on the Dimension key errors tab and then Use customer error configuration radio button, allows us to adjust the error setting at processing "run time."
In the above screen print example, I left the Number of errors to 0; thus a single error will now stop processing of the cube. As such, the cube quickly errors out with these "run time" settings; allowing no errors for this example.
Conclusion
Out of the box, SSAS has default settings for handling errors; these settings, which exist under the ErrorConfiguration property, allow for various outcomes to occur while processing a cube, partition, or dimension. Five of the properties control whether an error is reported and processing continues, or an error is reported and processing stops, or whether the error ignored and not reported.
Furthermore, NullProcessing of values is handled first during processing, as this defines how the NullKeyConvertedToUnknown and NullKeyNotAllowed errors are handled. When the number of allowable errors is increased to a number greater than zero, the cube will continue processing until the number of errors reported meets the new threshold level.
However, when the error method is set to report and continue or ignore, the offending rows will not be included in the measure values unless the UnknownMember properties are set for the related dimension. To further complicate the situation, the ErrorConfiguration settings can be set at the cube level, the partition level, the dimension level, or during the processing itself.
With all these scenarios, much care must be followed when using the non-default ErrorConfiguration settings.
Next Steps
- Check out these resources
SQL Server Analysis Services SSAS Processing Error Configurations的更多相关文章
- 使用SQL Server Analysis Services数据挖掘的关联规则实现商品推荐功能(七)
假如你有一个购物类的网站,那么你如何给你的客户来推荐产品呢?这个功能在很多电商类网站都有,那么,通过SQL Server Analysis Services的数据挖掘功能,你也可以轻松的来构建类似的功 ...
- SQL Server Analysis Services 数据挖掘
假如你有一个购物类的网站,那么你如何给你的客户来推荐产品呢?这个功能在很多 电商类网站都有,那么,通过SQL Server Analysis Services的数据挖掘功能,你也可以轻松的来构建类似的 ...
- SQL Server Analysis Services 数据挖掘(1)
来源: http://technet.microsoft.com/zh-cn/library/dn633476.aspx 假如你有一个购物类的网站,那么你如何给你的客户来推荐产品呢?这个功能在很多 电 ...
- SQL Server Reporting Services – Insufficient Rights Error
http://www.sql-server-performance.com/2011/security-ssrs-reporting-error/ SQL Server Reporting Servi ...
- 全半角空格导致的Sql Server Analysis Services处理错误(转载)
问题描述 某维度表的字符串列同时出现两条记录,A记录以半角空格(英文空格)结束,B记录以全角空格(中文空格)结束,除此之外其他部分均相同.Analysis Service处理的时候抛出“Key not ...
- Sql Server Analysis Service 处理时找到重复的属性键、找不到属性键错误(转载)
这是两个非常常见的SSAS处理异常,网上也能找到很多文章讲解决办法,但很少见关于异常原因的分析,先来看看第一个" OLAP 存储引擎中存在错误: 处理时找到重复的属性键",一个维度 ...
- Error after SQL Server 2012 installation: Login Failure for "SQL Server Integration Services 11.0" SSIS service
When you install SQL Server 2012 and you try to connect to SSIS services, you cannot due to that the ...
- [转]SQL Server Reporting Services - Timeout Settings
本文转自:https://social.technet.microsoft.com/wiki/contents/articles/23508.sql-server-reporting-services ...
- [转]Creating Mailing Labels in SQL Server Reporting Services (rdlc 数据1页 2竖排 显示)
本文转自:http://blogs.wrox.com/article/creating-mailing-labels-in-sql-server-reporting-services/ Most wo ...
随机推荐
- web系统测试 - 理解网络协议1 - 互联网历史沿革
1. web1.0,web2.0,web3.0的区别? web1.0:信息的获取者和消费者,信息由网站运营商创建 web2.0:用户创建内容(UGC: user generated content,论 ...
- IOS的Crash情况在Crashlytics平台上统计解决方案的一点遗憾(截止到2015年6月14日)
平台针对特定版本的monkey操作后数量统计,按时间段定时去获取,最后根据操作批次出具分析报告: 问题是crashlytics平台仅提供一个BS登录查看WEB后台,所以无法通过API或者DB去直接获取 ...
- Your build settings specify a provisioning profile with the UUID, no provisioning profile
在Archive项目时,出现了“Your build settings specify a provisioning profile with the UUID “”, however, no suc ...
- PHP学习心得(1)——实用脚本
<?php 来表示 PHP 标识符的起始,然后放入 PHP 语句并通过加上一个终止标识符 ?> 来退出 PHP 模式 调用函数phpinfo(),将会看到很多自己系统的信息,以及预定义变量 ...
- OD19
这个程序关掉之后会出现一个NAG窗口 甚是讨厌 于是我们要想办法干掉他,先查壳 发现没有壳 VC写的 加载进一个工具reshecker试试,发现一个我们要找的对话框, 那我们记住这个位置 1 ...
- zenefits oa - random(5) to generate a random(7)
If given a function that generates a random number from 1 to 5, how do you use this function to gene ...
- Cocos2d-x win7 + vs2010 配置图文详解
Cocos2d-x win7 + vs2010 配置图文详解 下载最新版的cocos2d-x.打开浏览器,输入cocos2d-x.org,然后选择Download,本教程写作时最新版本为cocos2d ...
- Lua小技巧
来公司以后,业务逻辑都用lua写.写了好长时间了,到最近才觉得有点掌握了Lua的灵活.最近用Lua写了个类似集合一样的东西,如果两次向集合里放入同一个元素,就会报错,方便检查配置.代码如下: -- k ...
- C(++) Websocket实现扫码二维码登录---GoEasy
最近在做一个扫码登录功能,为此我还在网上搜了一下关于微信的扫描登录的实现方式.当这个功能完成了后,我决定将整个实现思路整理出来,方便自己以后查看也方便其他有类似需求的程序猿些. 要实现扫码登录我们需要 ...
- PHP character garbled
MySql 控制台查询时出现乱码 Database&Table 的字符集 于Mysql控制台显示的字符集不一样 右键单击mysql控制台边框 单击属性 查看当前代码页的字符集模式是否于数 ...