<?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>PowerPivotGeek &#187; Data refresh</title>
	<atom:link href="http://powerpivotgeek.com/category/data-refresh/feed/" rel="self" type="application/rss+xml" />
	<link>http://powerpivotgeek.com</link>
	<description>An adventure in managed self-service computing</description>
	<lastBuildDate>Wed, 14 Jul 2010 04:51:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Peek Inside: Updating data in your embedded PowerPivot workbook</title>
		<link>http://powerpivotgeek.com/2010/05/12/a-peek-inside-updating-data-in-your-embedded-powerpivot-workbook/</link>
		<comments>http://powerpivotgeek.com/2010/05/12/a-peek-inside-updating-data-in-your-embedded-powerpivot-workbook/#comments</comments>
		<pubDate>Thu, 13 May 2010 04:02:27 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[A Peek Inside]]></category>
		<category><![CDATA[Data refresh]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/05/12/a-peek-inside-updating-data-in-your-embedded-powerpivot-workbook/</guid>
		<description><![CDATA[<p>Recently I have been seeing some threads about how data is updated in a PowerPivot workbook. As it turns out, this can be a pretty complicated technical situation, so lets start off with a general statement: There are only 2 ways to update the embedded data contained in a PowerPivot workbook:</p>

Bring the workbook down to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been seeing some threads about how data is updated in a PowerPivot workbook. As it turns out, this can be a pretty complicated technical situation, so lets start off with a general statement: There are only 2 ways to update the embedded data contained in a PowerPivot workbook:</p>
<ol>
<li>Bring the workbook down to the client machine, use the PowerPivot Excel add-in and click on “refresh”, then republish the workbook back to SharePoint (which implies certain SharePoint rights to enable)</li>
<li>Use the build-in PowerPivot data refresh facility (which also implies certain SharePoint rights)</li>
</ol>
<p>That is it.</p>
<p>But as you guess, there is more to the story. So let’s start a ‘geek session’ and drill down into the type of data source. The update story really depends on if the user has defined a data source using a trusted connection or a SQL login connection. So let’s take them one by one.</p>
</p>
<p> <span id="more-1071"></span>
<p>If using trusted Windows authentication against the data source, let’s look at this sequence of events:</p>
<ol>
<li>User A creates a PowerPivot document that access a relational DB using user A’s interactive credentials.</li>
<li>User A publishes to SharePoint.</li>
<li>As User A has contributor rights against the document, she can set up a data refresh schedule. As part of the schedule, she specifies what Windows credentials to use for the data refresh. The creds are stored encrypted in SharePoint Secure Store. This is specified once for the entire job (as this is the Windows environment that the job runs in).</li>
<li>When data refresh runs at 2am, the data is updated using the schedule’s credentials. The Windows creds must have contributor rights to the file because we read and write the file using the job’s Windows cred’s SharePoint rights.</li>
<li>If User B is allowed to copy down the document (which he can do if he has READ rights, but he cannot do if he has VIEW ONLY rights) and he refreshes the connection using the PowerPivot Excel add-in the DB accessed with User B’s interactive credentials.</li>
</ol>
<p>If using SQL logins against the data source, the sequence is slightly different:</p>
<ol>
<li>User A creates a PowerPivot document that access a relational DB using the data source creds specified in the connection – it would likely NOT be User A’s Windows uid/pwd.</li>
<li>User A publishes to SharePoint.</li>
<li>As User A has contributor rights against the document, she can set up a data refresh schedule. As part of the schedule, she can specify the non-Windows data source credentials to use for the data refresh. The data source creds are stored encrypted in SharePoint Secure Store. This must be specified on a data source by data source basis. The Windows creds specified for the schedule must have contributor rights to the file because we read and write the file using the job’s Windows cred’s SharePoint rights.</li>
<li>When data refresh runs, the data is updated using the schedule credentials by modify the connect string to include uid/pwd.</li>
<li>If User B is allowed to copy down the document and he refreshes the contents using the PowerPivot Excel add-in, then he may or he may not be prompted for the password. The default setting is to re-prompt for the password, but if User A wanted to, she could have embedded the non-Windows auth password in the connection and User B would re-use it also.</li>
</ol>
<p>I hope that clears things up a bit.</p>
<p>Enjoy.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F05%2F12%2Fa-peek-inside-updating-data-in-your-embedded-powerpivot-workbook%2F&amp;linkname=A%20Peek%20Inside%3A%20Updating%20data%20in%20your%20embedded%20PowerPivot%20workbook"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/05/12/a-peek-inside-updating-data-in-your-embedded-powerpivot-workbook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto: Get more flexibility when importing data from text files</title>
		<link>http://powerpivotgeek.com/2010/04/27/howto-get-more-flexibility-when-importing-data-from-text-files/</link>
		<comments>http://powerpivotgeek.com/2010/04/27/howto-get-more-flexibility-when-importing-data-from-text-files/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 05:07:42 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[Client]]></category>
		<category><![CDATA[Data refresh]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[ACE]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[text files]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/04/27/howto-get-more-flexibility-when-importing-data-from-text-files/</guid>
		<description><![CDATA[<p>Question: By default PowerPivot has two limitations when working with text files (using the Office ACE OLE DB provider): (1) will only import data from files with an extension of .txt, .tab, and .csv; and (2) it will only recognize tab, comma, semicolon, space, colon, and vertical bar and column delimiters. Is there a way [...]]]></description>
			<content:encoded><![CDATA[<p>Question: By default PowerPivot has two limitations when working with text files (using the Office ACE OLE DB provider): (1) will only import data from files with an extension of .txt, .tab, and .csv; and (2) it will only recognize tab, comma, semicolon, space, colon, and vertical bar and column delimiters. Is there a way to change PowerPivot’s configuration so that it will recognize other file extensions or column delimiters?</p>
<p>Answer: Yup &#8212; that is a technical term.&#160; You can use a schema.ini file in the same directory as the imported text file to specify all kinds of things that aren’t available through the PowerPivot UI, including fixed column rather than delimited text file format.&#160; Here’s a web page with the info:</p>
<blockquote><p><a href="http://msdn.microsoft.com/en-us/library/ms709353(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms709353(VS.85).aspx</a></p>
</blockquote>
<p>(Thanks to Ron Pihlgren for this solution. Ron is the PowerPivot client test lead – and his blog is included in my blogroll.)</p>
<p>Enjoy.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F04%2F27%2Fhowto-get-more-flexibility-when-importing-data-from-text-files%2F&amp;linkname=Howto%3A%20Get%20more%20flexibility%20when%20importing%20data%20from%20text%20files"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/04/27/howto-get-more-flexibility-when-importing-data-from-text-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Working with the 2010 Office ACE provider</title>
		<link>http://powerpivotgeek.com/2010/04/02/working-with-the-2010-office-ace-provider/</link>
		<comments>http://powerpivotgeek.com/2010/04/02/working-with-the-2010-office-ace-provider/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 06:19:10 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[Data refresh]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/04/02/working-with-the-2010-office-ace-provider/</guid>
		<description><![CDATA[<p>Ok. I’ve promised some best practices – here is my first one.</p>
<p>What is the 2010 Office ACE provider and why is this important to PowerPivot? The 2010 Office System Driver for Data Connectivity Components (aka the Office ACE provider) is a OLE DB provider that can be used to read data from and write data [...]]]></description>
			<content:encoded><![CDATA[<p>Ok. I’ve promised some best practices – here is my first one.</p>
<p>What is the 2010 Office ACE provider and why is this important to PowerPivot? The 2010 Office System Driver for Data Connectivity Components (aka the Office ACE provider) is a OLE DB provider that can be used to read data from and write data to Office 2010 system files such as Microsoft Access Beta (mdb and accdb) files and Microsoft Excel 2010 (xls, xlsx, and xlsb) files. You can also use it to access text files. The provider “Microsoft.ACE.OLEDB.14.0” which includes both 32-bit and 64-bit versions, is available for download here: ( <a title="http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en</a> ). PowerPivot uses the ACE provider as part of a data refresh job to import data.</p>
<p>In this blog, I would like to talk about two important topics concerning ACE: (a) how to get it and use it; and (b) what are some of the best practices that we’ve recently encountered when using it internally for some dogfood servers.</p>
<p> <span id="more-811"></span>First, how do you get and use the ACE provider:
</p>
<ul>
<li>You must manually download and install the ACE provider on each PowerPivot app server where PowerPivot for SharePoint is installed. Since you’ve used this OLE DB provider to import data on the PowerPivot Excel add-on wizard, if you in intend to use it for data refresh on your SharePoint farm, then the same OLE DB provider must be on the PowerPivot app server. </li>
<li>Since SharePoint runs only under 64-bit servers – this means that you must use the 64-bit version of the ACE provider. Your client can be 32-bit, but the SharePoint server forces the use of the 64-bit version on the PowerPivot app server. </li>
<li>The actual target file must be located on a shared location such as a file share, or some other location that can be reached by both the client import data wizard, and the server-side, SharePoint PowerPivot app server. It cannot be located on the client’s local desktop, e.g. C:\folder\source.xlsx. </li>
</ul>
<p>So, now you’ve installed it, what is it like when you use it in production? In general, it runs as advertised, but we’ve found two issues that those folks doing deployments should be aware of:</p>
<p><strong>Issue #1</strong> – The ACE provider creates temporary files (copies) from the source data files. The temp files are created after the data refresh job has impersonated the user specified in the job schedule. Since normally the temp folder is ACL’ed to only allow the PowerPivot System service account access, the file creation may fail. If using the NEW SERVER configuration (the single all-in-1 server installation), then the system uses the same service account for the PowerPivot System service account as it uses the PowerPivot unattended account. So if you click on “Connect using the credentials already stored inside this workbook” then things work OK. But if you specify custom credentials, then it is likely that the ACE provider cannot create a file in the TEMP folder, then an error is returned to the data refresh job:</p>
<blockquote><p>“OLE DB or ODBC error: Unspecified error. A connection could not be made to the data source with the DataSourceID of &lt;guid&gt;, Name of &lt;name&gt;. An error occurred while processing the ‘&lt;sheet name&gt;’ table. The operation has been cancelled.”</p>
</blockquote>
<p>To solve this problem, we need to add an ACL to the PowerPivot System service account’s TEMP folder that allows users read+write access. We don’t need all accounts, just those who are specified in the custom credentials section of the data refresh job that is using the ACE provider. The account is the one specified here:</p>
<p><a href="file:///C:\Users\dwickert\AppData\Local\Temp\2\WindowsLiveWriter1286139640\supfiles57B047F\image37.png"><strong></strong></a><a href="http://blogs.msdn.com/blogfiles/powerpivot/WindowsLiveWriter/PowerPivotDataRefresh_D45C/clip_image008_2.gif"><img title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/powerpivot/WindowsLiveWriter/PowerPivotDataRefresh_D45C/clip_image008_thumb.gif" width="524" height="158" /></a></p>
<p>To solve the issue: (on each PowerPivot app server) Use Windows Explorer, running in administrator mode, to modify the “C:\Users\&lt;PowerPivot System service account&gt;\AppData\Local\Temp” folder by adding an ACL that gives the accounts that will be using the ACE provider limited access, i.e. Read+Write.</p>
<p>As you would expect this is a common Windows management issue. There are several approaches to use: (in increasing better ‘best practices’ order)</p>
<ul>
<li>Give “Everyone” read+write permission – this is the easiest, but least secure. Typically the C:\Users subfolders are shared out over the network, so any penetrators would have to actually be running on the app server, so this isn’t too bad, but the Everyone group contains lots and lots of accounts. <img src='http://powerpivotgeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </li>
<li>Give “&lt;domain&gt;\Authenticated Users” read+write permission – this is better, but provides access to accounts that are not using your SharePoint farm. Clearly this is a large population – maybe even still too large. </li>
<li>You might already have domain groups that you are using to control access to your SharePoint farm. If those groups exist, re-use them here and give those groups read+write access. This approach limits access to just SharePoint users, but users still might not be using ACE and they have access. </li>
<li>Create a new local group, called “ACE Users” – Initially this group is empty; as users encounter problems, have your machine administrators add users to this group on request; in the best of all worlds, you would have a provisioning system so user can request access and have the system auto-remove them periodically. </li>
</ul>
<p>Anyway, somehow regardless of what technique you use, the TEMP folder ACLs must be changed to allow access.</p>
<p><strong>Issue #2</strong> – To actually access the remote files the ACE provider uses SMB via the UNC name (typically in the form: <a href="file://\\server\share\folder\workbook.xlsx)">\\server\share\folder\workbook.xlsx)</a></p>
<p>If the target location is a true file share, then things are OK. If however the target location is a SharePoint farm acting as a file share (using WebDAV protocol), then additional OS components must be installed. Typically this is done because users are storing Access databases, Excel files, or text files that are stored back on the same SharePoint farm as the source workbook (a kind of a ‘loopback’ for data access). If wish to provide this capability to end-users, then you must install the “Desktop Experience” role to the PowerPivot app servers.</p>
<p>If you don’t have “Desktop Experience” added as a server role and a data refresh job attempts to use the ACE provider to access a remote SharePoint farm via its UNC name, then the job will fail with:</p>
<blockquote><p>OLE DB or ODBC error: Failure creating file.; 3436. A connection could not be made to the data source with the DataSourceID……”</p>
</blockquote>
<p>The Desktop Experience role is not by default installed on a server OS and thus your administrator will have to add it as a role to the server. Again, this is not needed if the target files are located on true file shares, or equivalent. It is only needed if the app server is going to be referencing a SharePoint farm (either itself or a different remote farm) using a UNC name.</p>
<p>Enjoy.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F04%2F02%2Fworking-with-the-2010-office-ace-provider%2F&amp;linkname=Working%20with%20the%202010%20Office%20ACE%20provider"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/04/02/working-with-the-2010-office-ace-provider/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>When is a refresh not a refresh?</title>
		<link>http://powerpivotgeek.com/2009/11/15/when-is-a-refresh-not-a-refresh/</link>
		<comments>http://powerpivotgeek.com/2009/11/15/when-is-a-refresh-not-a-refresh/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 05:21:00 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[Data refresh]]></category>
		<category><![CDATA[Excel Services]]></category>
		<category><![CDATA[data sources]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/?p=190</guid>
		<description><![CDATA[<p>Ok. This post will be a bit complicated but stick with me. Hopefully, in the end, all will be clear. And the geek in you will love it.</p>
<p>One of the things that users just kind of glance over, but don’t realize the implication, is the fact that PowerPivot is a copy of the data. If [...]]]></description>
			<content:encoded><![CDATA[<p>Ok. This post will be a bit complicated but stick with me. Hopefully, in the end, all will be clear. And the geek in you will love it.</p>
<p>One of the things that users just kind of glance over, but don’t realize the implication, is the fact that PowerPivot is a copy of the data. If you haven’t already, let me suggest that you read my <a href="http://powerpivotgeek.com/2009/11/09/a-peek-inside-wheres-the-beef/">&quot;Where&#8217;s the beef?&quot; posting</a>. In that posting I talked about the fact that <u><strong>data itself</strong></u> is pulled into the workbook when you save it. When you click any of these buttons:</p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2009/11/image63.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="484" alt="image" src="http://powerpivotgeek.com/wp-content/uploads/2009/11/image_thumb64.png" width="630" border="0" /></a> </p>
<p>The import process runs. From then on, the data can start change and shift away from the values that is stored in memory and ultimately in the workbook. The data is ‘real-time’ only when the import is running; afterwards all calculations, pivot and slice is driven by the stored data. On the client this is clear because we have the ‘Refresh’ button (and its options) that provide refresh on the client. But how about the server?? Well, that is the core of this posting. Let’s take a closer look at it. We will start at the menu items for the Excel Services rendering of the workbook. Notice the options here:</p>
</p>
<p> <span id="more-190"></span>
</p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2009/11/image64.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="379" alt="image" src="http://powerpivotgeek.com/wp-content/uploads/2009/11/image_thumb65.png" width="644" border="0" /></a> </p>
<p>The question is “What does it mean to ‘refresh’ the connection?” The answer to that is that it depends on the data provider. For virtually every OLEDB and ODBC provider that Excel Services uses, ‘refreshing a connection’ means going out to the data source and re-querying the data source for its data. SQL Server RDBMS, Oracle, Teradata, virtually to everyone it means refreshing that Excel Services data. And it means that in PowerPivot also, but in PowerPivot where is the data stored? (You know the answer this already, don’t you). The data is in the workbook. Has the workbook changed since you last opened the .xlsx file? Well, I suppose it might have – and in which case, refreshing the connection might bring in new data. But in the vast, vast number of cases, <em>refreshing the PowerPivot table means just re-reading the data that Excel Services already has</em>. In most cases, it has absolutely no effect at all.</p>
<p>To really drive this home, let’s shift into super-geek mode and drill down into the workbook itself. I will go back to the workbook in the first screen shot and first click on the Connections option in the Data ribbon. Notice that there is a connection that has been defined behind my back in the workbook. It is called “Sandbox” which by the way was the name of our system prior to Gemini and prior to PowerPivot. I didn’t create that connection. It was created for me when the PowerPivot Excel add in was first started. This is the connection which is actually interfacing to the in-memory database. Now let’s drilldown further into the “Sandbox” connection and look at its connection string. WOW! The “Data Source=” property, which would normally point to the server for where the database is stored, instead points to “<strong>$Embedded$</strong>” – What’s that?? </p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2009/11/image65.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="484" alt="image" src="http://powerpivotgeek.com/wp-content/uploads/2009/11/image_thumb66.png" width="644" border="0" /></a> </p>
<p><strong>$Embedded$</strong> is the magic tag that tells PowerPivot for SharePoint that the data does not come from some server somewhere – instead the data comes from the workbook itself. One of the new OLEDB interfaces created for PowerPivot is a property that Excel Services sets which contains the URL for the workbook that Excel Services is opening. The msolap OLEDB provider takes that URL and replaces the $Embedded$ string with the URL itself –&gt; and thus the infrastructure will read its data from the workbook itself.</p>
<p>But – and this is the critical “BUT” – notice that the embedded content never changes. After you upload a workbook, that workbook doesn’t change on its own. Thus neither does the data. Remember the data is a <strong><u>copy</u></strong> of the data that is embedded in a workbook. If Excel Services refreshes it, the ECS calc engine gets the same data over and over again. The SSAS database embedded in the workbook hasn’t changed – so the data refresh is a nop – it never changes. Refreshing a connection to an embedded PowerPivot database doesn’t refresh anything. You get the same data over and over again.</p>
<p>So, how does the workbook data get refreshed? After all, there must be some way to do it . . . In fact, there are two ways:</p>
<ol>
<li>Bring the workbook down on the client and refresh the data in the workbook. Then re-publish the workbook back to the same location in SharePoint. New data is automatically given to Excel Services and existing connections. </li>
<li>Use the data refresh facility, see the <a href="http://powerpivotgeek.com/misc/my-other-blog-articles/powerpivot-data-refresh/">data refresh posting</a> and <a href="http://powerpivotgeek.com/2009/11/12/steps-taken-during-a-powerpivot-data-refresh/">detailed steps posting</a> for more information. In this case the PowerPivot System Service will reach out and pull in new data into the workbook. A new version of the workbook is created and new data is automatically give to Excel Service and existing connections. </li>
</ol>
<p>And before you ask, <u>No</u>, PowerPivot V1 has no option to monitor the data in real-time and update its data in-memory as the source data changes. The workbook captures the data at a point in time – and then users work with that data. There are no provisions for real-time access to data while doing analytics / calculations / pivot table operations. </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2009%2F11%2F15%2Fwhen-is-a-refresh-not-a-refresh%2F&amp;linkname=When%20is%20a%20refresh%20not%20a%20refresh%3F"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2009/11/15/when-is-a-refresh-not-a-refresh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Steps taken during a PowerPivot data refresh</title>
		<link>http://powerpivotgeek.com/2009/11/12/steps-taken-during-a-powerpivot-data-refresh/</link>
		<comments>http://powerpivotgeek.com/2009/11/12/steps-taken-during-a-powerpivot-data-refresh/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 05:08:55 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[Data refresh]]></category>
		<category><![CDATA[credentials]]></category>
		<category><![CDATA[data sources]]></category>
		<category><![CDATA[ULS]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/?p=177</guid>
		<description><![CDATA[<p>In this posting we will take a more detailed technical look at how the data refresh facility works and the steps that it takes to accomplish a data refresh cycle. Rather than starting with the &#8220;Manage data refresh” page, we will assume that you know how to setup a schedule – in this posting, we [...]]]></description>
			<content:encoded><![CDATA[<p>In this posting we will take a more detailed technical look at how the data refresh facility works and the steps that it takes to accomplish a data refresh cycle. Rather than starting with the &#8220;Manage data refresh” page, we will assume that you know how to setup a schedule – in this posting, we will take a deep dive into the cycle itself.</p>
<h4>What steps are taken when the data is refreshed?</h4>
<p>Now that you have configured your schedule(s) for the workbook, let’s take a step back and examine more closely what data refresh actually means. I think that it is valuable to understand, at some basic level, exactly what the system is going to do on your behalf at 2am in the morning. When a job actually run, the data refresh facility goes through the following steps:</p>
<ol>
<li>First, the system looks for schedules that are ‘runable’ meaning that their schedule time period has come due. As all of the jobs might be scheduled at close to the same time (midnight, for example, is a popular time <img src='http://powerpivotgeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ), the system tries to run the job as soon as it can. All of the PowerPivot SharePoint servers are doing this at the same time. Ultimately one of them detects that your job has “come due” and is runable.</li>
<li>After impersonating the Windows user specified in the schedule, the system extracts the workbook from the content database using the SharePoint binary OM. The user must supply a valid Windows account in the schedule and he or she must ensure that that account has contributor (read/write) access rights to the workbook. The workbook is stored in a temporary folder (in the SSAS Backup folder) so it can be used later (see step 9 below).</li>
<li>The system extracts the embedded database from the workbook and loads the database into the local SSAS Engine instance. The database is loaded read/write (so it can be updated). This database is only used for this data refresh job – the system ensures that it is <span style="text-decoration: underline;">not</span> used for querying while updating is going on (the SSAS processing commands).</li>
<li>If a data source(s) specified for this schedule has custom data source credentials specified for the job, then the data source(s) have their connect string properties changed (in V1 we only support the changing of the “Username” and “Password” properties. This is done using an XMLA command to the data source.</li>
<li>The system impersonates the Windows user for a second time and sends processing commands to the database. This causes the Engine to reach out to the sources and pull updated data into the database. The processing command is not sent to all tables/dimensions. The process commands are sent just to those objects that are dependent on the data source(s) included in the schedule.</li>
<li>The data source credentials (if any) are reset.</li>
<li>The database is saved back to the workbook.</li>
<li>If it is not set already, the embedded connection’s property “Refresh data when opening the file” is set to True. This ensures that users immediately see the new data the workbook opened. It also means that snapshot generation will include the new data in the thumbnail.</li>
<li>Impersonating the Windows account yet a 3rd time, the workbook is saved back to the content database using the SharePoint binary OM. If the document library is a PowerPivot Gallery, then the OM fires its ‘new file’ event handler fires which starts the snapshot generation process. The “new file’ event handler was added by the Gallery content type.</li>
<li>The schedule’s status is updated with information about the job, i.e. its success, failure, error messages, etc.</li>
<li>And finally, the database is converted to a read-only database so it is available to users immediately for querying. This makes the user’s first query as fast as possible and lessens the load on the SharePoint content database since the PowerPivot database is already loaded into memory. </li>
</ol>
<p>The end result is that a new, updated workbook has been stored back in the original workbook’s document library – the overall system is primed and ready to go when the workbook is viewed.</p>
<p> </p>
<p><span id="more-177"></span>A few observations:</p>
<ul>
<li>Remember that to edit the schedule, you must enable it. I am always forgetting to check the “Enable” box at the top of the schedule. The radio buttons can still be selected if disabled, but the options will not expand. I cannot tell you how often I’ve sat staring at a page wondering what was wrong, only to realize that I forget to enable the schedule.</li>
<li>The schedule is kept independent from the workbook itself. It is stored in the service application database indexed by the SPFile.FileID. This uniquely defines a file on the SharePoint farm. A file can be deleted and its schedule remains. Publish a new file and the schedule automatically picks up.</li>
<li>The schedule history (success or failure results w/ error messages) is also kept in the service application database so it can remain a long time after the file has been deleted. While not available from the end-user’s UI (unless they recreate the file), the history information is available via the Mgmt Dashboard – so the information can be in a report (again, long after the file has been deleted).</li>
<li>An important point to remember: You specify the <span style="text-decoration: underline;">Windows user</span> here:  (one per schedule; pick your favorite method – one of the three)<a href="http://powerpivotgeek.com/wp-content/uploads/2009/11/image8.png"><img style="display: inline" title="image" src="http://powerpivotgeek.com/wp-content/uploads/2009/11/image_thumb9.png" alt="image" width="700" height="215" /></a>
<p>You specify the <span style="text-decoration: underline;">data source user</span> here: (one per data source; again, pick your favorite one of three methods)</p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2009/11/image9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://powerpivotgeek.com/wp-content/uploads/2009/11/image_thumb10.png" border="0" alt="image" width="709" height="601" /></a></p>
<p>Get these two types of users mixed up and it will be <span style="text-decoration: underline;">very</span> confusing.</li>
<li>Troubleshoot: The ULS logs are your friend. Search Codeplex (<a href="http://www.codeplex.com">http://www.codeplex.com</a>) or your favorite SharePoint web site and pickup a good viewer. You will use it *a lot*.<br />
Another good ULS viewer is at: <a title="http://code.msdn.microsoft.com/ULSViewer" href="http://code.msdn.microsoft.com/ULSViewer">http://code.msdn.microsoft.com/ULSViewer</a> </li>
</ul>
<p>Enjoy.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2009%2F11%2F12%2Fsteps-taken-during-a-powerpivot-data-refresh%2F&amp;linkname=Steps%20taken%20during%20a%20PowerPivot%20data%20refresh"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2009/11/12/steps-taken-during-a-powerpivot-data-refresh/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
