Informix

 View Only
  • 1.  Viewing parsed queries

    Posted Wed May 06, 2020 09:20 AM
    Hi Guys,

    I have an external process accessing a database which is not behaving well. I would like to look at the query in detail. Is there a log of parser activity maintained somewhere, or any other way of viewing queries offered to the database?

    TIA

    Steve

    ------------------------------
    Steve Roach
    ------------------------------

    #Informix


  • 2.  RE: Viewing parsed queries
    Best Answer

    IBM Champion
    Posted Wed May 06, 2020 09:28 AM
    Steve:

    There is no permanent history, no. The "onstat -g sql 0" or "onstat -g ses 0" reports will print out all currently running queries but little history. 

    If you turn on SQLTRACE you can configure a ring buffer to capture and save the <N> previous SQL statements in a memory buffer that you can query using the sqltrace* tables in sysmaster. But if your system is busy that won't cover much time. You could though have a process unload the sqltrace* tables periodically to disk, but again, you may miss some statements.

    There are 3rd party products that can capture all SQL submitted to the server over the network (they will not see local shared memory connections though). Two of these are iWatch from exact-solutions (www.exact-solutions.com) and SQL PowerTools from www.sqlpower.com.

    iWatch is the more mature product, but both are excellent.

    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.








  • 3.  RE: Viewing parsed queries

    Posted Wed May 13, 2020 07:07 PM
    Hi Art,

    Thanks for the answer - very comprehensive.

    ------------------------------
    Steve Roach
    ------------------------------