Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.
Consider the following scenario:
You have installed Microsoft SQL Server 2005 Service Pack 2 (SP2) Cumulative Update 9 or a later SP2 cumulative update for SQL Server 2005 Analysis Services. Or, you have installed SQL Server 2005 SP3 or a later SP3 cumulative update for SQL Server 2005 Analysis Services.
You set up a query log on the server.
You synchronize a database on the server.
In this scenario, all records in the query log table are truncated.
Note This problem also exists in SQL Server 2008 and in SQL Server 2008 R2. For more information, see the "More Information" section.
The fix for this issue was first released in Cumulative Update 3 for SQL Server 2005 Service Pack 3. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
967909 Cumulative update package 3 for SQL Server 2005 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
960598 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 3 was released
Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 3 hotfix to an installation of SQL Server 2005 Service Pack 3. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
This problem is not fixed in SQL Server 2008 or in SQL Server 2008 R2. SQL Server 2008 truncates the OlapQueryLog table every time that synchronization runs, because synchronization replaces the destination database by using a fresh copy of the database. This affects scenarios such as synchronization, attaching an existing database, or restoring an existing database.
In SQL Server 2008, there is no internal indicator to suggest to the synchronization threads that the refreshed database schema design has or has not been altered, compared with the existing database schema design. Therefore, each synchronization truncates the OlapQueryLog table. Usually, the OlapQueryLog table should be truncated when the database design (cube, dimension, measure group) has changed structure to prevent the outdated query usage information in prior revisions from misleading the aggregation design wizard to make the wrong suggestions.
One workaround is to create a user-defined "after insert" trigger on the OlapQueryLog table in your relational database to duplicate the newly inserted rows into your own table. This table can be manually maintained as you want. For example:
create trigger SaveQueryLog on OlapQueryLog after insert as insert into dbo.CopyOfQueryLog select * from inserted When you use the workaround, you have to manually maintain the CopyOfQueryLog table in order to keep accurate historical information on database query activity recorded. You must manually truncate the table at any time that an Analysis Services database schema change is made, or at least delete those affected objects from the CopyOfQueryLog. This maintenance is required to stop the activity against old schema revisions from influencing aggregation design on newer revisions of the Analysis Services database.
Note The name of the query log table may vary in your environment. The name is specified in the configuration setting QueryLog\QueryLogTableName.
For more information about server log files, visit the following Microsoft Developer Network (MSDN) website: