Informix

 View Only
  • 1.  SQLTRACE uid mapping

    Posted Tue March 21, 2023 11:18 AM

    Two questions:

    1. I've used sqltrace for many years but have one area that I can't get clear ... sql_uid mapping to users via sql (not SS, OAT or HQ). I capture via a scheduler task the content of sysmaster:syssqltrace to sysadmin:mon_syssqltrace. sql_uid equates to a number and what I'm looking for is where these numbers are mapped. I know they correlate with syssessions, but what about users that don't have a session in syssessions? 

    2. I've turned on sqltrace at the "user" level and then added a user, let's say "skippy" to the user list. But I still am getting other users as well (agreed - this may be leftovers but my trace buffer duration is 5 secs so I doubt it). I may be getting the order of ops wrong since I've typically used SS or OAT for this over the years. 



    ------------------------------
    Thanks! 
    Mark Scranton
    The Mark Scranton Group
    mark@markscranton.com
    ------------------------------


  • 2.  RE: SQLTRACE uid mapping

    IBM Champion
    Posted Tue March 21, 2023 11:33 AM

    Mark:

    You are overthinking this one. The sql_uid is the OS user id for the connected user:

    informix@Elezar-II:~$ dbaccess sysmaster -
    > select * from syssqltrace where sql_database = 'art';

    sql_id            65
    sql_address       1501114952
    sql_sid           90
    sql_uid           1000
    sql_stmttype      1
    sql_stmtname      DATABASE
    sql_finishtime    1679412473
    sql_begintxtime   1210465378
    sql_runtime       0.00246567244
    ...

    art@Elezar-II:~$ id
    uid=1000(art) gid=1000(art) groups=1000(art),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),133(lxd),134(sambashare),1001(informix)



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: SQLTRACE uid mapping

    Posted Tue March 21, 2023 01:42 PM

    Thanks Art. I haven't "overthinked" (sic) anything since uh, yesterday. 

    So for windows client or a web app coming in with a connection string/passwd embedded - where does UID come from in those cases? 

    Any thoughts on Q#2 n original thread? May just be a syntax issue ... if so, nevermind, I'll work through it eventually. 

    Thanks! 



    ------------------------------
    Thanks! 
    Mark Scranton
    The Mark Scranton Group
    mark@markscranton.com
    ------------------------------



  • 4.  RE: SQLTRACE uid mapping

    IBM Champion
    Posted Tue March 21, 2023 02:01 PM

    Mark:

    For clients connecting with a user id & pwd the server or trusted connection the user has to have a local login with the same user name. The engine does a getuser() call to validate and gets the uid from there. For mapped users, the uid will that of the local template user. All regardless of whether the client is running on Linux/Unix or Windows. If Kerberos or other authentication was used, I don't know where the uid would be coming from or how you would look it up. For Linux/Unix based servers, for most uid's just grep /etc/passwd:

    art@Elezar-II:~$ grep 1000 /etc/passwd 



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------