Wednesday, September 14, 2016

Killing Sessions on Netezza

Killing  Sessions on Netezza

To kill all active sessions on Netezza, to restart a test.

You can use nzsession to list to session id’s, and nzsession abort to kill them manually, but I wanted a means to do it in one.

To Kill All session 

for ses in `nzsession | grep ADMIN | awk ‘{print $1}’`
do
nzsession abort -id ${ses} -force
done
========================================================================


To Kill any single session 

Nzsession -show

then

nzsession abort -id ""session"


========================================================================

Important Note:-

Don't not kill any session using Kill-9 "pid" ever, It may restart your your NPS.

1 comment:

  1. If generate statistics running for 75 databases almost 10000 tables from shell script then how do we kill that.
    If we kill using nzsession abort then it will continue for next table. So if it is the case we need supply nzsession abort 10000 times so please advice how do we kill it permanently.

    ReplyDelete