gcreatedb

Overview of gcreatedb

Definition

gcreatedb is a database creation utility provided by GOLDILOCKS.

Feature

A new database is created by using DB_Name, comment, time zone, character set specified by a user.

Usage

gcreatedb [options]

Option

--cluster              cluster system (if not specified, stand-alone system)
--db_name              database name
--db_comment           database comment
--timezone             timezone ( {+/-}{TZH:TZM} )
--character_set        character set
                            SQL_ASCII
                            UTF8
                            UHC
                            GB18030
--char_length_units    char length units
                            OCTETS
                            CHARACTERS
--home                 home directory
--member               local member name
--host                 host address
--port                 host port
--silent               suppresses the display of the result message
--help                 print help message

Example

$ gcreatedb --db_name="goldilocks" --db-comment="goldilocks database" --timezone="+09:00" --character_set="UTF8" --silent

Command Option

--cluster

It creates the database of a cluster environment.
If this option is not used, then it creates the database of a stand alone environment.

--db_name

It specifies the database name which a user wants to create.
The default value is "goldilocks".
The maximum length of database name is 128.

--db_comment

It specifies the database comment which a user wants to create.
The default value is "goldilocks database".
The maximum length of database comment is 1024.

--timezone

It is the time zone value of database.
The default value is the TIMEZONE value of the property.
The property is applied when database is created and it has a value in range of '-14:00' ~ '+14:00'.

--character_set

It is the database character set.
The default value is the CHARACTER_SET value of the property.
The property is applied when database is created, and its value is set to one of the following.
• GB18030
• SQL_ASCII
• UHC
• UTF8

--char_length_units

It is the char length unit value that is used when defining the string column type such as CHAR, VARCHAR and omitting its char length unit as follows.

CREATE TABLE t1
(
    id   CHAR( 10 OCTETS ),         1 It refers to 10 bytes.
    name VARCHAR( 128 CHARACTERS ), 2 It refers to 128 characters.
    addr VARCHAR( 1024 )            3 char length unit is omitted.
The default value is the CHAR_LENGTH_UNITS value of the property.
The property is applied when database is created, and its value is set to one of the following.
• OCTETS: It is the number of bytes.
• CHARACTERS: It is the number of characters.
The default value of char length unit is defined as CHARACTERS in the SQL standard and it is defined as follows in other DBMS.

--home

It sets the home directory of the database.
The default value uses $GOLDILOCKS_HOME environment variable.

--member

It sets the name of a local database in a cluster environment.

--host

It sets the host address of a local database in a cluster environment.

--port

It sets the port number of a local database in a cluster environment.

--silent

Result messages are not displayed.

--help

Help messages are displayed.

$ gcreatedb --help

Usage 
    gcreatedb [options]
Options:
    --db_name                 database name
    --db_comment              database comment
    --timezone                timezone ( {+/-}{TZH:TZM} )
    --character_set           character set
                                SQL_ASCII
                                UTF8
                                UHC
                                GB18030
    --char_length_units       char length units
                                OCTETS
                                CHARACTERS
    --silent                  suppresses the display of the result message
    --help                    print help message

examples:
    gcreatedb --db_name="goldilocks" --db_comment="goldilocks database" --timezone="+09:00" --character_set="UTF8" --char_length_units="OCTETS" --silent