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.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
Major typo.
s/b: "if it is an offline reorg of table, the indexes get reorged also."
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.
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
I would recommend you look at the PDF manuals also, not just the InfoCenter
version. Specifically, the Command Reference manual discusses the REORG
command.
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?
> 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
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.