If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Global Table Reorg

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-16-04, 12:46
msouterblight1 msouterblight1 is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
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,
Reply With Quote
  #2 (permalink)  
Old 01-16-04, 13:07
dollar489 dollar489 is offline
Registered User
 
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

Quote:
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,
Reply With Quote
  #3 (permalink)  
Old 01-16-04, 16:09
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #4 (permalink)  
Old 01-19-04, 04:16
adam_ac adam_ac is offline
Registered User
 
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

Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On