How can I log all commands the clients are sending to database server? I wanna to "see" those commands to know how entity framework 4.0 is generating sqls and maybe try to change ling expressions. asked 10 Mar '10, 12:34 Zote Volker Barth |
I use these Commands to enable request level logging as needed.
For more Options see sa-server-option-system-sysproc
With these commands you can switch on the logging from a iSQL Session before you press a Button in your Application. This make it possible to log only the interesting SQL code. answered 10 Mar '10, 20:10 Thomas Dueme... |
While request logging will log the statements, the Application Profiling feature within Sybase Central permits both the logging of all statements PLUS their graphical plans. As Application Profiling results are stored in a database, you can then mine the logging data using whatever specific criteria you desire (for example, listing only those statements that refer to a specific table, or only those statements that took longer than a certain elapsed time). answered 10 Mar '10, 17:06 Glenn Paulley I never can to use this option. I can create perf db and start/stop capture, but I don't know how to analyse data. :( 2
@Glenn: I feel Zote's pain... there is a certain [cough] barrier to entry when it comes to getting the most out of Application Profiling... LogExpensiveQueries was easier even though it required a great deal of manual effort. It's a GUI thing, as in Graphic Usability Issues. @Glenn: Breck's comment says what I think too. A few SQL statements loaded from a script file, and off you go. I tried to use Application Profiling with a 9 GB database: creating the log database took hours. And finding the right way to get to analyzing the result was a real pain. |
I guess "Request logging" will do what you request. I would try
(and possibly the other -zr options as well). answered 10 Mar '10, 16:18 Volker Barth |
You can switch on SQL logging capability locally in client side (see ODBC connection properties, advanced tab). In that case you don't need to have any administrative access to db server, and can intercept and analyse sql generated only by your application. answered 22 Jan '13, 06:45 AlexeyK77 ...as long as the client is using ODBC (whereas in Zote's original case, I guess it's a native ADO.Net connection and therefore not using ODBC at all)...
(22 Jan '13, 07:26)
Volker Barth
|
Have you tried dbsrv11 -zr SQL -zo RLL.log already (and possibly the other -zr options)?
@Volker: If anything qualifies as an actual "answer" as opposed to a comment, your comment does... I think :)
@Breck: Who would dare to argue with the Administrator:) - The main reason for just commenting is my quite small own experience with RL. But you're right, this site should not suffer from too shy users.