Thursday, June 2, 2011

S_SRM_TASK_HIST Table

One of my admin friend once told me that the problem with troubleshooting is that trouble shoots back. In my on going quest for controlling multiple Login-Logout sessions in Directory authentication environment i landed up in situation where we required to know the list of naughty users who are working in multiple sessions. Instead of shooting back to admin friend i thought lets-hit-google and really found something worth sharing.

Issue: We set Flag on Login and unset the same on Logout in order to determine availability for assignment purpose. In multiple login/logout scenario this approach fails. We have to maintain the exact status of Employee in order for correct assignments.

Solution: This could be accomplished in two ways. First option is, We can have batch script which executes command to list the number of sessions currently logged in each application server.

List Active sessions for comp PsCcObjMgr_enu show SV_NAME,CC_ALIAS,OM_LOGIN

Above command will list the active sessions. Based on the active sessions we can update flag (Available/Unavailable) in db for logins by using stored procedure.

But being KISS(Keep it short and simple) follower an alternate and effective solution could be to query DB for active sessions and update the flag as required. Now the question arises is how to fetch active sessions from db itself. "S_SRM_TASK_HIST" table comes as life saver in this scenario. This table lists all the sessions on the object manager along with start and end date. So we can easily determine which is active and which one is dead.

select SRVR_START_TS,SRVR_END_TS,SRVR_COMP_NAME,SRVR_USER_NAME
from siebel.S_SRM_TASK_HIST where SRVR_COMP_NAME IN ('PSCcObjMgr_enu')
Order by SRVR_USER_NAME

S_SRM_TASK_HIST stores the task information for all the object managers. By default it is set to maintain history for 24 hours but it is configurable.

There are not many ways to control multiple login in siebel but each fails with some shortcomings. More ideas to control multiple logins are welcome here.

Happy Crunching!!

2 comments:

Anonymous said...

What is the siebel version? I thought Siebel stores session info in virtual tables.

Siebelish said...

Siebel 8.0 above it stores session history in this table also.