View previous topic :: View next topic |
Author |
Message |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Tue Apr 20, 2010 5:59 am Post subject: What is Re-ORG, RUNSTATS in DB2? |
|
|
Hai All,
Please help me understanding in some basic simple concepts so that I can understand the process better. There are multiple links to go through them but I would like to know in simple technical terms by experts if somebody can help me.
a) what is Re-org in simple concepts and why do we need and what are the different types and differences between them
b) why and when do we think it is necessary to run reorgs
c) what is mapping table and why it is used in reorgs
d) what is Runstats utility and when and why do we think we have to use
e) what is rebuild index and why and when do we need to do |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Apr 20, 2010 11:33 am Post subject: |
|
|
yadav2005,
The key to knowing anything is to READ and READ. If you give up on going thru multiple links , that ends your thirst to learn anything new and don't expect to be spoon fed. The more you learn on your own you tend to remember things for a longer period of time.
Answers :
A and b : http://www.infotel.com/en/newsletter_reorganize.html
C . Mapping Table
D. http://www.hoadb2ug.org/Docs/Smith20612.pdf
E. Short answer :
Indexes are dynamically updated when INSERT, UPDATE, or DELETE operations are performed on a table. As rows are inserted into a table, the indexes expand in number of pages and in number of levels. As rows are updated or deleted, the number of index pages may decrease, but the number of levels remains the same. During deletes, the number of occupied index pages will decrease as pages are emptied, but those pages not completely emptied will be sparsely populated causing an unnecessarily high number of index levels. For performance reasons and storage efficiency, you should rebuild index or drop and recreate indexes after multiple updates and deletes to a table.
Kolusu |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Wed Apr 21, 2010 8:53 am Post subject: |
|
|
Kolusu and dbz , thanks for your answers , it will really help me a lot.
I will take your suggestions and try to improve myself and read material. It is nice knowing guidance from experts .Thanks once again. |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Wed May 19, 2010 12:24 pm Post subject: |
|
|
Kolusu,
I am trying to code Online Reorg JCL , basically we have existing Offline reorg JCL and our rew requirement is to convert them to Online Reorgs and in this regard I am refering to the link given by you and I see many examples:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnugj12/2.23.7?SHELF=&DT=20050323210436&CASE=
My existing code for Offline Reorg:
Code: |
//STEP05 EXEC DSNUPROC,SYSTEM=DB2P,UID='ABCD',UTPROC=''
//DSNUPROC.SYSREC DD DSN=DB2P.ABCD.SYSREC,
// DISP=(MOD,DELETE,CATLG),
// SPACE=(CYL,(2000,300)),
// UNIT=(SRTWK,3)
//DSNUPROC.SYSIN DD *
QUIESCE TABLESPACE DATABASE.TABLESPACE
REORG TABLESPACE DATABASE.TABLESPACE SORTDEVT SRTWK
STATISTICS INDEX(ALL KEYCARD)
SORTKEYS SORTDATA
KEEPDICTIONARY LOG YES
/*
|
Can you please guide me which one I have to use. I have already created Mapping Tables. Please help me further. A sample Online Re-org JCL would help me much better. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed May 19, 2010 1:22 pm Post subject: |
|
|
yadav2005,
There is nothing special about online vs offline re-org . The SHRLEVEL parameter determines the type of Re-org. The keyword you are looking for is SHRLEVEL CHANGE
Code: |
CHANGE Specifies that reorganization is to operate as follows:
* By unloading from the area that is being reorganized (while applications can read and write to the area)
* Reloading into a shadow copy of that area (while applications have read-write access to the original copy of the area)
* Applying the log of the original copy to the shadow copy (while applications can read and usually write to the original copy)
* Switching the future access of an application from the original copy to the shadow copy by exchanging the names of the data sets, and then allowing read-write access again |
Read more about the options of re-org here
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnugj12/2.23.1.2
Kolusu |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Wed May 19, 2010 1:37 pm Post subject: |
|
|
Thanks Kolusu |
|
Back to top |
|
 |
|
|