on 2010 Mar 10 12:34 PM
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.
Request clarification before answering.
I use these Commands to enable request level logging as needed.
-- Set Destination relative to db server !!!
call sa_server_option('Request_level_log_file', 'C:\\temp\\mylog.txt');
-- Log everything
call sa_server_option('Request_level_logging', 'ALL');
-- Log only SQL
call sa_server_option('Request_level_logging', 'SQL');
For more Options see sa-server-option-system-sysproc
-- Add a Comment to the log file
call sa_audit_string('Ahead of Procedure call');
-- Stop logging
call sa_server_option('Request_level_logging', 'NONE');
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
I guess "Request logging" will do what you request.
I would try
dbsrv11 -zr SQL -zo RLL.log
(and possibly the other -zr options as well).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.