Previous Topic

Next Topic

createdb Command—Create a Database

The createdb command creates a new database. The user who creates a database becomes the DBA for that database.

By default, all users have access to a database although access to tables in the database must be explicitly granted. To create a private database, use the -p flag.

Before you can specify file locations in the createdb command, the directories must exist. If not specified, a default location, created during installation, is assumed. For procedures on creating alternate locations, see the Database Administrator Guide.

Note: When a database is created, system catalogs are created with the server default page size, unless specified differently on the –page_size parameter.

Note: If createdb fails for any reason, destroy the partially created database using the destroydb command.

The createdb command has the following format:

createdb dbname[/server_class] [cdbname] [-dlocationname] [-clocationname]
[-jlocationname] [-blocationname] [-wlocationname] [-f product {product}]
[-llanguage] [-n[collationname]] [-i[collationname]][-p] [-S][-uusername]
[-rlocationname] [-page_size=n]

Previous Topic

Next Topic

createdb Examples

This command creates a private database on the default devices:

createdb -p mydb

This command creates the public database ericsdb using a different user name:

createdb ericsdb -ueric

This command creates a database with its database, checkpoint, and journal files on different devices:

createdb bigdb -ddb_ingres -cnewdev_ingres -jotherdev_ingres

This command creates a database with catalogs for Ingres and OpenROAD:

createdb testdb -f ingres windows_4gl

This command creates a distributed database for use with Ingres Star:

createdb mydb/STAR

createdb Example: Create Unicode-enabled Database

This command creates a Unicode-enabled database with default collation sequence and supports Normalization Form D:

createdb -n unicodedb

This command creates a Unicode-enabled database with a custom collation sequence and supports Normalization Form D:

createdb -nmyunicollation unicodedb

This command creates a Unicode-enabled database with default collation sequence and supports Normalization Form C:

createdb -i unicodedb

This command creates a Unicode-enabled database with a custom collation sequence and supports Normalization Form C:

createdb -imyunicollation unicodedb


© 2007 Ingres Corporation. All rights reserved.