Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Compiler Questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: DB2 Compiler Questions
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

Senior Member


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

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

Please check this link: http://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: 186
Location: chennai

PostPosted: Wed Apr 29, 2009 12:12 am    Post subject: Reply to: DB2 Compiler Questions
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts Any docs / links for isub- cobol comp... SRICOBSAS COBOL Programming 4 Fri Aug 26, 2016 2:35 pm
No new posts Problem Compiling cobol code with Cob... amitc23 COBOL Programming 2 Wed Aug 24, 2016 1:50 pm
No new posts COBOL compiler upgrade vicky10001 COBOL Programming 4 Mon Jul 25, 2016 1:44 pm
No new posts Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us