Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 22 Nov 2011 @ 08:27:26 GMT


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


Subj:   Re: How to abort a session from a batch program ?
 
From:   sivaji.gv

In TD12, you can use SYSLIB.AbortSessions() function to abort the selective session based on hostid, username and sessionno.

Also you can get the hostid, username and sessionno from table function MonitorSession(-1,'*',0) function.

Eg:

     /* redirect below output to an sql file and run this through bteq */

     /* Abort sessions selectively for a user */ SEL 'SELECT SYSLIB.AbortSessions(' ||
     TRIM(A.Hostid)||','||''''||TRIM(A.UserName) || '''' ||','|| CAST(A.SessionNo AS FLOAT
     FORMAT'zzzzz9999') || ','||''''|| 'Y' || ''''
     ||','|| ''''|| 'N' || '''' || ');' (TITLE '')
     FROM (
     SELECT hostid,username ,sessionNo
     FROM
     TABLE (MonitorSession(-1,'*',0)) AS t2
     WHERE username='SYSDBA11' AND logontime <= '2011/11/19 00:00:00.00'
     ) A ORDER BY username;

Regards

Sivaji GV
DWSDBA



     
  <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