how to create a default tablespace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pattnayak

    how to create a default tablespace

    Hi,
    when i am trying to create a table in Db2, and specifies the
    tablespace as default,it gives an error saying "There is no default
    tablespace".Can anybody please help me out to assign a tablespace as a
    default one.
    Thanks
    Pattnayak
  • Knut Stolze

    #2
    Re: how to create a default tablespace

    Pattnayak <dpatnayak@hotm ail.com> wrote:
    [color=blue]
    > Hi,
    > when i am trying to create a table in Db2, and specifies the
    > tablespace as default,it gives an error saying "There is no default
    > tablespace".Can anybody please help me out to assign a tablespace as a
    > default one.[/color]

    What are you trying to do? Which SQL statements do you run?

    You can find in the documentation for the CREATE TABLE statement how DB2
    determines which tablespaces should be used. It says:

    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 issue an error (SQLSTATE 42727)

    --
    Knut Stolze
    Information Integration
    IBM Germany / University of Jena

    Comment

    • P. Saint-Jacques

      #3
      Re: how to create a default tablespace

      DB2 does that automatically for you.
      If you have created a tablespace while logged on, it has your id as the
      schema name and DB2 will use that automatically as the target residence
      of your table.
      If you have not created one then DB2 has created one for you when ther
      db was created, it is called USERSPACE1 and that's where your table will
      go if you do not specify anything.
      The create table command has a parameter IN that allows you to specify
      which tblspc. to use. If you don't use the parm. then the command will
      behave as explained above.
      HTH, Pierre.

      Pattnayak wrote:[color=blue]
      > Hi,
      > when i am trying to create a table in Db2, and specifies the
      > tablespace as default,it gives an error saying "There is no default
      > tablespace".Can anybody please help me out to assign a tablespace as a
      > default one.
      > Thanks
      > Pattnayak[/color]

      --
      Pierre Saint-Jacques - Reply to: sesconsjunk at attglobaljunk dot com
      Reconstruct address: Remove the two junk and replace at and dot by
      their symbols.
      IBM DB2 Cerified Solutions Expert - Administration
      SES Consultants Inc.

      Comment

      Working...