IBM Support

What happens when you interrupt an online reorg?

Question & Answer


Question

What happens when you interrupt an online reorg?

Answer

Online reorg is completely logged. If the online reorg is interrupted it goes into a “PAUSED” state.
Database Member 0 -- Database SAMPLE -- Active -- Up 0 days 01:01:29 -- Date 2016-05-18-22.57.12.925372

Table Reorg Information:
Address TbspaceID TableID PartID MasterTbs MasterTab TableName Type IndexID TempSpaceID
0x070000006B159480 2 5 n/a n/a n/a T1 Online 0 2

Table Reorg Stats:
Address TableName Start End PhaseStart MaxPhase Phase CurCount MaxCount Status Completion
0x070000006B159480 T1 05/18/2016 22:57:04 05/18/2016 22:57:08 n/a n/a n/a 12223 62834 Paused 0

When an online reorg is running a file is created with the tablespace id and object id as the file name and an extension of OLR. This file contains the information needed to resume a paused or interrupted online reorg. If the .OLR state file is deleted the REORG process cannot resume and SQL2219N is returned. You must not remove the OLR files manually or a new reorg must be initiated.
$ ls -al NODE0000/SQL00003/00020005.OLR
-rw-r----- 1 db2inst1 build 9864 May 18 22:57 NODE0000/SQL00003/00020005.OLR

When the online reorg is in PAUSED state you can either issue the reorg table with the STOP or RESUME options. If you issue the reorg index STOP command then everything that was done will be rolled back. If the reorg table RESUME is called then the OLR file is used to get the LSN, the next range to be vacated, and other information to be able to resume where it left off.
If the OLR file is deleted and the database is restarted then all information about the previous reorg is lost. The row movement done by the previous paused reorg are not rolled back. A new reorg can be started on this table. If the OLR file is deleted and the database is not restarted then the reorg state is still cached by DB2. Both a reorg table RESUME and STOP will fail with a SQL2219N error. A new reorg can be issued in this case. A database restart will let DB2 forget that any online reorg was ever run against this table since the OLR file no longer exists and will not be read in by DB2 on restart.


Knowledge Center links for more information about DB2 online reorg:
http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.perf.doc/doc/c0024854.html?lang=en

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Movement - Reorg\/Rebalance","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.1;10.5;9.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21983935