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.
By default createdb creates a Unicode-enabled database with Normalization Form C, even if the character set for the installation is not UTF8. To disable Unicode, use the ‑e 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.
Notes:
• When a database is created, system catalogs are created with the server default page size, unless specified differently on the –page_size parameter.
• 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] [-ddataloc] [-cckploc] [-jjnlloc] [-bdmploc]
[-wworkloc] [-page_size=N] [-private] [-e] [-i] [-nosrid] [-m] [-rlocation]
[-lcollation] [-uuser] [-fproducts] [+user=authuser] [-p] [-S] [-srid]
[-P[password]] [-vvecloc] [-encrypt] [-no_x100] [-h]
dbname
Specifies the name of the database to create. The name must be unique and begin with an alphabetic character. The name can have a maximum of 24 alphanumeric characters (underscore is also allowed).
Also specifies the
server_class, if required. See
Standard Flags and Parameters for details. If you are using Ingres Star, you must specify star as the
server_class. For examples, see the
Ingres Star User Guide.
-ddataloc
Specifies the location of the database files. The default is the location to which II_DATABASE points.
-cckploc
Specifies the location of the checkpoint files. The default is the location to which II_CHECKPOINT points.
-jjnlloc
Specifies the location of the journal files. The default is the location to which II_JOURNAL points.
-bdmploc
Specifies the location of the dump files. The default is the location to which II_DUMP points.
-wworkloc
Specifies the location of the work files. The default is the location to which II_WORK points.
-page_size=n
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.
-private
Creates a private database.
-e
Excludes the database from being Unicode enabled.
-i
For Unicode, use the default collation table unless another table is specified.
-nosrid
Restricts the pre-loading of EPSG (geospatial) data into spatial_ref_sys.
-m
Indicates that all operations on this database must be logged. Attempts to use SET NOLOGGING on this database are rejected.
-rlocation
Specifies the new location of the read-only database. It is typically the CD-ROM drive where the read-only database is located.
-lcollation
Specifies the du_collation setting ("db collation"), which you can use only for a non-UTF8 database.
-uuser
-fproducts
Specifies user interface products to create catalogs. Valid product names are ingres, ingres/dbd, vision, windows_4gl, and nofeclients. See
Standard Flags and Parameters for details. The default is to include all product names.
+user=authuser
Specifies the user name (authuser) and password used for connection authentication, whether through OS authentication, DBMS authentication, or another mechanism. See
Standard Flags and Parameters for details.
-p
Creates a private database. Only the DBA and names specified on the accessdb command have access to the database. Do not use this flag with Ingres Star.
-S
Creates 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”).
-srid
Allows the pre-loading of EPSG (geospatial) data into spatial_ref_sys. This is the default flag and its value is “on”.
-P[password]
Specifies the user password for the database.
-vvecloc
Specifies alternate default location for vectorwise.
-encrypt
Encrypts the database and prompts you to enter an initial encryption passphrase. It is valid for X100 only and cannot be used with the“-no_x100” flag.
-no_x100
Permanently prohibits the creation of X100 tables and the use of X100 operations, such as CALL X100, in the database. The iidbdb and imadb databases are implicitly -no_x100. This flag cannot be used with the“-encrypt” flag.
-h
Displays the command syntax online.