REORG command in db2

7.3k views Asked by At

So I have been altering a table in QMF. After 3 alters I believe the table has gone into a pending reorg state so that I cannot alter it additionally. Am I correct in this assumption? If so what implications does this have and to get around it can I simply reorganize the table and continue altering it? If so, what does the syntax look like for reorganizing a table? I tried REORG TABLE PIDJBIP.TABLE_NAME_T and receive the error:

an unexpected token "PIDJBIP" was found following "REORG TABLE". Expected tokens may include: "JOIN". SQL state = 42601.

I haven't gotten much help out of the IBM pages regarding this subject.

1

There are 1 answers

0
mustaccio On

REORG is not an SQL statement, so it cannot be issued using a SQL interface (such as QMF). You will need to run it using the DB2 Command Line Processor.

Alternatively, you might use the administrative stored procedure, which you could call via QMF:

call sysproc.admin_cmd('reorg table PIDJBIP.TABLE_NAME_T')