SQL Server Profiler deprecation - Replacement? - sql

I am developing ASP.NET and SQL Server applications, sometimes i am having trouble with a SQL Query, and i would like to see the SQL Servers "response" and not just the ASP.NET error message (Which is not always very helpfull)
The Profiler.exe tool in SQL Server is capable of this, but im reading on MSDN that Microsoft is planning to deprecate the tool.
We are announcing the deprecation of SQL Server Profiler for Database Engine Trace Capture and
Trace Replay. These features will be supported in the next version of SQL Server, but will be
removed in a later version. The specific version of SQL Server has not been determined. The
Microsoft.SqlServer.Management.Trace namespace that contains the Microsoft SQL Server Trace and
Replay objects will also be deprecated. Note that SQL Server Profiler for the Analysis Services
workloads is not being deprecated, and will continue to be supported.
http://msdn.microsoft.com/en-us/library/ms181091.aspx
They don't mention what tool will replace profiler.exe
Does anyone know anything about that?
And are there any alternatives to profiler if i want to see (recent?) unsuccessful queries?

While it is safe to continue using trace for the next few versions, Profiler is never the answer (some evidence here and also here). If you're going to use trace, use a server-side trace. Just don't write new code that will utilize trace and expect to live beyond a few versions.
The long-term answer is to use extended events. A blog you'll want to watch is SQL Server MVP Jonathan Kehayias of SQLskills.com. He has done a great job explaining extended events in laymen's terms and providing many, many ready-to-use examples. He also has great courses on PluralSight (which you can currently get for free through Visual Studio Dev Essentials):
SQL Server: Introduction to Extended Events
SQL Server: Advanced Extended Events
Another person to learn a lot from is Erin Stellato. She has since moved on to Microsoft but her blog posts at SQLskills remain, and they are rich with info.

Related

Is there a Microsoft SQL Server Profiler equivalent for Progress OpenEdge ABL?

I am looking for an equivalent of Microsoft SQL Profiler for a Progress 4GL database.
Maybe. It depends on how "equivalent" you need your solution to be.
If you are looking for general performance data then options include:
PROMON (included)
OpenEdge Management (aka "Fathom") (an extra license from PSC)
ProTop (free -- http://wss.com/protop which is me)
Pro Monitor (no longer available)
Roll your own via Virtual System Tables
If you are specifically looking for something along the lines of "explain plan" then you probably want to be running OE10.2B or better and look into the "client statement cache" feature.
If you wish to profile the performance of 4GL code then you might be wanting to use the "profiler" feature of the ABL. You can get to that via the -profile startup option or by using the session:profiler handle within a session.

Why Microsoft abandoned Notification Services in SQL Server 2008?

I invested quite a bit of time toying with NS introduced in SQL 2005 and found it to be excellent feature..
However , I hear MS has abandoned NS in 2008; Why ? and with what they are replacing it if any at all..
Deeply buried inside the readme file
for the July CTP of Katmai, Microsoft
quietly announced a departure from the
normal feature depreciation plan. The
readme stated that Notifications
Services would no longer be included
in the product. The following is an
excerpt from that ReadMe file.
"SQL Server Notification Services will
not be included as a component of SQL
Server 2008, but will continue to be
supported as part of the SQL Server
2005 product support life-cycle.
Moving forward, support for key
notification scenarios will be
incorporated into SQL Server Reporting
Services. Existing Reporting Services
functionality, such as data driven
subscriptions, addresses some of the
notification requirements. Features to
support additional notification
scenarios may be expected in future
releases."
Ref.
As Mitch already said, the official replacement for NS is RS. But I suggest you have a look at StreamInsight.

Tools to Replay Load on a SQL Server

Has anyone come across any good tools (preferably but not necessarily FOSS) that can read a SQL Server (2005/2008) trace file and execute the commands against another database. We are attempting to perform some performance testing on our SQL servers and would like to replicate an actual load.
I have come across but not yet used:
JMeter
ReplayML
Preferably, the application would be able to use threading to mimic user connections and query execution on the SQL Server.
You can replay a SQL Server Profiler trace against another server using the SQL Server Profiler itself.
See the following Microsoft Reference as a starting point.
http://msdn.microsoft.com/en-us/library/ms189604.aspx
Quest Software also have a tool called Benchmark Factory that can be used to perform SQL Server load testing.
http://www.quest.com/benchmark-factory/
One of the best tools is actually freely available from Microsoft. The RML Utilities are targeted at SQL2005 & SQL2008 and are specifically designed for this type of testing.
You can download the tools from http://www.microsoft.com/downloads/details.aspx?FamilyId=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&displaylang=en
We have used them to solve several performance and locking issues.
Note: Capturing trace files using the SQL Profiler GUI can add to performance problems due to the way the GUI and Trace backend interact. The RML Utilites include a script that can capture traces directly from the SQL Server without using the GUI.
You can replay trace files directly in SQL Profiler, although I've only used it a couple of times for that, so I don't know what all of the limitations are on it.
team system has an add-on that you can find on codeplex: It is called ->
sql load test
Let me know if that works well for you.
I know this is a really old question but after searching for some time i discovered a new open source tool.
https://github.com/spaghettidba/WorkloadTools which works great

Logging ALL Queries on a SQL Server 2008 Express Database?

Is there a way to tell SQL Server 2008 Express to log every query (including each and every SELECT Query!) into a file?
It's a Development machine, so the negative side effects of logging Select-Queries are not an issue.
Before someone suggests using the SQL Profiler: This is not available in Express (does anyone know if it's available in the Web Edition?) and i'm looking for a way to log queries even when I am away.
SQL Server Profiler:
File → New Trace
The "General" Tab is displayed.
Here you can choose "Save to file:" so its logged to a file.
View the "Event Selection" Tab
Select the items you want to log.
TSQL → SQL:BatchStarting will get you sql selects
Stored Procedures → RPC:Completed will get you Stored Procedures.
More information from Microsoft: SQL Server 2008 Books Online - Using SQL Server Profiler
Update - SQL Express Edition:
A comment was made that MS SQL Server Profiler is not available for the express edition.
There does appear to be a free alternative: Profiler for Microsoft SQL Server 2005 Express Edition
There is one more way to get information about queries that has been executed on MS SQL Server Express described here.
Briefly, it runs smart query to system tables and gets info(text, time executed) about queries(or cached query plans if needed). Thus you can get info about executed queries without profiler in MSSQL 2008 Express edition.
SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY deqs.last_execution_time DESC
…Late answer but I hope it would be useful to other readers here…
Using SQL Server Express with advanced auditing requirements such as this is not really optimal unless it’s only in development environment.
You can use traces (www.broes.nl/2011/10/profiling-on-sql-server-express/) to get the data you need but you’d have to parse these yourself.
There are third party tools that can do this but their cost will be quite high. Log explorer from ApexSQL can log everything but select and Idera’s compliance manager will log select statements as well but it’s cost is a lot higher.
You can log changes. SQL Server 2008 will make this especially easy with Change Data Capture. But SQL Server isn't very good at logging SELECTs.
It is theoretically possible with the profiler, but it will kill your performance. You might "get away with it" on your desktop, but I think you'll notice your machine acting slow enough to cause problems. And it definitely won't work after any kind of deployment.
One important point a couple others have missed already: unless they changed something for 2008 I didn't hear about, you can't trigger a SELECT.
Just for the record, I'm including the hints to use DataWizard's SQL Performance Profiler as a separate answer since it's really the opposite to the answer pointing at SQL Server Profiler.
There is a free trial for 14 days, but even if you need to buy it, it's only $20 for 3 servers (at the moment of writing, 2012-06-28). This seems more than fair to me considering the thousands everybody using SQL Server Express edition has saved.
I've only used the trial so far and it offers exactly what the OP was looking for: a way to trace all queries coming in to a specific database. It also offers to export a trace to an XML file. The paid version offers some more features but I haven't tried them yet.
Disclaimer: I'm just another developer messing with DBs from time to time and I'm in no way affiliated with DataWizard. I just so happened to like their tool and wanted to let people know it existed as it's helped me out with profiling my SQL Server Express installation.
I would either use triggers or use a third party software such as Red Gate to check out your SQL log files.
Seems that you can create traces using T-SQL
http://support.microsoft.com/kb/283790/
That might help.
The SQL query below can show simple query logs:
SELECT last_execution_time, text
FROM sys.dm_exec_query_stats stats
CROSS APPLY sys.dm_exec_sql_text(stats.sql_handle)
ORDER BY last_execution_time
This is how it looks like below:

How can I monitor the executed sql statements on a SQL Server 2005

In a project of mine the SQL statements that are executed against a SQL Server are failing for some unknown reason. Some of the code is already used in production so debugging it is not an easy task. Therefore I need a way to see in the database itself what SQL statements are used, as the statements are generated at runtime by the project and could be flawed when certain conditions are met.
I therefore considered the possibility to monitor the incoming statements and check myself if I see any flaws.
The database is running on a SQL Server 2005, and I use SQL server management studio express as primary tool to manipulate the database. So my question is, what is the best way to do this?
Seeing how you use the Management Studio Express, I will assume you don't have access to the MSSQL 2005 client tools. If you do, install those, because it includes the SQL profiler which does exactly what you want (and more!). For more info about that one, see msdn.
I found this a while ago, because I was thinking about the exact same thing. I have access to the client tools myself, so I don't really need to yet, but that access is not unlimited (it's through my current job). If you try it out, let me know if it works ;-)
Best way is to fire up profiler, start a trace, save the trace and then rerun the statements