Topic Thread

Expand all | Collapse all

Viewing parsed queries

Jump to Best Answer
  • 1.  Viewing parsed queries

    Posted 21 days ago
    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?



    Steve Roach

  • 2.  RE: Viewing parsed queries
    Best Answer

    Posted 21 days ago

    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 ( and SQL PowerTools from

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


    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 14 days ago
    Hi Art,

    Thanks for the answer - very comprehensive.

    Steve Roach