Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REORG command in db2

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.

like image 441
Rookie Avatar asked Jul 31 '26 02:07

Rookie


1 Answers

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')
like image 199
mustaccio Avatar answered Aug 05 '26 03:08

mustaccio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!