Solved

default tablespace

Posted on 2006-11-07
3
1,369 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
Comment Utility
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
Comment Utility
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
Comment Utility
So DB2 does not support users being assigned a default tablespace. Very strange...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now