IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Function of EXPLAIN in Db2


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sirigirisuresh
Warnings : 2

New User


Joined: 29 Apr 2006
Posts: 3

PostPosted: Wed Jan 03, 2007 3:34 pm
Reply with quote

Please tell me what EXPLAIN will do in Db2[/quote]
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Jan 03, 2007 3:38 pm
Reply with quote

Hi There,

Please have a look

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2tools.adb.doc.ug/h1xexchap.htm
Back to top
View user's profile Send private message
blpraveenspi
Currently Banned

New User


Joined: 03 Jan 2007
Posts: 3
Location: Mysore

PostPosted: Wed Jan 17, 2007 3:39 pm
Reply with quote

Explain is a DB2 Administration function .You must have Db2 Admin tailored into your system.IF DB2 Admin tool is Activated, Type E on command line to use DB2 Admin utiltiy Explain.
*Before you can use EXPLAIN, you must create a table called PLAN_TABLE to
hold the results of EXPLAIN
*populate PLAN_TABLE by executing the SQL statement EXPLAIN.
The EXPLAIN statement captures information about the access plan
chosen for the supplied explainable statement and places this information
into the Explain tables. An explainable statement is a DELETE, INSERT,
SELECT, SELECT INTO, UPDATE, VALUES, or VALUES INTO SQL
statement.
*You can populate a plan table when you bind or rebind a plan or package.
Specify the option EXPLAIN(YES).
*Cloumns pf Plan-Table
QUERYNO QBLOCKNO APPLNAME PROGNAME PLANNO METHOD CREATOR TNAME TABNO
ACCESSTYPE MATCHCOLS ACCESSCREATOR ACCESSNAME INDEXONLY SORTN_UNIQ
SORTN_JOIN SORTN_ORDERBY SORTN_GROUPBY SORTC_UNIQ SORTC_JOIN SORTC_ORDERBY
SORTC_GROUPBY



Simple Query to Extract all the SQL Statements in Packages
SELECT * FROM JOE.PLAN_TABLE
WHERE PROGNAME = 'PACK1' AND COLLID = 'COLL1' AND VERSION = 'PROD1'
ORDER BY QUERYNO, QBLOCKNO, PLANNO, MIXOPSEQ;
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top