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 > REORG or ALTER Tablespace?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-03-04, 04:50
Gee.Bob Gee.Bob is offline
Registered User
 
Join Date: Sep 2004
Posts: 9
Question REORG or ALTER Tablespace?

Hi All

Having about 3 hours of DB2 experience so far is proving to be a major hurdle.

My Question:

To Reduce the size of a tablespace in 8.1 on Windows and release the space to the operating system, should "Alter Tablespace reduce/resize" or should REORG be used? If Alter tablespace is the right choice, should a reorg be done beforehand? What I'm actually looking for is a script of some kind that can do something similar to DBCC ShrinkFile combined with sp_msForEachDB in SQL Server.

I understand that REORG might increase the size of a tablespace based on "pctfree value" but will it reduce the size to something lower than it's orignal create size.

Appreciate the help.


Graham
Reply With Quote
  #2 (permalink)  
Old 11-03-04, 06:47
jay1972 jay1972 is offline
Registered User
 
Join Date: Jul 2002
Posts: 21
If you are using SMS tablespace then you can not alter the tablespace.. But if you are using DMS tablespace there are extend or reduce clauses or you can resize your containers
Reply With Quote
  #3 (permalink)  
Old 11-03-04, 07:07
Gee.Bob Gee.Bob is offline
Registered User
 
Join Date: Sep 2004
Posts: 9
Thanks.

Does this mean that there's no way to shrink/resize an sms tablespace? Drop and recreate then? Reimport all the tables and make it a DMS next time? Do SMS Tablespace shrink automatically if you whack all the data in them?
Reply With Quote
  #4 (permalink)  
Old 11-03-04, 10:06
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think you can only reduce the size of a DMS container up to the high water mark; you can't go past it. In that sense DMS containers are similar to SMS ones - once space has been allocated it doesn't go back by itself.

db2dart has an option, "LHWM" that "suggests ways of lowering the high water mark". I've never actually run it but I guess these suggestions might involve REORGing and/or dropping objects. A redirected restore might also help.
Reply With Quote
  #5 (permalink)  
Old 11-03-04, 11:29
Gee.Bob Gee.Bob is offline
Registered User
 
Join Date: Sep 2004
Posts: 9
Thanks - I'll try.
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