Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reorg table and reorg index

1,669 views
Skip to first unread message

Franco Lombardo

unread,
Sep 1, 2009, 9:12:44 AM9/1/09
to
Hi all.

Does the REORG TABLE command execute also the REORG INDEXES ALL? I mean,
after a REORG TABLE, do I need to reorganize the indexes too?
I'm running DB2 9.5 on Windows.

Thanks in advance.

Bye

Franco

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.francolombardo.net
Scala, Java, As400.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Mark A

unread,
Sep 1, 2009, 10:08:41 AM9/1/09
to
"Franco Lombardo" <f_lom...@hotmail.com> wrote in message
news:h7j6k3$3so$1...@aioe.org...

> Hi all.
>
> Does the REORG TABLE command execute also the REORG INDEXES ALL? I mean,
> after a REORG TABLE, do I need to reorganize the indexes too?
> I'm running DB2 9.5 on Windows.
>
> Thanks in advance.
>
> Bye
>
> Franco

Yes, if it is an offline index of table, the indexes get reorged also.


Ian

unread,
Sep 1, 2009, 11:15:46 AM9/1/09
to
Mark A wrote:
> "Franco Lombardo" <f_lom...@hotmail.com> wrote in message
> news:h7j6k3$3so$1...@aioe.org...
>>
>> Does the REORG TABLE command execute also the REORG INDEXES ALL? I mean,
>> after a REORG TABLE, do I need to reorganize the indexes too?
>> I'm running DB2 9.5 on Windows.
>>
>
> Yes, if it is an offline index of table, the indexes get reorged also.

That's a little confusing ;-)


You don't need the reorg the indexes if you do an offline reorg -- the
indexes get rebuilt during the process.

If you do an online ("inplace") reorg, you may still need to reorg the
indexes.

Mark A

unread,
Sep 1, 2009, 11:12:49 PM9/1/09
to
"Ian" <ian...@mobileaudio.com> wrote in message
news:DUanm.13179$nQ6...@newsfe07.iad...

>> Yes, if it is an offline index of table, the indexes get reorged also.
>
> That's a little confusing ;-)

Major typo.

s/b: "if it is an offline reorg of table, the indexes get reorged also."


Franco Lombardo

unread,
Sep 2, 2009, 2:28:04 AM9/2/09
to
> You don't need the reorg the indexes if you do an offline reorg -- the
> indexes get rebuilt during the process.
>
> If you do an online ("inplace") reorg, you may still need to reorg the
> indexes.

First of all, thanks for your answers. Then I have a silly question: what's
the difference between online and offline reorganization? How do I perform
each one?

Thanks again.

Mark A

unread,
Sep 2, 2009, 4:07:44 AM9/2/09
to
"Franco Lombardo" <f_lom...@hotmail.com> wrote in message
news:h7l39b$4lq$1...@aioe.org...

>> You don't need the reorg the indexes if you do an offline reorg -- the
>> indexes get rebuilt during the process.
>>
>> If you do an online ("inplace") reorg, you may still need to reorg the
>> indexes.
>
> First of all, thanks for your answers. Then I have a silly question:
> what's the difference between online and offline reorganization? How do I
> perform each one?
>
> Thanks again.
>
> Bye
>
> Franco

With on-line (INPLACE) reorg, the table is fully accessible by the
application while the reorg is being done.

You probably don't want to do an on-line (INPLACE) reorg unless you don't
have a suitable maintenance window where a traditional offline reorg can be
done. But if you want more info, then please refer to the Command Reference
manual for our DB2 version/release. If you don't have a Command Reference
manual, then you can get all the PDF manuals for free from the IBM website
here:
http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg27009474


Franco Lombardo

unread,
Sep 2, 2009, 4:28:56 AM9/2/09
to

Mark A

unread,
Sep 2, 2009, 11:09:30 AM9/2/09
to
"Franco Lombardo" <f_lom...@hotmail.com> wrote in message
news:h7labv$bqb$1...@aioe.org...

I would recommend you look at the PDF manuals also, not just the InfoCenter
version. Specifically, the Command Reference manual discusses the REORG
command.


Willem Fischer

unread,
Sep 6, 2009, 3:09:21 AM9/6/09
to
Something that's easily overlooked using reorg is that LOBs are not
reorged by default. Because some application programmers like to use
LONG VARCHARs everywhere (which are LOB objects), I believe this is
important to consider. To reorg LOBs:

db2 REORG TABLE s.t1 LOBLOBDATA

However, the DB2 documentation says the following:

"This is not required even if the table contains long or LOB columns.
The default is to avoid reorganizing these objects because it is time
consuming and does not improve clustering. However, running a
reorganization with the LONGLOBDATA option on tables with XML columns
will reclaim unused space and thereby reduce the size of the XML
storage object."

Does anyone have actually experienced a performance gain using
LONGLOBDATA?

Lisa

unread,
Sep 11, 2009, 7:56:08 PM9/11/09
to
On Sep 2, 8:09 am, "Mark A" <no...@nowhere.com> wrote:

> I would recommend you look at the PDF manuals also, not just the InfoCenter
> version. Specifically, the Command Reference manual discusses the REORG
> command.

Please note that the DB2 Information Centers contain the same content
as the PDFs and are updated more frequently than either the PDF or the
hard-copy books.

If you're ever curious about when a particular DB2 Information Center
was last updated, refer to the welcome page (e.g.
https://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.doc/welcome.html
"This documentation was last updated 2009-09-10 for Version 9.5.")
To determine how recently a PDF has been updated, look at the date on
the first page of the PDF or else refer here:
https://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.common.doc/doc/r0008264.html

The REORG command is found here within the DB2 V9.5 Information
Center:
https://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0001966.html

Mark A

unread,
Sep 11, 2009, 9:32:38 PM9/11/09
to
>"Lisa" <lca...@ca.ibm.com> wrote in message
>news:c838c3a6-c58e-45eb...@c37g2000yqi.googlegroups.com...

On Sep 2, 8:09 am, "Mark A" <no...@nowhere.com> wrote:
>
> Please note that the DB2 Information Centers contain the same content
> as the PDFs and are updated more frequently than either the PDF or the
> hard-copy books.

The infocenter may contain the same content, but it is organized completely
differently. The infocenter is great if you know what you looking for, but
sometimes one will find out things by browsing the PDF's that they would not
find from the Infocenter.

PDF files are searchable, in a similar way to how a web search is
searchable. The PDF files even have hot links built into them. The PDF
search has the advantage of being able to limit searches to a particular
manual, whereas an infocenter search often pulls back too much junk from
other manuals that are not needed. PDF searches can be done on all manuals
at once if desired.


0 new messages