473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Create a DB2 UDB database Manually using script(s)

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

Nov 28 '05 #1
3 3736
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.
--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Madhu" <mr*******@gmail.com> a écrit dans le message de news:
11*********************@g44g2000cwa.googlegroups.c om...
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


Nov 28 '05 #2
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

Nov 28 '05 #3
"Madhu" <mr*******@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
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


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.
Nov 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: R Reyes | last post by:
Just wondering if anyone knows the pros/cons between creating a database programmatically vs using the application's tool windows/features that come with SQLServer, Access, Oracle, etc... Is it...
10
by: Lars Grøtteland | last post by:
Hello! Was wondering how I can create a copy of one database? FYI I'm not interrested in the data, just the fields and triggers, and so on. Which way is the easiest? Do I create a script and...
4
by: dreadrocksean | last post by:
the subject is a bit misleading. this is my situation: right now i have my "Gig" database (im a musician) in FMPro. i want this online so heres what i do now: 1/ i manually run a simple script...
4
by: Jan | last post by:
Have an SQL create/import script. Running this on SQL would make it create a table with some values. Can Access2003 somehow use such and SQL script? I went into SQL query view to try it out, but...
8
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if...
7
by: wally | last post by:
I have Visual Studio 2005 Pro. I installed SQL Express 2005 and rebooted. But, when I right click on "Data Connections" in the Server Explorer and choose "Create New SQL Server Database..." and...
3
by: teddysnips | last post by:
I have a need to create a database, and then populate it. However, the code below doesn't work as I hoped it might (it creates the table in the "master" database, which is Not A Good Thing). I...
1
by: mabubakarpk | last post by:
HI. I am using SQL Server 2000. I generate a script of some table from EmpDB database when I run script in query analyzer it return error "Incorrect syntax near 'COLLATE'." Scripts is ...
10
by: AAaron123 | last post by:
I want to create a database with one table on the host. I can't user SQL Server Management Studio to do it so I guess I have to do it programmatically. I have in mind that in the session start...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.