
If ASE server was been disable MDA monitoring, you hit a query issue frequently and hard to identify the exact query being run by the user at the point in time. You want to capture submitted SQL using application tracing.
Following is steps of Application Tracing:
For example, during the slow query being run:
-------------------------
isql -Usa -P<pwd> -S<servername>
1> sp_who --find spid of the slow uery, e.g. spid 12
2> go
1> set tracefile '/tmp/spid12_20150825.out' for 12
2> go
1> dbcc traceon(3604)
2> go
1> set show_sqltext on --'set' commands apply to session 12 from now on
2> go
1> set statistics time, io on
2> go
<Waiting for the query (session:12) to finish>
1> set tracefile off -- disable tracing
2> go
1> set tracefile off for 12
2> go
You could find trace output in tracefile: '/tmp/spid12_20150825.out'.
-------------------------
Application Tracing in ASE 15.0.2 and above:
Please note:
Notes
1. The file storing the trace output is closed when the session being traced quits or when you disable tracing.
2. Before you allocate resources for tracing, keep in mind that each tracing requires one file descriptor per engine.
Tracing a session
Once you have enabled tracing for a session, any further set commands associated with QP debugging take effect for the session being traced vs. the session issuing the commands.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
28 | |
25 | |
23 | |
19 | |
19 | |
15 | |
12 | |
10 | |
8 | |
8 |