Skip to content

16.4.1 machadmin

machadmin starts and stops the Machbase server, creates and deletes databases, and checks server status.

Options

machadmin -h
OptionDescription
-u, --startupStart the Machbase server
--recovery[=simple,complex,reset]Set the startup recovery mode (default: simple)
-s, --shutdownShut down the Machbase server gracefully
-k, --killForce the Machbase server to stop
-c, --createdbCreate the Machbase database
-d, --destroydbDelete the Machbase database
-e, --checkCheck whether the server is running
-i, --silentRun without a banner
-r, --restoreRestore the database from a backup
-x, --extractConvert a backup file to a backup directory
-w, --viewimageDisplay backup image file information
-t, --licinstallInstall a license file
-f, --licinfoDisplay installed license information
--home-path=pathSet the Machbase home path

Starting the Server

machadmin -u

Specifying a Recovery Mode

machadmin -u --recovery=simple    # Default recovery after a clean shutdown
machadmin -u --recovery=complex   # Applied automatically after power loss
machadmin -u --recovery=reset     # Full scan if simple/complex recovery fails
Recovery ModeDescription
simpleDefault recovery after a clean shutdown. Takes less time
complexApplied automatically after an abnormal shutdown such as power loss. Takes longer than simple
resetScans all table data for recovery. Some data may be lost

Stopping the Server

Graceful shutdown (waits for in-progress work to complete):

machadmin -s

Forced shutdown (terminates the process immediately):

machadmin -k

Creating and Deleting the Database

# Create the database
machadmin -c

# Delete the database (displays a confirmation prompt)
machadmin -d

Checking Server Status

machadmin -e

Displays the PID if the server is running.

Machbase server is already running with PID (14098).

Displays an error if the server is not running.

[ERR] Server is not running.

Restoring the Database

Restore the database from a backup directory.

machadmin -r /path/to/backup

Example:

machadmin -r /home/mach/backup/machbase_backup_20240101

License Management

Install a license file:

machadmin -t /path/to/license.dat

Check the installed license:

machadmin -f

Silent Mode

Runs without a banner or status messages. Useful in scripts.

machadmin -i -u    # Start the server without a banner
machadmin -i -s    # Stop the server without a banner
machadmin -i -e    # Check status without a banner

Examples

# Initialize the database and start the server
machadmin -c
machadmin -u

# Check server status, then stop it
machadmin -e
machadmin -s

# Renew the license
machadmin -s
machadmin -t new_license.dat
machadmin -u
Last updated on