Solved

default tablespace

Posted on 2006-11-07
3
1,380 Views
Last Modified: 2012-08-14
In DB2, how do I assign a default tablespace to a user? User MYUSER should have a default tablespace of MYDATA.

In other words, when a CREATE TABLE statement is executed by MYUSER and the IN TABLESPACE clause is not specified, the table should be created in tablespace named MYDATA.
0
Comment
Question by:mbevilacqua
3 Comments
 
LVL 7

Expert Comment

by:db2inst1
ID: 17895435
The first available tablespace for user with USE privileage will be used to store the table if the IN clause is not specified in CREATE TABLE.

If there are more than one regular tablespace with USE privileage for the user, i bielieve it picks the one which was created first.. with the CREATION TIME.
0
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 17896427
hi

if you don't specify the in clause, db2 will search for a tablespace by this algorythem :

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)
    THEN choose it
ELSE return an error (SQLSTATE 42727)

If more than one table space is identified by the ELSE IF condition, choose the table space with the smallest sufficient page size. If more than one table space qualifies, choose the table space in the following order of preference, depending on to whom the USE privilege was granted:

The authorization ID
A group to which the authorization ID belongs
PUBLIC
If more than one table space still qualifies, the final choice is made by the database manager.


i got that from
http://publib.boulder.ibm.com/infocenter/db2luw/v8//topic/com.ibm.db2.udb.doc/admin/r0000927.htm

momi
0
 

Author Comment

by:mbevilacqua
ID: 17899076
So DB2 does not support users being assigned a default tablespace. Very strange...
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change the sort Order 5 263
sql is not working correctly 23 361
Dynamic Query Need 9 82
I am trying to building a ddl statement off a cobol layout 3 128
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question