Unix Technical Forum

why the table create in different tablespace

This is a discussion on why the table create in different tablespace within the DB2 forums, part of the Database Server Software category; --> There is one thing I don't understand, I have default tablespace userspace1 is database managed type, with total freepages ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 03:59 PM
xixi
 
Posts: n/a
Default why the table create in different tablespace

There is one thing I don't understand, I have default tablespace
userspace1 is database managed type, with total freepages 506048.
another one called tmpxx is DMS type too, with 525120 free pages. When
I create a new table (did not specify on which tablespace), why the
table not created on the userspace1 but instead on tmpxx? what is the
rule to create a table on tablespace without specify in which
tablespace

if I have both tablespace set as SMS, I don't have this problem.

Is this related to different tablespace?



Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 04:00 PM
Knut Stolze
 
Posts: n/a
Default Re: why the table create in different tablespace

xixi <dai_xi@yahoo.com> wrote:

> There is one thing I don't understand, I have default tablespace
> userspace1 is database managed type, with total freepages 506048.
> another one called tmpxx is DMS type too, with 525120 free pages. When
> I create a new table (did not specify on which tablespace), why the
> table not created on the userspace1 but instead on tmpxx? what is the
> rule to create a table on tablespace without specify in which
> tablespace
>
> if I have both tablespace set as SMS, I don't have this problem.
>
> Is this related to different tablespace?


Have a look at the documentation for the CREATE TABLE statement. There it
says which tablespace is used if you did not explicitily specify one:

IF table space IBMDEFAULTGROUP over which the user
has USE privilege exists with sufficient page size
THEN choose it
ELSE IF a table space over which the user has USE privilege
exists with sufficient page size
(see below when multiple table spaces qualify)

If more than one table space is identified by the ELSE IF condition, then
choose the table space with the smallest sufficient page size over which
the authorization ID of the statement has USE privilege. When more than one
table space qualifies, preference is given according to who was granted the
USE privilege:

1. the authorization ID
2. a group to which the authorization ID belongs
3. PUBLIC

If more than one table space still qualifies, the final choice is made by
the database manager.

Determination of the table space may change when:

(*) table spaces are dropped or created
(*) USE privileges are granted or revoked.

So you should look at the definition of your tablespaces. If they are
defined in the same way, then you have most probably the case that the
"final choice is made by the database manager". I found sometimes that the
database manager chooses the tablespace that was created as the last one
(but that is by no means a rule used by DB2).

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:41 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com