Quote:
|
Originally Posted by dav1mo
also th reorgs on the indexes, would be an asynchronous command, wouldn't it? Meaning the command has completed, but the reorg is now running.
|
I made this little script to deal with that problem
Code:
db2 set current schema %1
db2 Reorg table %2 inplace allow write access START
:BackHome
d:\utils\sleep 32
db2 Reorg table %2 inplace PAUSE
if %errorlevel% equ 0 (
db2 Reorg table %2 inplace allow write access RESUME
goto :%BackHome
)
So it starts the online-reorg (an async task) and after a period of time I try to PAUSE that reorg-task. When that works (rc=0) then I RESUME the task and wait again for that same period of time....
When the PAUSE did not succeed, the reorg must be finished and you can continue for that table (reorg indexes, do runstats etc etc).
Now you can build a scritp which launches the reorg 1-by-1 and they will execute only 1 at the time.