killing a particular query in a session with out viewpoint/pmon

Database
Enthusiast

killing a particular query in a session with out viewpoint/pmon

Hi All,

Following is the scenario.

User logs into a system using queryman with a particular session id and runs 5  queries in the queryman in different tabs within the same sql assistant.

All the queries are running presently

I need to kill the query 1 (i know the statement of the query) without using pmon ot viewpoint

Any idea how to do that?

Please note:I am aware of the syslib function to do this.but this function aborts the entire session there by all the 5 queries get aborted.

7 REPLIES
Enthusiast

Re: killing a particular query in a session with out viewpoint/pmon

Hope my requirement is not clear!!!

I need to kill a particular single query in SQL Assistant which has already other five queries running in different tabs .

I dont have access to PMON or viewpoint and any query/function will do this stuff?

Junior Supporter

Re: killing a particular query in a session with out viewpoint/pmon

I don't think you can kill a statement, you can kill a session without PMON using SYSLIB.AbortSession() if granted.

HTH.

Cheers.

Carlos.

Senior Apprentice

Re: killing a particular query in a session with out viewpoint/pmon

You can't have multiple requests running iin parallel within a single session. When you run a second query in SQL Assistant, it's doing following sequence in the background: logon a second session, submit the query, logoff again.

So in your case there are different sessions, which can be killed independently. Just do it the same way you kill any other session.

Dieter

Enthusiast

Re: killing a particular query in a session with out viewpoint/pmon

Thanks carlosal and Dieter for your responses

Dieter,

I am assuming from your response that if a user logs into the system using SQL Assistant and run a first query the query will run with a particular "sessionid" say 'X' and when he submits another query in another tab in the same SQL Assistant will the second query run with other "sessionid" say 'Y' and so on?I am stressing "sessionid" here as the abortsession function requires this sessionid to kill the particular query.

But i am still not convinced as i can see the dbqlogtbl showing the "sessionid" as same for the particular user who had logged into the sqlassistant with the same "logondatetime" and executed about 100+ queries with different "queryid" 

So the  "SessionNoIn" parameter in abortsessionfunction  represents the "queryid" in dbqlogtbl instead of the "sessionid" in the dbqlogtbl?

Correct me if am wrong.

Expecting your expert advice

Junior Supporter

Re: killing a particular query in a session with out viewpoint/pmon

>>So the  "SessionNoIn" parameter in abortsessionfunction  represents the "queryid" in dbqlogtbl instead of the "sessionid" in the dbqlogtbl?

The sessionNoIn is the SessionNo in dbc.sessioninfo.

The ID of the session to abort.

A value of zero indicates all sessions.

HTH.

Cheers.

Carlos.

Senior Apprentice

Re: killing a particular query in a session with out viewpoint/pmon

Of course all queries within a session are logged with the same LogonTime, beause it's the session's logon time.

Just put a SELECT SESSION; before the long running queries in SQL Assistant and submit them using F5, you'll see different session numbers when they run in parallel.

Dieter

Enthusiast

Re: killing a particular query in a session with out viewpoint/pmon

Thanks for clarifying me carlosal and Dieter

That explains it!!!