Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unanswered: how to creat database

    hi I am new to db2.
    I appreciate if anyone help me in this task.
    I am told to create database in unix based db2 and given directory for data,index and log.
    Please tell me how to proceed.
    1.to create datbase first with this directory specified with whole space limit in that directory ? OR
    2.just create database and table space later-to create tablespace for the database ,is database need to exist first?
    3.should I create database with full directory size I am told for data,index etc.. or just create containers and let it grow later?
    4.what should I creat DMS or SMS -this is an oltp database

    Sorry for silly question but I m a mssql server guy and have to do that and I read db2 manuals but not sure about above how to proceed with.

    I really need many suggestion and explanations.

    thanks much.

    --

  2. #2
    Join Date
    Jul 2003
    Location
    Austin, TX, USA
    Posts
    278

    Create Database

    Hi,

    The simplest way of doing the same is

    create database <database-name>. This will create a database under the default system path and all the tablespaces will be system managed. Here DB2 would use the default settings.

    Here is the total o/t of the create database command with it's options.

    CREATE DATABASE database-name
    [AT DBPARTITIONNUM | [ON drive] [ALIAS database-alias]
    [USING CODESET codeset TERRITORY territory]
    [COLLATE USING {SYSTEM | IDENTITY | IDENTITY_16BIT | COMPATIBILITY | NLSCHAR}]
    [NUMSEGS numsegs] [DFT_EXTENT_SZ dft_extentsize]
    [CATALOG TABLESPACE tblspace-defn] [USER TABLESPACE tblspace-defn]
    [TEMPORARY TABLESPACE tblspace-defn] [WITH "comment-string"]]
    [AUTOCONFIGURE [USING config-keyword value [{,config-keyword value}...]]
    [APPLY {DB ONLY | DB AND DBM | NONE}]]

    tblspace-defn:
    MANAGED BY { SYSTEM USING ('string' [ {,'string'} ... ] ) |
    DATABASE USING ({FILE | DEVICE} 'string' number-of-pages
    [ {,{FILE | DEVICE} 'string' number-of-pages} ... ] ) }
    [EXTENTSIZE number-of-pages] [PREFETCHSIZE number-of-pages]
    [OVERHEAD number-of-milliseconds] [TRANSFERRATE number-of-milliseconds]

    Please refer to DB2 Documentation for further details.

    Cheers

    Nitin
    HTH

    Nitin

    Ask the experienced rather than the learned

Posting Permissions

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