If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Execution Plan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-10, 05:11
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
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
Reply With Quote
  #2 (permalink)  
Old 01-05-10, 05:40
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #3 (permalink)  
Old 01-05-10, 07:34
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Hi Stolze ,

Thanks for the reply

I am using Db2 9.5C Express is that a problem?
Reply With Quote
  #4 (permalink)  
Old 01-21-10, 09:50
Lucasgpl Lucasgpl is offline
Registered User
 
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 10:00.
Reply With Quote
  #5 (permalink)  
Old 01-21-10, 10:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #6 (permalink)  
Old 01-21-10, 10:18
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On