Create a DB2 Database
CreaDB
The creadb command line program is used to create a DB2 database (on default table spaces) that uses a given DataFlex Collating Sequence. The collating sequence of a database defines the sort order. DB2 uses a number of predefined collating sequences. If you want to create a database that uses exactly the same collating sequence as the DataFlex environment, use creadb.
For more information on databases and the options available when creating a database, refer to the DB2 documentation.
Usage
creadb is a command line utility. It uses flags to set up the database. Flags can be passed using either the traditional Unix syntax -flag or the DOS/Windows syntax /flag. The order in which the flags are specified is not important.
Required Flags
| Flag | Required Parameter |
|---|---|
| -d | Name of the database to create. |
| -c | Path and file name of the DataFlex collating sequence. |
Optional Flags
| Flag | Required Parameter |
|---|---|
| -a | Alias name of the database to create; the database name (see -d) will be used if not supplied. |
| -u | User identification to use when attaching to the node. |
| -p | Password of the user. |
| -n | Name of the node on which to create the database. Use "list node directory" in the CLP for a list of node names. |
| -s | The codeset to use for the database (ISO8859-1 by default). |
| -t | The country identifier for the database (En_US by default). |
| - | |
| -x | Extended options. |
| -xc | Comment for the database. If the comment contains spaces, surround it with double quotes. |
| -xs | Number of file segments to be created in the database. |
| -xx | Default extent size of table spaces. |
| -h | Show usage. |
Special Note
- Do not add a space between the flag and the required parameter.
- Parameters should not be specified within quotes – only if they have spaces in them, like paths or comments.
Examples
To create a database MyDB using a collating sequence located in C:\Program Files\DataFlex 10\Usr, use:
creadb -dMyDB -c "C:\Program Files\DataFlex 10\Usr\df_collate.cfg"
To have user Auser with password userPwd create database MyDB using alias SW and a collating sequence located in C:\Program Files\Collate, use:
creadb -dMyDB -aSW -c c:\Collate\df_collate.cfg -uAuser -puserPwd