I set up SQL Anywhere monitor and i get mails with long running queries. But they do not contain statement.
The database is started with the -zl option. How can i set this to be on on all connections?
A query has been running longer than the 10 s threshold. A query issued by connection 'SQL_DBC_1ca0cfc0' (ID 10) has been running for 47 s. In order to see the query being executed, last statement recording must be turned on. To turn on last statement recording, execute the following in DBISQL: CALL sa_server_option( 'RememberLastStatement', 'ON' ). Alternatively, last statement recording can be turned on using the -zl dbsrv12 server option.
The message: To solve this problem, try closing the connection that issued this query. Check the query to make sure that it is not unnecessarily costly (for example, using a JOIN without a WHERE clause).
A long running query may also be symptomatic of a database server under a heavy workload. Check that the database server is not currently performing cache- or CPU-intensive queries, and that the number of connections is within acceptable limits.
asked 25 Jun '14, 10:17