<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>简单生活 -- Kevin Yang的博客 &#187; SSAS</title>
	<atom:link href="http://www.imkevinyang.com/tags/ssas/feed" rel="self" type="application/rss+xml" />
	<link>http://www.imkevinyang.com</link>
	<description>It&#039;s all about sharing</description>
	<lastBuildDate>Sun, 05 Feb 2012 15:37:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SSAS处理时&#8220;找不到属性键&#8221;的解决办法</title>
		<link>http://www.imkevinyang.com/2010/07/ssas%e5%a4%84%e7%90%86%e6%97%b6%e6%89%be%e4%b8%8d%e5%88%b0%e5%b1%9e%e6%80%a7%e9%94%ae%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html</link>
		<comments>http://www.imkevinyang.com/2010/07/ssas%e5%a4%84%e7%90%86%e6%97%b6%e6%89%be%e4%b8%8d%e5%88%b0%e5%b1%9e%e6%80%a7%e9%94%ae%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html#comments</comments>
		<pubDate>Sun, 18 Jul 2010 17:07:20 +0000</pubDate>
		<dc:creator>Kevin Yang</dc:creator>
				<category><![CDATA[BI/数据库]]></category>
		<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[处理异常]]></category>
		<category><![CDATA[属性键]]></category>

		<guid isPermaLink="false">http://www.imkevinyang.com/2010/07/ssas%e5%a4%84%e7%90%86%e6%97%b6%e6%89%be%e4%b8%8d%e5%88%b0%e5%b1%9e%e6%80%a7%e9%94%ae%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html</guid>
		<description><![CDATA[<p>在SSAS中，经常会遇到“Attribute key not found（找不到属性键）”的错误，这种错误通常是由于某个维度属性（Dimension Attribute）的<font face="Aparajita">数</font>据没能从Sql Server导入到Analysis Services中(处理这个维度属性的过程倒是不会出错)，而维度关键属性（Dimens&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>在SSAS中，经常会遇到“Attribute key not found（找不到属性键）”的错误，这种错误通常是由于某个维度属性（Dimension Attribute）的<font face="Aparajita">数</font>据没能从Sql Server导入到Analysis Services中(处理这个维度属性的过程倒是不会出错)，而维度关键属性（Dimension Key Attribute）处理时又需要这些数据，因而引发了这个“找不到属性键”的错误。这么讲可能有些抽象，你可以看我以前写的文章<a href="http://www.imkevinyang.com/2009/10/%E5%85%A8%E5%8D%8A%E8%A7%92%E7%A9%BA%E6%A0%BC%E5%AF%BC%E8%87%B4%E7%9A%84analysis-service%E5%A4%84%E7%90%86%E9%94%99%E8%AF%AF.html">全半角空格导致的Analysis Services处理错误</a>，里头有具体的案例。</p>
<p>解决这种问题就需要定位到出问题的数据。而生产环境中数据量一般会比较大，我们不大可能检查所有数据来发现可疑数据，这个时候，SSAS给出的错误提示就很有帮助了。</p>
<p>通常遇到处理异常，SSAS会有两种错误信息提示，一种是</p>
<blockquote><p>Errors in the OLAP storage engine: The attribute key cannot be found: Table: TableName, Column: ColumnName1, Value: Value1. Table: TableName, Column: ColumnName2, Value: Value2.</p>
</blockquote>
<p>这个错误提示会给出数据源中出错的数据，是在哪个表的哪个字段哪个值出的问题。</p>
<p>还有一个是</p>
<blockquote><p>Errors in the OLAP storage engine: The record was skipped because the attribute key was not found. Attribute: generated attribute X of Dimension: DimensionName from Database: DatabaseName, Cube: CubeName, Measure Group: MeasureGroupName, Partition: PartitionName, Record: <font color="#ff0000">RecordNumber</font>.</p>
</blockquote>
<p>这个错误信息给出的是Analysis数据库中出错的位置，是哪个AS数据库的哪个数据立方体的哪个维度的哪个维度属性出的问题，以及出错条目编号是多少。</p>
<p>如果出错数据比较好辨认的话，那么我们可以直接在源数据库中使用like操作符查询相关的条目即可。例如下面这个例子：</p>
<p><img style="display: inline" class="wlDisabledImage" title="image[36]" alt="image[36]" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image36.png" width="534" height="28" /></p>
<p>我们可以很快将出错数据锁定在一个较小的范围。但是如果错误信息像下面这样：</p>
<p><img style="margin: 0px; display: inline" class="wlDisabledImage" title="image" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image1.png" width="279" height="26" /></p>
<p>你可能就没那么好定位了，这个时候我们就需要第二个错误提示的帮助了。</p>
<p>为了在处理失败时显示第二个错误提示，我们需要修改维度的ErrorConfiguration属性。打开维度的属性面板，展开ErrorConfiguration中的KeyNotFound，BIDS中如果你新建一个维度，那么默认配置会像下面这样：</p>
<p><img style="margin: 0px; display: inline" class="wlDisabledImage" title="image" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image2.png" width="343" height="198" /></p>
<p>如果处理失败，是不会显示第二个错误提示的。我们需要将KeyNotFound设置为ReportAndContinue，或者直接把整个ErrorConfiguration从(custom)改成(default)。</p>
<p><img style="margin: 0px; display: inline" class="wlDisabledImage" title="image" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image3.png" width="349" height="202" /></p>
<p>这样我们就能得到第二个错误提示了，第二个错误提示中有一个“记录(Record)”的编号，那么这个编号代表什么含义呢？</p>
<p><img style="margin: 0px; display: inline" class="wlDisabledImage" title="image" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image4.png" width="475" height="49" /></p>
<p>我一开始直觉的认为是EmployeeKey的主键键值，后来发现不对，于是猜测是处理时执行的Sql查询返回的结果集的行编号，后来发现又错了。</p>
<p><img style="margin: 0px; display: inline" class="wlDisabledImage" title="image" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image5.png" width="588" height="186" /></p>
<p>在经过一番测试后发现，错误提示中的“记录”编号，确实是和Sql查询返回的条目的行编号有关，但却有一定的偏移，一般情况下这个偏移值为1，也就是说，假设SSAS告诉你“记录”7出错了，那么就是第6行的数据出错了。</p>
<p><img style="margin: 0px; display: inline" class="wlDisabledImage" title="image" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/07/image6.png" width="262" height="158" /></p>
<p>但有时候这个偏移不一定是1，有可能是2。至于规律和原因我暂时没找到。所以你只需要把出问题的维度属性相关的Sql查询放到Sql Server中运行一遍，然后根据错误提示中的“记录”号找到那附近的几行数据，一般就可以成功定位到错误数据了。</p>
<p style="text-align: right">——<a title="SSAS处理时“找不到属性键”的解决办法" href="http://www.imkevinyang.com/2010/07/ssas%E5%A4%84%E7%90%86%E6%97%B6%E6%89%BE%E4%B8%8D%E5%88%B0%E5%B1%9E%E6%80%A7%E9%94%AE%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95.html"><em>Kevin Yang</em></a></p>

	标签：<a href="http://www.imkevinyang.com/tags/analysis-services" title="Analysis Services" rel="tag">Analysis Services</a>, <a href="http://www.imkevinyang.com/categories/techarticles/businessintelligence" title="BI/数据库" rel="tag">BI/数据库</a>, <a href="http://www.imkevinyang.com/tags/ssas" title="SSAS" rel="tag">SSAS</a>, <a href="http://www.imkevinyang.com/tags/%e5%a4%84%e7%90%86%e5%bc%82%e5%b8%b8" title="处理异常" rel="tag">处理异常</a>, <a href="http://www.imkevinyang.com/tags/%e5%b1%9e%e6%80%a7%e9%94%ae" title="属性键" rel="tag">属性键</a><br />

	<h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.imkevinyang.com/2010/05/64%e4%bd%8d%e7%b3%bb%e7%bb%9f%e4%b8%8biis7-isapi%e5%a4%84%e7%90%86%e5%99%a8%e5%8a%a0%e8%bd%bd%e5%a4%b1%e8%b4%a5.html" title="64位系统下IIS7 ISAPI处理器加载失败 (2010/05/05)">64位系统下IIS7 ISAPI处理器加载失败</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/04/analysis-services-2005-olap%e8%ae%be%e8%ae%a1%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5.html" title="Analysis Services 2005 OLAP设计最佳实践 (2009/04/02)">Analysis Services 2005 OLAP设计最佳实践</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/04/analysis-services%ef%bc%9a%e4%bd%a0%e5%ba%94%e8%af%a5%e4%bd%bf%e7%94%a8%e5%a4%9a%e5%af%b9%e5%a4%9a%e7%bb%b4%e5%ba%a6%e5%90%97%ef%bc%9f.html" title="Analysis Services：你应该使用多对多维度吗？ (2010/04/12)">Analysis Services：你应该使用多对多维度吗？</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/bids%e5%af%b9%e4%ba%8e%e7%bb%b4%e5%ba%a6%e5%b1%9e%e6%80%a7%e9%94%ae%e4%b8%ba%e5%8f%af%e5%8f%98%e9%95%bf%e5%88%97%e6%97%b6%e5%ad%98%e5%9c%a8%e7%9a%84bug.html" title="BIDS对于维度属性键为可变长列时存在的Bug (2009/03/22)">BIDS对于维度属性键为可变长列时存在的Bug</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/bids%e9%83%a8%e7%bd%b2%e6%97%b6%e5%87%ba%e7%8e%b0%e5%85%83%e6%95%b0%e6%8d%ae%e7%ae%a1%e7%90%86%e5%99%a8%e5%8f%91%e7%94%9f%e9%94%99%e8%af%af.html" title="BIDS部署时出现元数据管理器发生错误 (2009/03/13)">BIDS部署时出现元数据管理器发生错误</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/08/olap%e4%b8%ad%e7%9a%84averageofchildren%e8%81%9a%e5%90%88%e6%96%b9%e5%bc%8f.html" title="OLAP中的AverageOfChildren聚合方式 (2009/08/10)">OLAP中的AverageOfChildren聚合方式</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/10/%e5%85%a8%e5%8d%8a%e8%a7%92%e7%a9%ba%e6%a0%bc%e5%af%bc%e8%87%b4%e7%9a%84analysis-service%e5%a4%84%e7%90%86%e9%94%99%e8%af%af.html" title="全半角空格导致的Analysis Services处理错误 (2009/10/09)">全半角空格导致的Analysis Services处理错误</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/11/%e6%9d%83%e9%99%90%e5%af%bc%e8%87%b4%e7%9a%84analysis%e6%80%a7%e8%83%bd%e8%ae%a1%e6%95%b0%e5%99%a8%e5%9c%a8vistawin2008%e4%b8%8b%e5%a4%b1%e6%95%88%e7%9a%84%e9%97%ae%e9%a2%98.html" title="权限不足导致的Analysis性能计数器在Vista/win2008下失效的问题 (2009/11/12)">权限不足导致的Analysis性能计数器在Vista/win2008下失效的问题</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/09/%e8%a7%a3%e5%86%b3%e7%bb%b4%e5%ba%a6%e6%88%90%e5%91%98%e4%b8%ad%e7%9a%84%e9%9d%9e%e6%b3%95xml%e5%ad%97%e7%ac%a6%e5%af%bc%e8%87%b4%e7%9a%84%e6%9f%a5%e8%af%a2%e9%94%99%e8%af%af-2.html" title="解决维度成员中的非法Xml字符导致的查询错误 (2009/09/19)">解决维度成员中的非法Xml字符导致的查询错误</a> </li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.imkevinyang.com/2010/07/ssas%e5%a4%84%e7%90%86%e6%97%b6%e6%89%be%e4%b8%8d%e5%88%b0%e5%b1%9e%e6%80%a7%e9%94%ae%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.imkevinyang.com @ 2012-02-08 00:33:15 -->
