Command line

machbase-neo serve

Start machbase-neo server process.

Flags

General flags

flagdesc
--hostlistening network addr (default: 127.0.0.1)
ex) --host 0.0.0.0
-c, --configconfig file location
ex) --config /data/machbase-neo.conf
--pidfile path to save pid
ex) --pid /data/machbase-neo.pid
--datapath to database (default: ./machbase_home)
ex) --data /data/machbase
--filepath to files (default: .)
ex) --file /data/files
--backup-dirpath to the backup dir (default: ./backups)
ex) --backup-dir /data/backups Since v8.0.26
--prefpath to preference directory path.
(default: ~/.config/machbase)
--presetdatabase preset auto, fog, edge (default: auto)
ex) --preset edge

Database Sessions flags

Conceptually, if we divide machbase-neo into the API part (http, mqtt, etc.) that includes tql and the DBMS part, there have been no restrictions on traffic between the API and DBMS so far.

If 100 MQTT clients and 100 HTTP clients, a total of 200 clients, execute a db query “simultaneously”, 200 sessions will be executed in the DBMS. If there is a tool that can control the traffic flow delivered to the DBMS, it would be possible to configure flexibly depending on the situation. Therefore, new flags that can be used in machbase-neo serve have been added. Since v8.0.44

flagdesc
--max-open-conn< 0 : unlimited (default)
0 : = CPU_count * factor
> 0 : specified max open connections
--max-open-conn-factorused to calculate the number of the max open connections when --max-open-conn is 0. (default 2).
--max-open-query< 0 : unlimited
0 (default) : = CPU_count * factor
> 0 : specified max open query iterations
--max-open-query-factorused to calculate the number of the max open query iterations when --max-open-query is 0. (default 2)
  • –mach-open-conn controls the number of connections (=sessions) that can be OPENED “simultaneously” between the API and DBMS. If this number is exceeded, it will wait at the API level.
    • < 0 If a negative number (e.g., -1) is set, it operates without restrictions as in previous versions.
    • 0 If no settings are made by default, it is calculated as the number of CPU cores * max-open-conn-factor. The default max-open-conn-factor is 1.5.
    • > 0 If a positive number is set, it operates according to the set value.

This setting value can be checked as a command session limit within machbase-neo shell and can be changed with session limit --set=<num>. Since the change is maintained only while the process is running, the startup script must be modified to change it permanently.

  • –mach-open-conn-factor sets the factor value to calculate as the number of CPU cores * factor when --mach-open-conn described above is 0 (default). This value must be 0 or higher, and if it is 0 or negative, the default 2.0 is applied.

As example, if the number of CPU cores is 8 and the factor is 2.0, the open limit becomes 16, and if it is 0.5, the open limit becomes 4. If none of the two options described above are given, the default factor 2.0 is applied, and the open limit becomes 16.

Http flags

Since v8.0.43
flagdefaultdesc
--http-linger-1HTTP socket option, -1 means disable SO_LINGER, >=0 means set SO_LINGER
--http-readbuf-size0HTTP socket read buffer size. 0 means use system default.
--http-writebuf-size0HTTP socket write buffer size. 0 means use system default.
--http-debugfalseEnable HTTP Ddebug log
--http-debug-latency"0"Log HTTP requests that take longer than the specified duration to respond (e.g., “3s”). “0” means all request.
--http-allow-statzAllow source IPs (comma separated) to access /db/statz API. default allows only 127.0.0.1.

Log flags

flagdefaultdesc
--log-filename- (stdout)log file path
ex) --log-filename /data/logs/machbase-neo.log
--log-levelINFOlog level. TRACE, DEBUG, INFO, WARN, ERROR
ex) --log-level INFO
--log-appendtrueappend existing log file. Since v8.0.13
--log-rotate-schedule@midnighttime scheduled log file rotation Since v8.0.13
--log-max-size10file max size in MB Since v8.0.13
--log-max-backups1maximum log file backups Since v8.0.13
--log-max-age7maximum days in backup files Since v8.0.13
--log-compressfalsegzip compress the backup files Since v8.0.13
--log-time-utcfalseuse UTC time for logging Since v8.0.13

Listener flags

flagdefaultdesc
--shell-port5652ssh listen port
--mqtt-port5653mqtt listen port
--mqtt-sock/tmp/machbase-neo-mqtt.sockmqtt unix socket Since v8.0.36
--http-port5654http listen port
--http-sock/tmp/machbase-neo.sockhttp unix socket Since v8.0.36
--grpc-port5655grpc listen port
--grpc-sockmach-grpc.sockgrpc unix domain socket
--grpc-insecurefalseset true to use plain tcp socket,
disable TLS Since v8.0.18
--mach-port5656machbase native listen port
πŸ“Œ
IMPORTANT
Since the default of --host is the loopback address, it is not allowed to access machbase-neo from the remote hosts.
Set --host <host-address> or --host 0.0.0.0 for accepting the network connections from remote clients.

If execute machbase-neo serve with no flags,

$ machbase-neo serve

it is equivalent with

$ machbase-neo serve --host 127.0.0.1 --data ./machbase_home --file . --preset auto

Head Only Mode

Since v8.0.45
⚠️
BETA Warning
The head-only and headless modes are currently in beta and are not suitable for production environments.

If the --data flag value is a URL pointing to another Machbase DBMS’s mach port (5656), as shown in the example below:

SECRET="sys:manager" \
machbase-neo serve --data machbase://${SECRET}@192.168.1.100:5656

In this mode, the machbase-neo process starts without its own database and uses the target database instead. The “head-only machbase-neo” does not provide the 5656 port service, and all other APIs work with the destination DBMS.

Headless Mode

Since v8.0.45
⚠️
BETA Warning
The head-only and headless modes are currently in beta and are not suitable for production environments.

machbase-neo serve-headless starts a DBMS process using only the Machbase DBMS mach port (5656). This mode is useful for running a DBMS process without other service ports (HTTP, MQTT, gRPC, SSH) and their related functions.

This running mode is specifically designed to work with separate “head-only” mode processes, allowing the separation of API services and the DBMS engine.

machbase-neo shell

Start machbase-neo shell. It will start interactive mode shell if there are no other arguments.

Flags

flag (long)defaultdesc
-s, --servertcp://127.0.0.1:5655machbase-neo’s gRPC address.
e.g. -s unix://./mach-grpc.sock
e.g. --server tcp://127.0.0.1:5655
--usersysuser name.
env: NEOSHELL_USER Since v8.0.4
--passwordmanagerpassword.
env: NEOSHELL_PASSWORD Since v8.0.4

When machbase-neo shell starts, it is looking for the user name and password from OS’s environment variables NEOSHELL_USER and NEOSHELL_PASSWORD. Then if the flags --user and --password are provided, it will override the provided values instead of the environment variables.

Precedence of username and password

Command line flags

If --user, --password is provided? Use the given values

Environment variables

If $NEOSHELL_USER (on windows %NEOSHELL_USER%) is set? Use the value as the user name.

If $NEOSHELL_PASSWORD (on windows %NEOSHELL_PASSWORD%) is set? Use the value as the password.

Default

None of those are provided? Use default value sys and manager.

Practical usage

For the security, use instant environment variables as below example.

$ NEOSHELL_PASSWORD='my-secret' machbase-neo shell --user sys

Be aware when you use --password flag, the secret can be exposed by simple ps command as like an example below.

$ machbase-neo shell --user sys --password manager
$ ps -aef |grep machbase-neo
  501 13551  3598   0  9:33AM ttys000    0:00.07 machbase-neo shell --user sys --password manager

Run Query

machbase-neoΒ» select binary_signature from v$version;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ BINARY_SIGNATURE                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ 8.0.2.develop-LINUX-X86-64-release-standard β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
a row fetched.

Create Table

machbase-neoΒ» create tag table if not exists example (name varchar(20) primary key, time datetime basetime, value double summarized);
executed.

Schema Table

machbase-neoΒ» desc example;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ NAME  β”‚ TYPE     β”‚ LENGTH β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ NAME  β”‚ varchar  β”‚     20 β”‚
β”‚      2 β”‚ TIME  β”‚ datetime β”‚      8 β”‚
β”‚      3 β”‚ VALUE β”‚ double   β”‚      8 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Insert Table

machbase-neoΒ» insert into example values('tag0', to_date('2021-08-12'), 100);
a row inserted.

Select Table

machbase-neoΒ» select * from example;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ NAME β”‚ TIME(LOCAL)         β”‚ VALUE β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ tag0 β”‚ 2021-08-12 00:00:00 β”‚ 100   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜
a row fetched.

Drop Table

machbase-neoΒ» drop table example;
executed.

Sub commands

explain

Syntax explain [--full] <sql>

Shows the execution plan of the sql.

machbase-neoΒ» explain select * from example where name = 'tag.1';
 PROJECT
  TAG READ (RAW)
   KEYVALUE INDEX SCAN (_EXAMPLE_DATA_0)
    [KEY RANGE]
     * IN ()
   VOLATILE INDEX SCAN (_EXAMPLE_META)
    [KEY RANGE]
     *

export

  export [options] <table>
  arguments:
    table                    table name to read
  options:
    -o,--output <file>       output file (default:'-' stdout)
    -f,--format <format>     output format
                csv          csv format (default)
                json         json format
       --compress <method>   compression method [gzip] (default is not compressed)
       --[no-]heading        print header message (default:false)
       --[no-]footer         print footer message (default:false)
    -d,--delimiter           csv delimiter (default:',')
       --tz                  timezone for handling datetime
    -t,--timeformat          time format [ns|ms|s|<timeformat>] (default:'ns')
                             consult "help timeformat"
    -p,--precision <int>     set precision of float value to force round

import

  import [options] <table>
  arguments:
    table                 table name to write
  options:
    -i,--input <file>     input file, (default: '-' stdin)
    -f,--format <fmt>     file format [csv] (default:'csv')
       --compress <alg>   input data is compressed in <alg> (support:gzip)
       --no-header        there is no header, do not skip first line (default)
	   --charset          set character encoding, if input is not UTF-8
       --header           first line is header, skip it
       --method           write method [insert|append] (default:'insert')
       --create-table     create table if it doesn't exist (default:false)
       --truncate-table   truncate table ahead importing new data (default:false)
    -d,--delimiter        csv delimiter (default:',')
       --tz               timezone for handling datetime
    -t,--timeformat       time format [ns|ms|s|<timeformat>] (default:'ns')
                          consult "help timeformat"
       --eof <string>     specify eof line, use any string matches [a-zA-Z0-9]+ (default: '.')

show info

Display the server information.

machbase-neoΒ» show info;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ NAME               β”‚ VALUE                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ build.version      β”‚ v2.0.0                      β”‚
β”‚ build.hash         β”‚ #c953293f                   β”‚
β”‚ build.timestamp    β”‚ 2023-08-29T08:08:00         β”‚
β”‚ build.engine       β”‚ static_standard_linux_amd64 β”‚
β”‚ runtime.os         β”‚ linux                       β”‚
β”‚ runtime.arch       β”‚ amd64                       β”‚
β”‚ runtime.pid        β”‚ 57814                       β”‚
β”‚ runtime.uptime     β”‚ 2h 30m 57s                  β”‚
β”‚ runtime.goroutines β”‚ 45                          β”‚
β”‚ mem.sys            β”‚ 32.6 MB                     β”‚
β”‚ mem.heap.sys       β”‚ 19.0 MB                     β”‚
β”‚ mem.heap.alloc     β”‚ 9.7 MB                      β”‚
β”‚ mem.heap.in-use    β”‚ 13.0 MB                     β”‚
β”‚ mem.stack.sys      β”‚ 1,024.0 KB                  β”‚
β”‚ mem.stack.in-use   β”‚ 1,024.0 KB                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

show ports

Display the server’s interface ports

machbase-neoΒ» show ports;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SERVICE β”‚ PORT                                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ grpc    β”‚ tcp://127.0.0.1:5655                   β”‚
β”‚ grpc    β”‚ unix:///database/mach-grpc.sock        β”‚
β”‚ http    β”‚ tcp://127.0.0.1:5654                   β”‚
β”‚ mach    β”‚ tcp://127.0.0.1:5656                   β”‚
β”‚ mqtt    β”‚ tcp://127.0.0.1:5653                   β”‚
β”‚ shell   β”‚ tcp://127.0.0.1:5652                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

show tables

Syntax: show tables [-a]

Display the table list. If flag -a is specified, the result includes the hidden tables.

machbase-neoΒ» show tables;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ DB         β”‚ USER β”‚ NAME        β”‚ TYPE      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ MACHBASEDB β”‚ SYS  β”‚ EXAMPLE     β”‚ Tag Table β”‚
β”‚      2 β”‚ MACHBASEDB β”‚ SYS  β”‚ TAG         β”‚ Tag Table β”‚
β”‚      3 β”‚ MACHBASEDB β”‚ SYS  β”‚ TAGDATA     β”‚ Tag Table β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

show table

Syntax show table [-a] <table>

Display the column list of the table. If flag -a is specified, the result includes the hidden columns.

machbase-neoΒ» show table example -a;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ NAME  β”‚ TYPE     β”‚ LENGTH β”‚ DESC     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ NAME  β”‚ varchar  β”‚    100 β”‚ tag name β”‚
β”‚      2 β”‚ TIME  β”‚ datetime β”‚     31 β”‚ basetime β”‚
β”‚      3 β”‚ VALUE β”‚ double   β”‚     17 β”‚          β”‚
β”‚      4 β”‚ _RID  β”‚ long     β”‚     20 β”‚          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

show meta-tables

machbase-neoΒ» show meta-tables;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚      ID β”‚ NAME                   β”‚ TYPE        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ 1000020 β”‚ M$SYS_TABLESPACES      β”‚ Fixed Table β”‚
β”‚      2 β”‚ 1000024 β”‚ M$SYS_TABLESPACE_DISKS β”‚ Fixed Table β”‚
β”‚      3 β”‚ 1000049 β”‚ M$SYS_TABLES           β”‚ Fixed Table β”‚
β”‚      4 β”‚ 1000051 β”‚ M$TABLES               β”‚ Fixed Table β”‚
β”‚      5 β”‚ 1000053 β”‚ M$SYS_COLUMNS          β”‚ Fixed Table β”‚
β”‚      6 β”‚ 1000054 β”‚ M$COLUMNS              β”‚ Fixed Table β”‚
......

show virtual-tables

machbase-neoΒ» show virtual-tables;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚      ID β”‚ NAME                                    β”‚ TYPE               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚      65 β”‚ V$HOME_STAT                             β”‚ Fixed Table (stat) β”‚
β”‚      2 β”‚      93 β”‚ V$DEMO_STAT                             β”‚ Fixed Table (stat) β”‚
β”‚      3 β”‚     227 β”‚ V$SAMPLEBENCH_STAT                      β”‚ Fixed Table (stat) β”‚
β”‚      4 β”‚     319 β”‚ V$TAGDATA_STAT                          β”‚ Fixed Table (stat) β”‚
β”‚      5 β”‚     382 β”‚ V$EXAMPLE_STAT                          β”‚ Fixed Table (stat) β”‚
β”‚      6 β”‚     517 β”‚ V$TAG_STAT                              β”‚ Fixed Table (stat) β”‚
......

show users

machbase-neoΒ» show users;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ USER_NAME β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ SYS       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
a row fetched.

show license

 machbase-neoΒ» show license;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ ID       β”‚ TYPE         β”‚ CUSTOMER β”‚ PROJECT    β”‚ COUNTRY_CODE β”‚ INSTALL_DATE        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ 00000023 β”‚ FOGUNLIMITED β”‚ VUTECH   β”‚ FORESTFIRE β”‚ KR           β”‚ 2024-04-22 15:56:14 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
a row fetched.

session list

Syntax: session list Since v8.0.17

 machbase-neoΒ» session list;
β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ID β”‚ USER_NAME β”‚ USER_ID β”‚ STMT_COUNT β”‚ CREATED β”‚ LAST    β”‚ LAST SQL β”‚
β”œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 25 β”‚ SYS       β”‚ 1       β”‚          1 β”‚ 1.667ms β”‚ 1.657ms β”‚ CONNECT  β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

session kill

Syntax session kill <ID> Since v8.0.17

session stat

Syntax: session stat Since v8.0.17

machbase-neoΒ» session stat;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
β”‚ NAME           β”‚ VALUE β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ CONNS          β”‚ 1     β”‚
β”‚ CONNS_USED     β”‚ 17    β”‚
β”‚ STMTS          β”‚ 0     β”‚
β”‚ STMTS_USED     β”‚ 20    β”‚
β”‚ APPENDERS      β”‚ 0     β”‚
β”‚ APPENDERS_USED β”‚ 0     β”‚
β”‚ RAW_CONNS      β”‚ 1     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜

desc

Syntax desc [-a] <table>

Describe table structure.

machbase-neoΒ» desc example;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ROWNUM β”‚ NAME  β”‚ TYPE     β”‚ LENGTH β”‚ DESC     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      1 β”‚ NAME  β”‚ varchar  β”‚    100 β”‚ tag name β”‚
β”‚      2 β”‚ TIME  β”‚ datetime β”‚     31 β”‚ basetime β”‚
β”‚      3 β”‚ VALUE β”‚ double   β”‚     17 β”‚          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

machbase-neo restore

Syntax machbase-neo restore --data <machbase_home_dir> <backup_dir> Since v8.0.17

Restore database from backup.

$ machbase-neo restore --data <machbase home dir>  <backup dir>

machbase-neo version

Show version and engine info.

machbase-neo_version

machbase-neo gen-config

Prints out default config template.

$ machbase-neo gen-config ↡

define DEF {
    LISTEN_HOST       = flag("--host", "127.0.0.1")
    SHELL_PORT        = flag("--shell-port", "5652")
    MQTT_PORT         = flag("--mqtt-port", "5653")
    HTTP_PORT         = flag("--http-port", "5654")
    GRPC_PORT         = flag("--grpc-port", "5655")
......
Last updated on