Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unanswered: Global Table Reorg

    Hello all,

    I am new to UDB, and I have a question. How canI perform a global table reorg? I know how to do an indiviual table reorg using the utility, but it would be a big pain to do this to eahc individual table in the database. Any ideas?

    We are on UDB 7.2 running on Win2K.

    Thank you,

  2. #2
    Join Date
    Sep 2002
    Posts
    456

    Re: Global Table Reorg

    Write an sql like this to generate a script and just run it:


    SELECT 'RUNSTATS ON TABLE ' || TABSCHEMA || '.' || TABNAME || ' WITH DISTRIBUTION AND DETAILED INDEXES ALL ; '
    FROM SYSCAT.TABLES
    WHERE TYPE = 'T'
    AND TABSCHEMA = 'YOURSCHEMA'
    ;

    You can change any option in the SQL above and customize for your use.

    HTH

    dollar

    Originally posted by msouterblight1
    Hello all,

    I am new to UDB, and I have a question. How canI perform a global table reorg? I know how to do an indiviual table reorg using the utility, but it would be a big pain to do this to eahc individual table in the database. Any ideas?

    We are on UDB 7.2 running on Win2K.

    Thank you,

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Global Table Reorg

    There is no concept of 'REORG ALL' ..

    The option available is to script as dollar489 suggests .. Thanks dollar ./.

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Nov 2003
    Location
    Jakarta, Indonesia
    Posts
    32

    Re: Global Table Reorg

    For runstats all you can also use

    REORGCHK UPDATE STATISTICS

    command, its similar to what dollar489 SQL is generating (without distribution and detailed indexes).
    For reorg all just rewrite this sql with reorg command.

    Regards,
    Adam AC

    Originally posted by dollar489
    Write an sql like this to generate a script and just run it:


    SELECT 'RUNSTATS ON TABLE ' || TABSCHEMA || '.' || TABNAME || ' WITH DISTRIBUTION AND DETAILED INDEXES ALL ; '
    FROM SYSCAT.TABLES
    WHERE TYPE = 'T'
    AND TABSCHEMA = 'YOURSCHEMA'
    ;

    You can change any option in the SQL above and customize for your use.

    HTH

    dollar

Posting Permissions

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