Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / November 2005

Tip: Looking for answers? Try searching our database.

Create a DB2 UDB database Manually using script(s)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Madhu - 28 Nov 2005 18:24 GMT
All,

New to DB2 environment. Can someone share a script that can be used to
a create a DB2 UDB database manually. I am trying to create a database
on Linux, single partition.

Thanks
Madhu
Pierre Saint-Jacques - 28 Nov 2005 20:19 GMT
If all you want is a sample database, the first steps create one for you or
go to a command line and do:
db2sampl <path>
A look at the db2 Command Reference on line helps or the following.

D:\SQLLIB\BIN>db2 ? create db
CREATE DATABASE database-name
[AT DBPARTITIONNUM | [AUTOMATIC STORAGE {NO | YES}]
[ON drive[{,drive}...][DBPATH ON drive]]
[ALIAS database-alias] [USING CODESET codeset TERRITORY territory]
[COLLATE USING {SYSTEM | IDENTITY | IDENTITY_16BIT | COMPATIBILITY |
NLSCHAR}]
[PAGESIZE integer [K]]
[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} ... ]) | AUTOMATIC STORAGE}
 [EXTENTSIZE number-of-pages] [PREFETCHSIZE number-of-pages]
 [OVERHEAD number-of-milliseconds] [TRANSFERRATE number-of-milliseconds]
 [NO FILE SYSTEM CACHING | FILE SYSTEM CACHING]
 [AUTORESIZE {NO | YES}] [INITIALSIZE integer {K |M |G}]
 [INCREASESIZE integer {PERCENT |K |M |G}] [MAXSIZE {NONE | integer {K |M
|G}}]

config-keyword:
 MEM_PERCENT, WORKLOAD_TYPE, NUM_STMTS, TPM, ADMIN_PRIORITY
 NUM_LOCAL_APPS, NUM_REMOTE_APPS, ISOLATION, BP_RESIZEABLE.

Once the db is created, a look at the SQL Refer. handbook will help in
defining yyour table spaces, tables an so on.

HTH,  Pierre.
Signature

Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515

> All,
>
[quoted text clipped - 4 lines]
> Thanks
> Madhu
Madhu - 28 Nov 2005 21:25 GMT
Thanks for the reply !!

I am looking to create a database (single-partition/single server) with
multiple tablespaces, whose containers are distributed in multiple file
systems/directories.

In my case its just directories, since i only have one single disk
where i am creating the database.

Thanks
Madhu
Mark A - 29 Nov 2005 00:09 GMT
> Thanks for the reply !!
>
[quoted text clipped - 7 lines]
> Thanks
> Madhu

You can specify the location of containers for the catalog, system temporary
tablespace, and default userspace in the create database statement.

To create any additional tablespaces, you need the create tablespace
command.

See the Command Reference manual for additional details. You can download
the PDF version for free.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.