Skip to content

Latest commit

 

History

History
96 lines (82 loc) · 3.47 KB

createdb.md

File metadata and controls

96 lines (82 loc) · 3.47 KB

createdb

Create database.

Request JSON Syntax

Key Description
task task name
token token string encrypted.
dbname database name
numpage the number of pages
pagesize the size of each page
logsize the size of log volume
genvolpath data volume path
logvolpath log volume path
exvol extend volume information
charset language and charset, ex. en_US.iso88591, ko_KR.utf8. please refer to $CUBRID/conf/cubrid_locales.all.txt
logpagesize the page size of the log volume
overwrite_config_file y or n, overwrite the configuration file when it already exists
overwrite_exvol_file y or n, overwrite the additional volume file when it already exists
async default "no", if "yes" run the task in asynchronous mode
  • The status of a task running in asynchronous mode can be checked using the 'gettaskstatus' api
  • Only one of these database tasks — addvoldb, backupdb, checkdb, compactdb, copydb, createdb, deletedb, loaddb, optimizedb, renamedb, restoredb, startdb, stopdb, unloaddb — can run against the same dbname at a time, whether or not async is used; a request is rejected immediately if another one of them is already running on that database

Request Sample

{
   "task":"createdb",
   "token":"cdfb4c5717170c5e237a227a2ceeccc6ae9e10c16754fb85371c0d74fa0d9d577926f07dd201b6aa",
   "dbname":"alatestdb",
   "numpage":"10240",
   "pagesize":"4096",
   "logsize":"10240",
   "logpagesize":"4096",
   "genvolpath":"$CUBRID_DATABASES/alatestdb",
   "logvolpath":"$CUBRID_DATABASES/alatestdb",
   "exvol":{"alatestdb_data_x001":"data;100;$CUBRID_DATABASES/alatestdb"},
   "charset":"en_US.utf8",
   "overwrite_config_file":"YES",
  "async":"yes"
 }

Response JSON Syntax

Key Description
task task name
status execution result, success or failed.
note if failed, a brief description will be given here; on a successful create, may instead carry a warning that a manual check is recommended (see below)
  • Creating the database itself is what status reflects. Afterward, CMS also does best-effort bookkeeping: registering the new database's entry in its own user-authorization file (cmdb.pass). If that bookkeeping fails - a lock timeout, a file I/O error, or an internal update error - the database is not removed; status still reports "success", and note instead explains that cmdb.pass may need to be corrected manually before the database is manageable through CMS. This applies whether the task is run synchronously or with async:"yes".

Response Sample

{
   "__EXEC_TIME" : "3593 ms",
   "note" : "none",
   "status" : "success",
   "task" : "createdb"
}

Response Sample (success, manual check recommended)

{
   "__EXEC_TIME" : "3601 ms",
   "note" : "WARNING: database 'alatestdb' was created on disk, but it could not be registered in cmdb.pass (lock timeout, file I/O error, or an internal update error); the database is NOT currently manageable through CMS for user 'dba' until cmdb.pass is corrected manually",
   "status" : "success",
   "task" : "createdb"
}

Response Sample (async mode)

{
   "job-status" : "running",
   "note" : "none",
   "status" : "success",
   "uuid" : "1877908931382247367"
}

Response Sample (rejected: database busy)

{
   "job-status" : "rejected",
   "note" : "database 'xyz' is busy with another task ('startdb')",
   "status" : "failure",
   "task" : "createdb"
}