Solved

default tablespace

Posted on 2006-11-07
3
1,384 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
db2 how to connect to remote database from my 3 349
DB2 Log Shipping (Big vs Little Endianness) 4 168
SSIS Connection Manager Password Disappears 6 144
find age for two dates 5 60
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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