Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

default tablespace

Posted on 2006-11-07
3
Medium Priority
?
1,408 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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