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 > One tablespace per table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-06, 04:43
fab01 fab01 is offline
Registered User
 
Join Date: Mar 2006
Posts: 17
Question One tablespace per table

Hi !
A collegue of mine had created several tables in juste one tablespace.
I'm wondering what is the best solution
1/ One table space per table
2/ Or one tablespace for several tables ?
Could i have the advantages and inconvenients of these propositions ?
If you tell me that the best solution is the solution 2:
How could i correct it ?
a/ I must create new tablespace for each table
b/ I must alter my table (could you join sample) ?
c/ What about data if i change the tablespace of each table ? (should i unload data before alter my table ?)

Thanks a lot
Cheers
Reply With Quote
  #2 (permalink)  
Old 07-18-06, 06:20
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
ts

for large tables it is recommended to place each in its own tablespace - dms if possible and you could also split off data and index to their own ts
this requires export table - drop-create table - load table
maintenance is easier for individual table/ts
also for backup of ts - you backup only 1 table
for small tables : place tables with same behavior in same ts.
more ts = more monitoring for space usage....
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 07-18-06, 08:32
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Arrow No difference

In my experience it doesn't matter wether you
have large and small tables grouped together
in physical storage i.e. tablespaces.
If they don't have notably different specs i group
my tables physically according to the front end
systems, i.e. logical divisions.

Many tablespaces signifies lots of maintenance
and DMS TS can always be expanded - which
is oftenmost the case

Again pros and cons - but grab a manual
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #4 (permalink)  
Old 07-18-06, 13:00
cchattoraj cchattoraj is offline
Registered User
 
Join Date: Mar 2003
Posts: 343
I understand that for large tables which are frequently used, using one tab/tbsp impacts the caching algorithm on the disk subsystem.

However, having a large number of tablespaces also impacts performance since at any point in time, the db can have so many file handlers open (maxfilop). If it exceeds this number, then to access data, the db will have to close a handle and open another one for access.

Then there's the restore angle. All tables in a tablespace can only be restored to the same point in time - therefore tables grouped in a tbsp need to have similar recovery requirements.
Reply With Quote
  #5 (permalink)  
Old 07-19-06, 00:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
On DB2 for z/OS, it is usually recommended that you have one table per tablespace. In some situations it is OK to have more than one table per tablespace, but make sure the tablespace is segmented in those cases.

On DB2 for Lnux, UNIX, Windows, you should generally have many tables in a tablespace. The decision about how many tables per tablespace is often determined by the bufferpool configuration, since you assign tablesspaces to bufferpools. If you plan on having 2 bufferpools (one for small tables and all indexes, and another for large tables) then you will need at least 2 different tablespaces.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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