Unix Technical Forum

attach tablespace to user

This is a discussion on attach tablespace to user within the DB2 forums, part of the Database Server Software category; --> Hi, is it possible to have certain user create all table and objects in specific tablespace? i mean , ...


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-27-2008, 01:09 PM
db2admin
 
Posts: n/a
Default attach tablespace to user

Hi,

is it possible to have certain user create all table and objects in
specific tablespace?

i mean , when they create table without specifying any tablespace,
their tables should go into say ABC tablespace instead USERSPACE1.

is it possible to attached schemas to tablespaces ?

regards,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 01:09 PM
Dave Hughes
 
Posts: n/a
Default Re: attach tablespace to user

On Tue, 04 Dec 2007 19:47:17 -0000, db2admin <jagdip@gmail.com> wrote:

> is it possible to attached schemas to tablespaces ?


Simple stuff first: no :-)

With that out of the way...

> is it possible to have certain user create all table and objects in
> specific tablespace?
>
> i mean , when they create table without specifying any tablespace,
> their tables should go into say ABC tablespace instead USERSPACE1.


Yes, this is possible, although whether the method will be acceptable I
don't know:

Simply ensure that tablespace "ABC" is the only one the user holds the
"USE" privilege on (which is necessary to create tables). In other words,
"REVOKE USE OF TABLESPACE USERSPACE1 FROM USER username" and similarly for
any other tablespaces the user holds the USE privilege on. This won't
prevent the user from reading tables in USERSPACE1 (or other tablespaces)
- the USE privilege is only invoked when creating tables (or indexes).
However, it will (obviously) mean that the user is only able to create
tables (and indexes) in tablespace ABC and nowhere else. If that's
acceptable, great - otherwise I'm afraid I don't know of another method.


HTH,

Dave.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 01:09 PM
Dave Hughes
 
Posts: n/a
Default Re: attach tablespace to user

On Tue, 04 Dec 2007 20:39:10 -0000, Dave Hughes <dave@waveform.plus.com>
wrote:

[snip]
> Simply ensure that tablespace "ABC" is the only one the user holds the
> "USE" privilege on (which is necessary to create tables). In other
> words, "REVOKE USE OF TABLESPACE USERSPACE1 FROM USER username" and
> similarly for any other tablespaces the user holds the USE privilege on.


Oops - quick correction to the above that's just occurred to me:

....for any other *regular* tablespaces the user holds the USE privilege
on. Leave the temporary tablespace privileges alone...


Cheers,

Dave.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 01:09 PM
Serge Rielau
 
Posts: n/a
Default Re: attach tablespace to user

Dave Hughes wrote:
> On Tue, 04 Dec 2007 20:39:10 -0000, Dave Hughes <dave@waveform.plus.com>
> wrote:
>
> [snip]
>> Simply ensure that tablespace "ABC" is the only one the user holds the
>> "USE" privilege on (which is necessary to create tables). In other
>> words, "REVOKE USE OF TABLESPACE USERSPACE1 FROM USER username" and
>> similarly for any other tablespaces the user holds the USE privilege on.

>
> Oops - quick correction to the above that's just occurred to me:
>
> ...for any other *regular* tablespaces the user holds the USE privilege
> on. Leave the temporary tablespace privileges alone...

DB2Admin,

You piqued my interest. This issue is a bit of a pet peeve of mine.
Would you mind giving background on what you are trying to do. Feel free
to email me directly.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
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 01:47 PM.


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