Monday, March 02, 2009 2:18 AM
by
SQL Master
Find out deprecated features within SQL Server 2008 using PROFILER
When I had a task to look for the method to find out what features are Deprecated (which means that feature will not included in next release of SQL Server) in the engine.
As a first point of resource I referred through BOL to find the list of deprecated features, the information was handy enough to identify what are there and what not. More on the subject I want to find out what kind of Deprecated features that are used by an Application within a client's place, as recently they have upgraded the SQL Server 2000 version to 2005 and faced problems from application for the compatibility reasons. The obvious failure occurred due to the mismatch of testing by the team from the Application Support who had gone through bunch of features to identify and never perform thorough upgrade process using UPGRADE ADVISOR!
For obvious reasons they had to keep back the Database compatibility mode to 80 (2000 version) and waiting to rescue from the problem, as they invested heavily on the new hardware to attain the optimization & availability for their application using SQL Server 2005 that will be used to upgrade the same to 2008. As they hit a major roadblock of compatibility the management was not happy to proceed further and infact looked into alternatives of rollback of entire database upgrade, which is another impossible task to ensure that database will be managed in earlier version once the upgrade is performed.
Anyways to identify the root cause I have asked the Developers to find what kind of Deprecated statements & commands used within their application code and also referred them to run a thorough upgrade exercise using UPGRADE ADVISOR tool which gives first hand information of issues & problems. Then I have asked to use PROFILER to identify the DEPRECATED FEATURES from the current database application. Do you know this a new counter that was provided in SQL Server 2005 profiler that SQLServer:Deprecated Features object will help to monitor the features designated as deprecated. IN a nutshell this object gets the information (usage count) for a certain feature that has been used since the SQL Server instance was last started.
To obtain the correct information using this new object within PROFILE make sure you have noted the task to save the trace to TABLE under General Tab configuration of Profiler tool. To give you more information there are 2 event classes associated to this Deprecate Features objects, Deprecation Announcement & Deprecation Final Support. Both of these event classes occurs when the application code uses a feature that is marked as to removed from a future version of SQL Server.
To make a brief underline on Deprecation Announcement event class occurs when you use a feature that will be removed from a future version of SQL Server, but will not be removed from the next major release. For Deprecation Final Support event class occurs when you use a feature that will be removed from the next major release of SQL Server. So this is why it is always better to check your code to identify any of deprecate features are being used and best practices procedures dictates to avoid using this feature for the longevity of your application. To get further easy information from your Trace tasks whereby when you save the trace to table you can easily query the table using :
SELECT * FROM <TraceTableName> WHERE EventClass IN (125, 126);
GO
Further a side note on a DMV that you may be aware that using sys.dm_os_performance_counters DMV you can obtain a row per performance counter maintained by the server. IN any case an instance of SQL Server fails to display the performance counters of the Windows operating system, use Select count(*) from sys.dm_os_performance_counters to confirm that performance counters have been disabled.
BOL refers that: On the results if the return value is 0 rows, this means that the performance counters have been disabled. You should then look at the setup log and search for error 3409, "Reinstall sqlctr.ini for this instance, and ensure that the instance login account has correct registry permissions." This denotes that performance counters were not enabled. The errors immediately before the 3409 error should indicate the root cause for the failure of performance counter enabling.
To close up this I suggest you to look for usage of Extended Events to troubleshoot performance issues. Extended Events offers a deeper view into the internal workings of SQL Server, and can be used for more advanced troubleshooting scenarios. I will blog about this feature from my experience on how you can deploy this within Production environment.