niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » IBM DB2
Reorg table/index questions
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Sean McKeough
*nix forums beginner


Joined: 08 Jun 2005
Posts: 48

PostPosted: Mon Feb 07, 2005 2:22 pm    Post subject: Re: Reorg table/index questions Reply with quote

For point 3, you can kick off the inplace reorg while users are active
on the table...however it will not begin processing until it can get
exclusive access to the table (exclusive access is only held/needed for
a brief period of time).

TomHorner wrote:
Quote:
I have several quick questions about reorg's, and a request (favor).

1. The documentation says that reorg "Reorganizes an index or a table"
I cannot see how one would reorg ONE particular index - is there a way
to do this? More importantly, would you WANT to do this?

2. We plan on doing inplace reorg's due to the 24x7 nature of our
database servers. Are there any "undocumented" issues with these for
V8.1, FP2 or FP6?

3. When you do a table reorg, the manual says that one needs to
"complete all database operations and release all locks before invoking
REORG TABLE." I thought the whole idea of in inplace reorg was that
the application could go on without interruption. Can I start an
inplace reorg without interrupting the users? Is this statement in the
manual true for inplace reorgs?

Request:

Does anyone have a "canned" script for running reorg's? I hate to
reinvent the wheel Smile ! I checked the IDUG and IBM sites, but could
not find any "sample" scripts. I would prefer to tweak an existing
script rather than create one from scratch.

Design:

I plan to use the output of the reorgchk command to drive the reorg
script, doing only those tables that are marked as needing a reorg. If
possible, I also hope to do this for those individual indexes that are
marked as needing a reorg. I understand that it is best to do an
"index all" reorg after a table reorg, so I may add this step after
each table reorg to the script.

Of course, this design depends on how long all this takes. Our
databases are not "huge" (they average about 2 GB), but I have no idea
how long these reorgs will take until I test them out.

Thanks in advance!
Back to top
Pierre Saint-Jacques
*nix forums Guru Wannabe


Joined: 29 May 2005
Posts: 217

PostPosted: Sun Feb 06, 2005 7:35 pm    Post subject: Re: Reorg table/index questions Reply with quote

Reading of your Command Ref. will help, I guarantee it!

Point-1) This refers to the ability to address the reclaiming of space
in the index leaf pages or the pages themselves where "pseudo deletes"
are present.
V8 indexes are Type 2 and when you do deletes, the key+rid combo is
"marked" to be deleted. This can be done at reorg time (reorgchk will
indicate it), on one or all indexes for CLEANUP option.
It has absolutely no bearing on reorging (cleaning up, sorting or
whatever). It's only to deal with cleaning up pages for pseudo deletes
and reclaiming empty pages or pages full of pseudo deletes.
The last option on the cmd. is to convert ALL indexes from Type1 to
Type2. You'd use this after a migration from V7 (Type1) indexes to V8
and you need to do an online reorg of the table. This requires all
indexes of the table to be Type2. So convert.... reorg ... INPLACE....

Point 2) Hopefully someone will respond to this as I'm not experienced
enough in "gotchas" for that command at V8 level.
HTH, Pierre.
TomHorner wrote:

Quote:
I have several quick questions about reorg's, and a request (favor).

1. The documentation says that reorg "Reorganizes an index or a table"
I cannot see how one would reorg ONE particular index - is there a way
to do this? More importantly, would you WANT to do this?

2. We plan on doing inplace reorg's due to the 24x7 nature of our
database servers. Are there any "undocumented" issues with these for
V8.1, FP2 or FP6?

3. When you do a table reorg, the manual says that one needs to
"complete all database operations and release all locks before invoking
REORG TABLE." I thought the whole idea of in inplace reorg was that
the application could go on without interruption. Can I start an
inplace reorg without interrupting the users? Is this statement in the
manual true for inplace reorgs?

Request:

Does anyone have a "canned" script for running reorg's? I hate to
reinvent the wheel Smile ! I checked the IDUG and IBM sites, but could
not find any "sample" scripts. I would prefer to tweak an existing
script rather than create one from scratch.

Design:

I plan to use the output of the reorgchk command to drive the reorg
script, doing only those tables that are marked as needing a reorg. If
possible, I also hope to do this for those individual indexes that are
marked as needing a reorg. I understand that it is best to do an
"index all" reorg after a table reorg, so I may add this step after
each table reorg to the script.

Of course, this design depends on how long all this takes. Our
databases are not "huge" (they average about 2 GB), but I have no idea
how long these reorgs will take until I test them out.

Thanks in advance!


--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Back to top
TomHorner
*nix forums beginner


Joined: 04 Feb 2005
Posts: 1

PostPosted: Fri Feb 04, 2005 12:48 pm    Post subject: Reorg table/index questions Reply with quote

I have several quick questions about reorg's, and a request (favor).

1. The documentation says that reorg "Reorganizes an index or a table"
I cannot see how one would reorg ONE particular index - is there a way
to do this? More importantly, would you WANT to do this?

2. We plan on doing inplace reorg's due to the 24x7 nature of our
database servers. Are there any "undocumented" issues with these for
V8.1, FP2 or FP6?

3. When you do a table reorg, the manual says that one needs to
"complete all database operations and release all locks before invoking
REORG TABLE." I thought the whole idea of in inplace reorg was that
the application could go on without interruption. Can I start an
inplace reorg without interrupting the users? Is this statement in the
manual true for inplace reorgs?

Request:

Does anyone have a "canned" script for running reorg's? I hate to
reinvent the wheel Smile ! I checked the IDUG and IBM sites, but could
not find any "sample" scripts. I would prefer to tweak an existing
script rather than create one from scratch.

Design:

I plan to use the output of the reorgchk command to drive the reorg
script, doing only those tables that are marked as needing a reorg. If
possible, I also hope to do this for those individual indexes that are
marked as needing a reorg. I understand that it is best to do an
"index all" reorg after a table reorg, so I may add this step after
each table reorg to the script.

Of course, this design depends on how long all this takes. Our
databases are not "huge" (they average about 2 GB), but I have no idea
how long these reorgs will take until I test them out.

Thanks in advance!
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 2:18 am | All times are GMT
navigation Forum index » Databases » IBM DB2
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts How to ALTER a table using the ALTOBJ procedure Serge Rielau IBM DB2 1 Fri Jul 21, 2006 1:06 pm
No new posts container for insert/delete + fast index Neal Becker C++ 1 Fri Jul 21, 2006 12:57 pm
No new posts Can't Select External Table from CSV File Resant Server 1 Fri Jul 21, 2006 2:45 am
No new posts (secondary) index-only scans Ryan Berkeley DB 1 Thu Jul 20, 2006 8:32 pm
No new posts Create index hanging Claire McLister PostgreSQL 7 Thu Jul 20, 2006 8:11 pm

Loans | Guitar Lesson | Free Ringtones | Mortgages | Bankruptcy
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1742s ][ Queries: 20 (0.0859s) ][ GZIP on - Debug on ]