Archives of the TeradataForum
Message Posted: Thu, 08 Sep 2005 @ 09:42:11 GMT
<-- Anonymously Posted: Wednesday, September 07, 2005 20:24 -->
Is there a Teradata Table from where I can Select my current Session's Thread ID (and/or Job ID for a Host Session). I already know that the Thread ID is buried in the LogonSource of the SessionInfoX and LogonOff tables and can parse it out, but if I am logged on with the same UserName and therefore possess more than one active Thread simultaneously, how do I know the exact Thread ID of a Session if it submits a query (i.e. self- awareness)?
For example, log onto Teradata SQL Assistant. Open a second instance of SQL Assistant and logon a second time. You now have two different Sessions and two different threads under the same UserName. Now execute select * from dbc.SessionInfoX and you should see at least those two different Sessions and Threads (plus others if you also happen to also be logged on to PMon or elsewhere). Without pre-capturing your LogonTime, which one belongs to which open SQL Assistant window?
Is there a Teradata query one can perform like a "Who Am I" that will return the Thread ID of the querying Session. If not, is there a query that will lead me to that Thread ID via another table joined to SessionInfoX via another column? Understand, I don't mean a Unix command like ps -ef. I want to execute a command within Teradata Utilities to establish my self-awareness. This must be possible some how since Teradata knows which Thread ID belongs to which Session such that it can embed it in the LogonOff table's LogonSource.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|