Presentation is loading. Please wait.

Presentation is loading. Please wait.

Summer, 2013,University Training Program DB2 for z/OS Utilities - REORG.

Similar presentations


Presentation on theme: "Summer, 2013,University Training Program DB2 for z/OS Utilities - REORG."— Presentation transcript:

1 Summer, 2013,University Training Program DB2 for z/OS Utilities - REORG

2 REORG REORG TABLESPACE –Recluster the data –Reclaim fragmented space –Restore free space –Bring online scheme change into effect REORG INDEX –Restore physical ordering of leaf pages –Reclaim fragmented space –Restore free space

3 Reclaim fragment space After creating table space After excessive INSERTs/DELETEs After REORG TABLESPACE (FREEPAGE 5) Used page Empty page

4 How clustering affects performance An index scan on an index with a poor cluster ratio could result in more synchronize I/Os and more Getpages

5 REORG TABLESPACE TABLE SPACE UNLOAD RELOAD SORTBUILD INDEX SPACE TABLE SPACE SWITCH LOG UTILINITUTILTERM

6 REORG option optionExplanation SORTDATAIf yes, the data is to be unloaded by a table space scan, and sorted in clustering order. SCOPEAll objects or only table spaces or parts in REORG- pending status PARTIndicate the set of parts to be reorged PARALLELTo be processed in parallel or not

7 REORG option SHRLEVEL optionExplanation NONEApplications can read but cannot write to the area during unloading; Applications have no access during reloading; Read-write access is allowed after reloading. REFERENCEApplications can read but cannot write to the area during unloading; Applications can read but cannot write during reloading into the shadow copy; Read- write access is allowed after switching. CHANGEApplications can read but cannot write to the area during unloading; Applications have read-write access to the original copy of the data during reloading; Applications can read and usually write to the original copy while applying the log of the original copy to the shadow copy; Read-write access is allowed after switching.

8 REORG TABLESPACE examples REORG TABLESPACE DBTEST01.TSTEST01 SHRLEVEL CHANGE REORG TABLESPACE DBTEST01.TSTEST02 PART 1 REORG TABLESPACE DBTEST01.TSTEST02 PART 3:6

9 REORG TABLESPACE option DISCARD –Discard rows Written to SYSDISC data set or Data set specified with DISCARDDDN keyword or Not written (for example, lost) –Example REORG TABLESPACE DBTEST01.TSTEST03 DISCARD FROM TABLE USR01.EMP WHERE (WORKDEPT = ‘A’)

10 When to reorganizing table spaces REORG TABLESPACE options –INDREFLIMIT (overflow records) –OFFPOSLIMIT (non-clustered records) Based on real-time statistics information –REORGINSERTS/TOTALROWS > 25% –REORGDELETES/TOTALROWS > 25% –EXTENTS > 254 –REORGMASSDELETE > 0 –Etc

11 REORG INDEX INDEX SPACE UNLOAD BUILD INDEX SPACE SWITCH LOG UTILINITUTILTERM

12 REORG INDEX examples REORG INDEX USR01.INDEX01 PART 3 REUSE

13 When to reorganizing indexes Based on real-time statistics information –REORGINSERTS/TOTALROWS > 25% –REORGDELETES/TOTALROWS > 25% –EXTENTS > 254 –Etc REORG INDEX option –LEAFDISTLIMIT (100 times the average number of leaf pages between successive active leaf pages of the index)

14 When to reorganizing indexes Based on real-time statistics information –LEFANEAR –LEARFAR


Download ppt "Summer, 2013,University Training Program DB2 for z/OS Utilities - REORG."

Similar presentations


Ads by Google