Results 1 to 6 of 6

Thread: Execution Plan

  1. #1
    Join Date
    Jan 2009
    Posts
    153

    Unanswered: Execution Plan

    Hi Experts,

    How to view access plan or execution plan in DB2?

    In control center we have a tab for access plan but i am not able to see that?

    Please help

    TIA

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I don't know where you can't see this tab. Clicking on it shows you the access plan for the given SQL statement. Another alternative is the db2expln utility, which gives you the access plan as ASCII art.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Jan 2009
    Posts
    153
    Hi Stolze ,

    Thanks for the reply

    I am using Db2 9.5C Express is that a problem?

  4. #4
    Join Date
    Jan 2010
    Posts
    4

    Run all SQL statements in EXPLAIN MODE EXPLAIN

    Hi,

    well, i have all of my statements sitting in a snapshot table, so i generate a text file with all this statements (ie. dyn_sql.txt).

    later, from db2 console (under linux ) i execute this:

    set current explain mode explain
    db2 –tf dyn_sql.txt

    and my problem is that obtain this message error for each statement that contains "bind variables"

    "SQL0313N The number of host variables in the EXECUTE or OPEN statement is not equal to the number of values required. SQLSTATE=07004"


    How can i resolve this error message?

    thx in advance

    p/d: sorry for my english
    Last edited by Lucasgpl; 01-21-10 at 11:00.

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by Lucasgpl View Post
    Hi,

    well, i have all of my statements sitting in a snapshot table, so i generate a text file with all this statements (ie. dyn_sql.txt).

    later, from db2 console (under linux ) i execute this:

    set current explain mode explain
    db2 –tf dyn_sql.txt

    and my problem is that obtain this message error for each statement that contains "bind variables"

    "SQL0313N The number of host variables in the EXECUTE or OPEN statement is not equal to the number of values required. SQLSTATE=07004"


    How can i resolve this error message?

    thx in advance

    p/d: sorry for my english
    Please start a new thread when asking a new question. You will get a better response.

    Andy

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by ratheeshknair View Post
    Hi Stolze ,

    Thanks for the reply

    I am using Db2 9.5C Express is that a problem?
    If I remember correctly, you have to have the explain tables created under the user that is logged into command editor in order to see the access plan tab.

    Andy

Posting Permissions

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