gcreatedb

gcreatedb 소개

정의

gcreatedb는 GOLDILOCKS에서 제공하는 데이터베이스 생성 유틸리티이다.

기능

사용자가 지정한 DB-name, comment, time zone, character set으로 새로운 데이터베이스를 생성한다.

사용법

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

사용 예

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

Command Option

--cluster

Cluster 환경의 database를 생성한다. 
이를 사용하지 않을 경우 stand alone database를 생성한다.

--db_name

사용자가 생성하려는 database name을 지정한다. 
Default value는 "goldilocks"이다.
Database name의 최대 길이는 128 이다.

--db_comment

사용자가 생성하려는 database comment를 지정한다. 
Default value는 "goldilocks database" 이다. 
Database comment의 최대 길이는 1024 이다.

--timezone

Database의 time zone 값이다.
Default value는 property의 TIMEZONE 값이다.
Database를 생성할 때 적용되는 속성으로써 '-14:00' ~ '+14:00' 범위의 값을 사용할 수 있다.

--character_set

Database의 character set이다.
Default value는 property의 CHARACTER_SET 값이다.
Database를 생성할 때 적용되는 속성으로써 다음 중 하나의 값으로 설정할 수 있다.
• GB18030
• SQL_ASCII
• UHC
• UTF8

--char_length_units

CHAR, VARCHAR와 같은 문자열 column을 정의하면서 다음과 같이 char length unit을 생략할 경우에 사용되는 char length units 값이다.

CREATE TABLE t1
(
    id   CHAR( 10 OCTETS ),         1 10 bytes를 의미한다.
    name VARCHAR( 128 CHARACTERS ), 2 128 글자를 의미한다.
    addr VARCHAR( 1024 )            3 char length unit이 생략되었다.
);

Default value는 property의 CHAR_LENGTH_UNITS 값이다.

Database를 생성할 때 적용되는 속성으로써 다음 중 하나의 값으로 설정할 수 있다.
• OCTETS: Byte 수를 의미한다.
• CHARACTERS: 문자 개수를 의미한다.

SQL 표준은 기본값을 CHARACTERS로 정의하고 있으며 다른 DBMS들의 char length unit 기본값은 다음과 같다.

--home

Database의 home directory를 설정한다.
Default value는 $GOLDILOCKS_HOME 환경 변수를 사용한다.

--member

Cluster 환경에서 local database의 이름을 설정한다.

--host

Cluster 환경에서 local database의 host address를 설정한다.

--port

Cluster 환경에서 local database의 port 번호를 설정한다.

--silent

결과 메시지를 출력하지 않는다.

--help

Help 메시지를 출력한다.

$ 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