Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Posts
    21

    Question Unanswered: Track SQL Statements

    HI all,

    is there a way how to track SQL statements sent to the server?

    I'm using ADO.NET Entities Tool which generates these statements automatically (based on entity model etc...), so I can't check them and I don't know how they look like.

    I know about possibility to create Event Monitors, but it seems to me too complicated to define, filter, manage and analyze records.

    Isn't there another easier way how to track them?

    Thanks a lot!

    Frantisek

    ---
    DB2 v9.5.0.808 (Express), OS Win 2003 Server

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Easiest way is to "Get snapshot for dynamic SQL" (see Command Reference). You will have to turn on the statement monitor.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    db2pd is your friend

  4. #4
    Join Date
    Apr 2009
    Posts
    21
    I'm probably missing something, but when i run command db2pd in the interactive mode and then enter -db DBNAME -dynamic command, the tool displays tons of statistics from the past.

    When I enter the command db2pd -db DBNAME -dynamic, the output is Option -dynamic requires -db <database> or -alldbs option and active database.

    I'm DB2 greenhorn, so I'd like a tool like a MS SQL Profiler - it is a windows application with disagnostic window and when it is active, it monitors activity and displays SQL statements immediately after they are sent to the SQL server, so it is easy fo find last command and assign it to the correct UI action.
    MS SQL Profiler Screenshot

  5. #5
    Join Date
    Apr 2009
    Posts
    21
    Quote Originally Posted by Marcus_A
    Easiest way is to "Get snapshot for dynamic SQL" (see Command Reference). You will have to turn on the statement monitor.
    Do you mean some special SQL statemenet?

  6. #6
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    You could flush the package cache if you do not want the "SQL history lesson". To look at the SQL currently execuitng I'd recomment db2mon.

  7. #7
    Join Date
    Apr 2009
    Posts
    21

    Thumbs up

    Quote Originally Posted by dr_te_z
    You could flush the package cache if you do not want the "SQL history lesson". To look at the SQL currently execuitng I'd recomment db2mon.
    Yep, that's the tool i was looking for :-) It is based on snapshots also, but it has functionality to show differences between them. It has potential to become my favorite tool :-) Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •