Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 07 Oct 2008 @ 13:48:11 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Automate Cancelling Sessions
 
From:   Asghar, Umer

Hi,

There are few ways to accomplish this:

1) Assume that you have list of particular user, whose session need to be killed, then you can do like this:

Assume username whose session to be killed is 'userabc', then

     ----------------------------
     /tgtw/bin/xgtwglobal -nw < $input

     Contents of ($input) file:
                    SELECT HOST host_no
                    KILL user userabc
                    QUIT
     ----------------------------

This will kill all the session of user 'userabc'.

2) If, you have more than one user, then you can do the scripting to accomplish the task.

3) You can also do like this, Now assume that your user have particular string in comman, or you have list of your users. Now you have to write dynamic sql on the table dbc.sessioninfo to check for the presence of active sessions. And then pass the output to xgtwglobal. Using this method you can kill sessions on the basis of 'username', 'accountname', 'defaultdatabase', 'logondate', 'logonsource'

     ----------------------------
     sel hostno, sessionno from dbc.sessioninfo
     where username like '%pattern%';
     ----------------------------

Here's how to execute xgtwglobal in Unix.

     ----------------------------
     /tgtw/bin/xgtwglobal -nw < $input

     Contents of ($input) file:
                    SELECT HOST host_no
                    KILL SESSION session_no
                    QUIT
     ----------------------------

To abort any specific user session, dynamically generate ($input) file using BTEQ/UNIX script.


Regards,

Umer Asghar.



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023