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]
Specifies the name of the database to be created. The name must be unique and begin with an alphabetic character. The name can have a maximum of 24 alphanumeric characters (the underscore is also allowed).
Also specifies the server_class, if required, as described in Standard Flags and Parameters. If you are using Ingres Star, you must specify star as the server_class. For examples, see the Ingres Star User Guide.
Overrides the default coordinator database name stored in the Ingres Star catalogs. The default name of the coordinator database is the dbname you specified, prefixed with ii. This is an optional parameter for use with Ingres Star.
Specifies the location of the database files. The default is the location to which II_DATABASE points.
Specifies the location of the checkpoint files. The default is the location to which II_CHECKPOINT points.
Specifies the location of the journal files. The default is the location to which II_JOURNAL points.
Specifies the location of the dump files. The default is the location to which II_DUMP points.
Specifies the location of the work files. The default is the location to which II_WORK points.
Specifies user interface products for which you want to create catalogs. Valid product names are ingres, ingres/dbd, vision, windows_4gl, and nofeclients, as described in Standard Flags and Parameters. The default is to include all product names.
Specifies the collating sequence for the database. The sequence must exist in the installation before issuing the createdb command.
A database's collating sequence determines the order in which data is sorted.
Valid values for language are:
DEC Multinational Character Sequence
Spanish alphabet's character sequence
A custom collation sequence. For details see the System Administrator Guide.
To view the available collation sequences, examine the contents of the collation file (located in $II_SYSTEM/ingres/files/collation).
If the -l flag is not specified, the collating sequence is determined by the value of II_COLLATION (if this is set). If II_COLLATION is not set, the default collating sequence is assigned to the database. The default is the native sequence of the ASCII or EBCDIC character set, depending on which is present in your computer.
Creates a private database. The DBA and names specified on the accessdb command only have access to the database. Do not use this flag with Ingres Star.
Creates a Unicode-enabled database. This enables storing and manipulating Unicode data by defining columns as Unicode data types (that is, nchar, nvarchar, and long nvarchar). If a Unicode collation name is not specified, the Unicode database is created with the default collation sequence "udefault." The Unicode database created in this manner uses Normalization Form D (NFD) for normalization of Unicode strings for processing and storage. NFD results from the canonical decomposition of a Unicode string.
Creates a Unicode-enabled database. This enables storing and manipulating Unicode data by defining columns as Unicode data types (that is, nchar, nvarchar, and long nvarchar). If a Unicode collation name is not specified, the Unicode database is created with the default collation sequence "udefault." The Unicode database created in this manner uses Normalization Form C (NFC) for normalization of Unicode strings for processing and storage. NFC results from the canonical decomposition of a Unicode string, followed by the replacement of all decomposed sequences by primary composites, where possible.
Indicates you are creating an iidbdb. You must be a privileged user to use this flag. Do not use it with Ingres Star.
On VMS, enclose this flag in double quotation marks ("-S").
Specifies the effective user for the session, as described in Standard Flags and Parameters.
Specifies the new location of the read-only database; typically this will be the CDROM drive where the read-only database is located.
Creates a database with catalogs that have the specified non-default page size.
Limits: Possible values for n are: 2048, 4096, 8192, 16384, and 65536.
Example: createdb dbname –page_size=4096
Note: The -dmf_cache_size parameter for the DBMS Server should be enabled for the page size specified in this command.
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
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