DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Can I specify tablespace when creating PK?

  1. #1
    Join Date
    May 2001
    Posts
    285

    Can I specify tablespace when creating PK?

    Got in a situation where I need to specify tablespace when creating the PK 'cause otherwise it will be create in SYSTEM tablespace which is bad. Is there anyway for me to do that?

    Thanks a bunch!

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    sure:
    Code:
    marist89@lx920> create table xyz (id number(10),
      2  constraint xyz_pk primary key (id) using index tablespace users);
    
    Table created.
    
    Elapsed: 00:00:00.35
    Jeff Hunter

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439

    Re: Can I specify tablespace when creating PK?

    Originally posted by elaine3839
    Got in a situation where I need to specify tablespace when creating the PK 'cause otherwise it will be create in SYSTEM tablespace which is bad.
    What realy is bad here is that your user has SYSTEM tablespace assigned as his/her default tablespace obviously!
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  4. #4
    Join Date
    May 2001
    Posts
    285

    Re: Re: Can I specify tablespace when creating PK?

    I agree -- but isn't the user being assign to SYSTEM tablespace if you don't assign a default tablespace for the user during creation time? I thought the default tablespace should be USERS if you don't specify one, but my quick test didn't confirm that.

    Originally posted by jmodic
    What realy is bad here is that your user has SYSTEM tablespace assigned as his/her default tablespace obviously!

  5. #5
    Join Date
    May 2001
    Posts
    285
    Excellent, thank you!

    (I must made some syntax mistake when I tried it yesterday :-)

    Originally posted by marist89
    sure:
    Code:
    marist89@lx920> create table xyz (id number(10),
      2  constraint xyz_pk primary key (id) using index tablespace users);
    
    Table created.
    
    Elapsed: 00:00:00.35

  6. #6
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439

    Re: Re: Re: Can I specify tablespace when creating PK?

    Originally posted by elaine3839
    I agree -- but isn't the user being assign to SYSTEM tablespace if you don't assign a default tablespace for the user during creation time? I thought the default tablespace should be USERS if you don't specify one, but my quick test didn't confirm that.
    Something that is defined as the default value must by definition exist in all circumstances, isn't it so? So it is more than logical that SYSTEM tablespace was chosen to be the default tablespace for all users. It most certanly can't be USERS or any other tablespace. Why? Because SYSTEM is the only tablespace that exists in any Oracle database! It can't be USERS or anything similar, because USERS tablespace might not even exist in the database.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width