If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how to creat database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-04, 12:34
db2curious db2curious is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
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.

--
Reply With Quote
  #2 (permalink)  
Old 01-05-04, 04:44
nitingm nitingm is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On