DB 이름 변경 후 server create 오류 발생 시#
내용#
5.3.3 이하 버전까지는 수동으로 DB를 생성해 줘야 합니다.
server라는 명령어를 수행하여 아래와 같은 종류의 작업을 수행할 수 있으며 server create 명령을 통해서 DB를 생성할 수 있습니다.
Usage: server { start | stop | kill | status | create db_charset national_charset | restart }
$server create MS949 UTF8
최초 DB 생성 시 DB NAME은 mydb로 설정되어 있으며, 변경은 altibase.properties에서 DB_NAME을 변경하면 됩니다.
#=================================================================
## Fixed Properties # should not be modified after createdb
#=================================================================
DB_NAME = mydb <-- 새로운 DB name을 변경
MEM_DB_DIR = ?/dbs
MEM_DB_DIR = ?/dbs
DEFAULT_DISK_DB_DIR = ?/dbs
DB_NAME 변경 후 server create 수행 시 아래와 같은 오류가 발생합니다.
$ server create MS949 UTF8
Connecting to the DB server... Connected.
TRANSITION TO PHASE : PROCESS
Command executed successfully.
FAILURE of createdb.
Invalid Database Name. Check the properties and retry.
[ERR-91015 : Communication failure.]
해결방법#
이는 $ALTIBASE_HOME/bin/server 스크립트 파일에 DB 이름이 mydb로 되어 있기 때문입니다.
'create')
if [ $# = 3 ]; then
rm -f live-altibase.txt;
${ISQL} << EOF > /dev/null
spool live-altibase.txt;
EOF
if [ -f live-altibase.txt ]; then
echo " server is running !!!! \n "
echo " you must shutdown first before server create "
rm -f live-altibase.txt;
else
${ADMIN} << EOF
startup process;
create database mydb INITSIZE=10M noarchivelog character set $2 national character set $3;
quit
EOF
altibase.properties에서 변경한 DB_NAME과 동일하게 변경 후 DB를 생성합니다.