1.70.1 Start and Stop the Server

Windows

On Windows starting a MonetDB server is done by simply clicking: 'Start' -> 'Programs' -> 'MonetDB5 ' -> 'MonetDB SQL Server'. This will start the MonetDB Server with SQL support in a separate window. Although this window comes with an interactive prompt, you should (unless you know what you are doing) keep this window minimized.

     # MonetDB server v5.4, based on kernel v1.20.0
     # Serving database 'demo'
     # Compiled for i686-pc-win32/32bit with 32bit OIDs dynamically linked
     # Copyright (c) 1993-2008 CWI, all rights reserved
     # Visit http://monetdb.cwi.nl/ for further information
     #warning: please don't forget to set your vault key!
     #(see C:\Program Files\CWI\MonetDB5\etc\monetdb5.conf)
     # Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
     # MonetDB/SQL module v2.20.2 loaded
     >

The database is created in a default location with the name demo.

The textual interface shipped with the server can be started by clicking: 'Start' -> 'Programs' -> 'MonetDB5 ' -> 'MonetDB SQL Client'.

If you plan to make the server accessible from remote locations then the configuration file should be editted. See Database Configuration for more details.

Unix

On UNIX-like systems, MonetDB/SQL comes with the following programs: merovingian, mserver5, monetdb and mclient. merovingian is a daemon process that controls a collection of database servers, i.e. mserver5 processes, each looking after a single physical database. Start this merovingian to gain access to your MonetDB database farm. merovingian is designed to be used in a system initialisation script in production environments.

With merovingian running in the background, managing the databases and their connections is greatly simplified. After a fresh install the next step would typically be to create your first database, e.g. test.

The program monetdb is used to perform such actions. It can perform multiple actions to databases and it provides options to inspect the stability of all database servers. Database servers can be temporarily closed for external access for maintenance, allowing for checkpointing. This is the default state a newly created database has.

     shell> monetdb create test
     successfully created database 'test'

The status of all database servers now can be inspected using:

     shell> monetdb status
           name       state     uptime       health       last crash
     test            locked

This report is helpful to determine possible instabilities and heavy loaded servers. In this case, it indicates that our database exists, but that it is not running yet. To start it we can use the 'start' command to monetdb. Keep in mind, that the database remains in maintenance mode (locked state) afterwards.

     shell> monetdb start test
     starting database 'test'... done
     shell> monetdb status test
          name        state     uptime       health       last crash
     test            locked            5s  100%,  0s  -

Because the database is still under maintenance, only the database administrator can contact the database. For other users, the database has to be released using monetdb first. See the section below on this maintenance mode.

Any connection to the database can be made by the database administrator, e.g. using mclient, which provides a typical console interface to the database. For example, the statements below illustrate a short session of the creation of a new user. The session is closed using the mclient console command \q.

     shell> mclient -l sql -d demo
     sql>CREATE USER "voc" WITH PASSWORD 'voc' NAME 'VOC Explorer' SCHEMA "sys";
     sql>CREATE SCHEMA "voc" AUTHORIZATION "voc";
     sql>ALTER USER "voc" SET SCHEMA "voc";
     sql>\q

See for a more complete session VOC demo.

Maintenance mode

A database can be closed for maintenance. Doing so blocks any new non-administrator clients to connect to the server.

     shell> monetdb lock test

The effect is that only the system administrator can gain access to the server. All other users are rejected with the message 'Database temporarily unavailable for maintenance' upon an attempt to connect. A database under maintenance will also not be automatically started by merovingian if a client requests access to it, while not running.

After maintenance has been completed, the database server can be put into normal mode again using monetdb release. All users will have access to the database again.

     shell> monetdb release test

For more details on merovingian and monetdb inspect their manual pages.