Informix

 View Only
  • 1.  Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Wed January 04, 2023 06:30 PM
    Hi,

    Recently I upgraded the informix server from 11.70FC8  to 12.10FC15 (due to compatibilty issues I don't upgrade to version 14.x)

    Since then, the output of "onstat -g ses " always shows the Last 20 Sessions Terminated

    Example:
    ...
    5 informix - 0 - 0 20480 16832 off
    4 informix - 0 - 0 20480 16832 off
    3 informix - 0 - 0 20480 16832 off
    2 informix - 0 - 0 20480 16832 off

    Last 20 Sessions Terminated
    ...
    Ses ID Username Hostname PID Time Reason
    1493833 user1 server01 28016 10/23/2022.07:00 onmode z
    1777441 user2 server02 8452 10/30/2022.07:00 onmode z
    2054425 user3 server03 16380 11/06/2022.07:00 onmode z
    ...


    I don't know why IBM changed the default behaviour of onstat -g ses

    Is there a configuration parameter or another option in onstat to avoid this part of the output ? 

    Thanks in advance,
    Roger

    ------------------------------
    Roger Vilca
    ------------------------------

    #Informix


  • 2.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Thu January 05, 2023 07:36 AM
    Edited by System Test Fri January 20, 2023 04:25 PM
    Hey Roger

    The Last 20 Sessions Terminated section of the output from the onstat -g ses command was introduced at IDS 12.10 but I am not certain at which patch version ...
    [ informix@informix-01 ] ~ > onstat -g ses

    HCL Informix Dynamic Server Version 12.10.FC13XT -- On-Line (Prim) -- Up 85 days 02:51:07 -- 115646856 Kbytes

    session #RSAM total used dynamic
    id user tty pid hostname threads memory memory explain
    8430398 informix - 0 - 0 16384 12416 off
    8430397 informix - 64492 informix-01 1 1638400 1599720 off
    :
    4 informix - 0 - 0 16384 12416 off
    3 informix - 0 - 0 16384 12416 off

    Last 20 Sessions Terminated

    Ses ID Username Hostname PID Time Reason
    8429988 informix informix-01 61805 01/05/2023.03:50 onmode z
    8430242 informix informix-01 63689 01/05/2023.03:52 onmode z 

    Total Terminated 2
    As far as I know, there isn't a parameter that can be set to suppress this section of the output. Restarting the Instance will yield the desired result but that may not be feasible if your system is in Production. I haven't tested whether or not onstat -z has any effect but you may upset a few people if you wiped out the statistics gathered over the Instance uptime.

    I prefer to use what follows; Employing  sed, I search for the first occurrence of the string: Last 20 and once pattern matched I delete from that line number to the end of the piped output resulting in...
    [ informix@informix-01 ] ~ > onstat -g ses | sed '/^Last 20 /,$d'

    HCL Informix Dynamic Server Version 12.10.FC13XT -- On-Line (Prim) -- Up 85 days 02:52:09 -- 115646856 Kbytes

    session #RSAM total used dynamic
    id user tty pid hostname threads memory memory explain
    8430477 informix - 0 - 0 16384 12416 off
    8430474 openbet - 21098 siteserver-02 1 73728 64344 off
    :
    5 informix - 0 - 0 16384 12416 off
    4 informix - 0 - 0 16384 12416 off
    3 informix - 0 - 0 16384 12416 off


    ------------------------------
    Kirit Rana
    ------------------------------



  • 3.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Thu January 05, 2023 10:43 AM
    Thanks for your response Kirit,

    I verified that onstat -z doesn't have any effect.

    Finally, I created a little script as a "wrapper" that use "sed" according your suggest. 

    #!/bin/sh

    if [ $# -ne 1 ] ; then
    echo "Ingrese sesion"
    exit 1
    fi
    sid=$1

    onstat -g ses $sid | sed '/^Last 20 /,$d'

    exit 0

    Regards,
    Roger

    ------------------------------
    Roger Vilca
    ------------------------------



  • 4.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Thu January 05, 2023 11:11 AM
    Looks good. Does it work? You may have to fully qualify the path to the onstat binary or export the PATH variable at the head of the script.

    ------------------------------
    Kirit Rana
    ------------------------------



  • 5.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Thu January 05, 2023 03:41 PM
    Hi,

    Yes it works. Anyway I will proceed with your suggest.

    Thanks,
    Roger

    ------------------------------
    Roger Vilca
    ------------------------------



  • 6.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Fri January 13, 2023 07:03 PM


    Hi,

    There is no option to disable this change to existing functionallity..

    Feature Reqest Raised, please vote it up - https://ibm-data-and-ai.ideas.ibm.com/ideas/INFX-I-500

    Regards,

    David.



    ------------------------------
    David Williams
    ------------------------------



  • 7.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Thu May 25, 2023 11:23 AM

    Thank you David Williams for this kind of help. I really appreciate your effort.



    ------------------------------
    Manga Go
    ------------------------------



  • 8.  RE: Avoid to see the Last 20 Sessions Terminated in onstat

    Posted Wed May 31, 2023 10:43 PM

    I see those information in version 14.10.fc8 also, it's useless. 



    ------------------------------
    chuan lu
    ------------------------------