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

DB2 Compiler Questions


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sibi Yohannan

New User


Joined: 15 Apr 2009
Posts: 47
Location: Bangalore

PostPosted: Tue Apr 28, 2009 12:05 pm
Reply with quote

Can you tell me what are all the factors which determines the method to access the Table easily while defining a PLAN?

Also whenever an SQL statement encounters during Run-time, it checks the corresponding PLAN name and then access the Table using the procedure mentioned in the PLAN details. IS that correct?

Where exactly the PLAN is stored, Is it in a DB2-Catalogue or in the Db2 Database itself?

Sibi
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 28, 2009 3:03 pm
Reply with quote

Please check this link: ibmmainframes.com/viewtopic.php?t=23965
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Wed Apr 29, 2009 12:12 am
Reply with quote

Hi Sibi

While a PLAN is being created by the BIND process, normally the STATISTICS of the Tablespace is used. That is why the utility RUNSTATS is very important to BIND process. When you run a REORG and LOAD utility on a tablespace, it is advised to run REBUILD and RUNSTATS utility. After that REBIND the PLAN which will give you the new access path based on the new statistics of your tablespace.

For the second part your query

When an SQL is executed - Static or Dynamic - there must a PLAN to access the table. If it is a Static SQL, there must a predefined PLAN. Because we have to BIND the plan before the execution.
If the SQL is a Dynamic, before accessing the table for rows, BIND process will go through these steps.
1. Check the syntax.
2. Resolves the table name
3. Check the privilege
4. Create access path based on statistics
5. Reserve the resource
6. Execute the SQL.
7. Send the result to the desired location.

For your third part of your query

The PLAN is neither stored in DB2 Catalog nor in the Database.
PLAN is stored in the DB2 Directory- DSNDB01.

Please go through as many as DB2 manuals as possible.

Regards
Raghu
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Compiler and run JCL for basic PL/I p... PL/I & Assembler 10
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Pre-Compiler Bug with DSNH520I message? DB2 1
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
Search our Forums:

Back to Top