on 03-15-2016 7:10 PM
Is there any way to capture any query running against IQ longer than....let say 10 or 15 min? I can't seen to find the query execution time in the svrlog or iqmsg files. It would be nice to be able to such monitoring in place to capture bad or long running query early from the server side.
Does this monitored SQL make sense here?
select T.Userid, T.ConnHandle, C.ConnCreateTime, C.LastReqTime, C.IQCmdType, datediff(minute, LastReqTime, now()) as elapsed
from sp_iqtransaction() T
join sp_iqconnection() C on T.state != 'COMMITTED'
-- and C.ReqType = 'FETCH'
and T.ConnHandle = C.ConnHandle
and (C.IQCmdType not like 'IQU%' and C.IQCmdType != 'NONE')
and datediff( minute, LastReqTime, now()) > 10
And how do we know this is report select SQL or batch (insert, update, delete)?
Enabling sql request logging could help. However this will capture all queries. You need then filter and keep aside only info related to long running queries.
call sa_get_request_times('/mytraces/iq_zr.log');
select * from satmp_request_time
where millisecs >= 600000
order by millisecs desc;
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes!
Specifies a threshold for query execution. The post-query plan is generated only if query execution time exceeds the threshold.
Integer, in milliseconds.
0
Option can be set at the database (PUBLIC) or user level. When set at the database level, the value becomes the default for any new user, but has no impact on existing users. When set at the user level, overrides the PUBLIC value for that user only. No system privilege is required to set option for self. System privilege is required to set at database level or at user level for any user other than self.
Requires the SET ANY PUBLIC OPTION system privilege to set this option. Can be set temporary for an individual connection or for the PUBLIC role. Takes effect immediately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you move to IQ 16 (15.4 is EOL/out of support in June/July), set it server wide if you wish or at least for the user that the Cognos users are coming in from.
We brought this into IQ for precisely your use case.
In IQ 15.4, there's no way to do this other than always generate query plans and then delete the ones with a runtime that is below a threshold. You cannot grab a query plan from another connection, unfortunately, so it has to be turned on before the query began.
Mark
We are waiting for couple CR fixed 1st before upgrade DEV server to IQ 16.
Loading gz data file, IQ 16 is way much slower than IQ 15.4.
Actually, we do not need the query plan to generate (write to srvlog); what we want is to capture long running SQL here.
So my post monitored sql, can do the silly trick or not in IQ 15.4?
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.