转载: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

SQL Server Analysis Services SSAS Processing Error Configurations的更多相关文章

  1. 使用SQL Server Analysis Services数据挖掘的关联规则实现商品推荐功能(七)

    假如你有一个购物类的网站,那么你如何给你的客户来推荐产品呢?这个功能在很多电商类网站都有,那么,通过SQL Server Analysis Services的数据挖掘功能,你也可以轻松的来构建类似的功 ...

  2. SQL Server Analysis Services 数据挖掘

    假如你有一个购物类的网站,那么你如何给你的客户来推荐产品呢?这个功能在很多 电商类网站都有,那么,通过SQL Server Analysis Services的数据挖掘功能,你也可以轻松的来构建类似的 ...

  3. SQL Server Analysis Services 数据挖掘(1)

    来源: http://technet.microsoft.com/zh-cn/library/dn633476.aspx 假如你有一个购物类的网站,那么你如何给你的客户来推荐产品呢?这个功能在很多 电 ...

  4. SQL Server Reporting Services – Insufficient Rights Error

    http://www.sql-server-performance.com/2011/security-ssrs-reporting-error/ SQL Server Reporting Servi ...

  5. 全半角空格导致的Sql Server Analysis Services处理错误(转载)

    问题描述 某维度表的字符串列同时出现两条记录,A记录以半角空格(英文空格)结束,B记录以全角空格(中文空格)结束,除此之外其他部分均相同.Analysis Service处理的时候抛出“Key not ...

  6. Sql Server Analysis Service 处理时找到重复的属性键、找不到属性键错误(转载)

    这是两个非常常见的SSAS处理异常,网上也能找到很多文章讲解决办法,但很少见关于异常原因的分析,先来看看第一个" OLAP 存储引擎中存在错误: 处理时找到重复的属性键",一个维度 ...

  7. 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 ...

  8. [转]SQL Server Reporting Services - Timeout Settings

    本文转自:https://social.technet.microsoft.com/wiki/contents/articles/23508.sql-server-reporting-services ...

  9. [转]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 ...

随机推荐

  1. 用jQuery做一个三级菜单,鼠标移动到二级菜单的选项上,然后再迅速离开后,当鼠标再移动到该一级菜单或其他二级菜单选项,三级菜单也会显示。

    用jQuery做一个三级菜单,鼠标移动到二级菜单的选项上,然后再迅速离开后,当鼠标再移动到该一级菜单或其他二级菜单选项,三级菜单也会显示. 原因:在为一个元素绑定hover事件之后,用户把光标移入元素 ...

  2. foreach循环 Java

    第一次遇到foreach循环,是在PHP的数组中,同样,在Java数组中,也遇到了foreach循环,都是用来遍历数组(集合).遍历数组,首先想到的一般都是用while,do while,for循环, ...

  3. NSOperation操作依赖和监听

    1.操作依赖 NSOperation之间可以设置依赖来保证执行顺序 比如一定要让操作A执行完后,才能执行操作B,可以这么写 [operationB addDependency:operationA]; ...

  4. oracle xmltype导入并解析Excel数据 (二)规则说明

    规则表字段说明如下: 其中RULE_FUNC_CUSTOMIZE表示,用户自己写函数,去判断数据是否合法,存储的是函数的名字 此函数的参数只有一个,该列的值,字段类型是Varchar2, 校验失败的话 ...

  5. 字符数组和string判断是否为空行 NULL和0 namespace变量需要自己进行初始化

    string 可以这样判断空行input !="" 字符数组可以通过判断第一个元素是否为空字符'\0',是的话为空行arrar[0]=='\0':或者用长度strlen(char ...

  6. MAC解决端口占用

    1.前言 启用goagent.firefly等服务的时候,如果非正常退出,再次启动经常会遇到address already in use,端口被先前启动的服务进程所占用,导致服务无法使用.这种情况,可 ...

  7. Jquery和Javascript 实际项目中写法基础-弹出窗和弹出层 (4)

     一.实际项目中有很多如下界面效果.    二.该效果可以归结为弹出窗或者弹出层来实现的,为什么这么说?看如下代码:      <!DOCTYPE html> <html> & ...

  8. 在 2016 年学 JavaScript 是一种什么样的体验?

    转 译者:方应杭 嘿,我最近接到一个 Web 项目,不过老实说,我这两年没怎么接触 Web 编程,听说 Web 技术已经发生了一些变化.听说你是这里对新技术最了解的 Web 开发工程师? 准确地说,我 ...

  9. js 获取当前焦点所在的元素、给元素和input控件添加键盘监听事件、添加页面级的键盘监听事件

    页面级的键盘监听事件 document.onkeydown = function (event) { var e = event || window.event || arguments.callee ...

  10. 迅达云s3cmd客户端mac平台部署说明

    自己根据文档整理了下,在这里记下,免得其他兄弟走弯路. 1 下载最新的s3cmd代码 https://github.com/s3tools/s3cmd/archive/master.zip 2 解压缩 ...