Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85

    Unanswered: online reorg + runstats

    Hi all,
    I have problem: i need mass delete from table. Next operation must be reorg (can be online only) and statistics capture using runstats. Problem is, that online reorg works asynchronous. How I can ensure, that runstat will run on reorganized table ?
    thanks
    Beer contains just a small amount of vitamines - that's why it's necessary to drink lot of it.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Assuming that you are on z/OS, you can collect statistics during reorg itself. Or do you use DB2 on a different platform? Which version of DB2?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85
    stolze: i have db2 udb LUW on linux, 8.2.3
    Beer contains just a small amount of vitamines - that's why it's necessary to drink lot of it.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    In DB2 LUW, the DB2 CLP will be blocked until the REORG is finished. REORG is not asynchronous in this case. The same applies to the invocation of the reorg API. So that wouldn't be a problem at all.

    The question is now how you start REORG in your environment and why you think it is asynchrounous.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85
    stolze: thanks for help
    when i run reorg offline, CLP is blocked, as you wroted. but when I use keyword "inplace" then
    is reorg executed asynchronous.
    Next cmd I like runstats. How to ensure that table in this time will be reorganized ?


    db2 => connect to mydb

    Database Connection Information

    Database server = DB2/LINUX 8.2.3
    SQL authorization ID = DB2INST1
    Local database alias = MYDB

    db2 => reorg table log.task
    DB20000I The REORG command completed successfully

    db2 => reorg table log.task inplace allow write access start
    DB20000I The REORG command completed successfully.
    DB21024I This command is asynchronous and may not be effective immediately.

    db2 =>

    first command is done in few second, second command immediate.
    some ideas?
    thanks
    Beer contains just a small amount of vitamines - that's why it's necessary to drink lot of it.

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Now we are finally getting to the point where we know what you are really doing...

    In your case, you will have to poll the system regularly to check if the REORG is completed. After that, you con start the RUNSTATS. That's your only option - unless you can resort to a REORG that doesn't use the INPLACE option - do you really need that?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  7. #7
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85
    system is 7x24... what i can use instead INPLACE option?
    Beer contains just a small amount of vitamines - that's why it's necessary to drink lot of it.

  8. #8
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    INPLACE means that the reorg cannot use a shadow copy to do the reorg on. I guess you want to use the option ALLOW READ/WRITE ACCESS instead.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •