| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

09-20-11, 12:10
|
|
Registered User
|
|
Join Date: Dec 2008
Location: Chennai
Posts: 110
|
|
|
db2 9.7 Reorg Table
|
|
Hi
DB2 9.7, FP 3a/ Win 2008 R2
I have a LARGE type tablespace and contain couple of big tables with around 80 million rows. Each has around 6 indexes in different tablespace (LARGE type).
I am going to do the offline REORG for this tables and want to use the temporary tablespace (USERTEMP).
### REORG TABLE XYZ USE USERTEMP;
Also I am lookig to recover some space back as the current HWM is too high.
My question is,
1. Does the USERTEMP tablespace must be LARGE type TBS?
2. Will this rebuild the indexes too?
Please advise
Thanks, valan.
__________________
|
|

09-20-11, 12:59
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
From the syntax diagram for CREATE TABLESPACE, you cannot create a "LARGE" SYSTEM TEMPORARY tablespace. You do need one that is the same pagesize of the tablespace that the table resides in. It will not reorg your indexes at the same time. You need to reorg those separately. It does rebuild the indexes in the sense that the pointers to the rows get changed to the new layout of the table data.
Andy
|
|

09-20-11, 14:24
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
|
|
I believe that an offline reorg of a table will automatically rebuild (reorg) all the indexes also.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

09-20-11, 16:49
|
|
Registered User
|
|
Join Date: Dec 2008
Location: Chennai
Posts: 110
|
|
|
reorg
My LARGE TBS page size is 4K. The table size is around 40GB, Indexes also smilar size.
If I use the TEMPSPACE (4k page), will the table and indexes will fit in this TBS? (4K page TSB size limit is 64GB)
Thanks.
__________________
|
|

09-21-11, 04:12
|
|
Registered User
|
|
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
|
|
Quote:
Originally Posted by Marcus_A
I believe that an offline reorg of a table will automatically rebuild (reorg) all the indexes also.
|
You believe, I'm sure
What I am not sure of, but would be nice to test in this case:
drop the 4k usertemp
create a 32k usertemp (I assume there are NO 8 & 16k usertemps).
Now when you do your REORG it will use the 32K tempspace which can be much larger.
Hmmmmm... suppose this works... Why the *beeb* do we need 4, 8 & 16k temp-tablespaces???? Maybe we never "needed" them but just created them out of a habit 
|
|

09-21-11, 04:49
|
|
Registered User
|
|
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
|
|
the problem is that if this 4K_temp is the only with 4K size pages - you can not drop it
if both exist (4K-32K)- you can not force usage of one or another
we have the same problem with a table in 32K ts - and join/order/group is using 4K temp and hitting max limit - (see older post) - not easy to force the usage of this 32K temp
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
|
|

09-21-11, 09:45
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
Quote:
Originally Posted by przytula_guy
the problem is that if this 4K_temp is the only with 4K size pages - you can not drop it
if both exist (4K-32K)- you can not force usage of one or another
we have the same problem with a table in 32K ts - and join/order/group is using 4K temp and hitting max limit - (see older post) - not easy to force the usage of this 32K temp
|
This is true for a query, but not for a reorg--which is what the OP is asking about. If you specify a System Temporary Tablespace on the reorg command, it will use the one you requested (if it is the same pagesize as that of the table).
Quote:
My LARGE TBS page size is 4K. The table size is around 40GB, Indexes also smilar size.
If I use the TEMPSPACE (4k page), will the table and indexes will fit in this TBS? (4K page TSB size limit is 64GB)
|
The limits for the table and indexes are separate. You can have table and indexes that are bigger than 64GB in a 4K tablespace. The table alone cannot exceed 64GB. The index size is either 64GB or 2048GB depending on the tablespace type (DMS/SMS).
Andy
|
|

09-21-11, 13:16
|
|
Registered User
|
|
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
|
|
tables as large as these should be partitioned.
it will improve your query performance and maintenance time (reorg, runstats).
might be a good idea to place them in separate tablespaces too but it depends...
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
|
|

09-21-11, 17:10
|
|
Registered User
|
|
Join Date: Dec 2008
Location: Chennai
Posts: 110
|
|
|
thanks
Thanks for all your suggestions, I will try this on our test system first.
Regards, valan.
__________________
|
|

09-21-11, 18:32
|
|
∞∞∞∞∞∞
|
|
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
|
|
Quote:
Originally Posted by ARWinner
This is true for a query, but not for a reorg--which is what the OP is asking about. If you specify a System Temporary Tablespace on the reorg command, it will use the one you requested (if it is the same pagesize as that of the table).
|
Just to add:
Table reorg will use a tempspace specified on the reorg command. If you happen to have two tempspaces of the same page size (not sure why someone would do that but I've seen it) and rebuilding of the indexes require a tempspace due to the spilling of sorts, then it will be chosen in a round robin (just for the index rebuild phase).
|
|

09-22-11, 04:31
|
|
Registered User
|
|
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
|
|
Quote:
Originally Posted by MarkhamDBA
tables as large as these should be partitioned.
it will improve your maintenance time (reorg, runstats).
|
working/testing with that right now. Not as simple as " presented on the whiteboard".
To really gain REORG time you must define ALL your indexes as partitioned.
When your partitioning column is not part of your PK definition you'll have to make choices:
- The unique PK index remains global. bye bye performance gain because that index has to be rebuilt completely when you do a reorg (on data partition)
- drop the PK constraint and drop the unique-ness of your index. bye bye FK constraints because your table does not have a PK anymore. Works, but not as designed.
But if you manage to convert all your indexes to partitioned the performance gain during "reorg data partition" ís impressive.
|
|

09-22-11, 09:36
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
Quote:
Originally Posted by db2girl
If you happen to have two tempspaces of the same page size (not sure why someone would do that but I've seen it)
|
A good reason would be to place them on different file systems so that when you reorg a table on one filesystem you can use the temp space on an other filesyatem to speed thing up.
Andy
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|