Getting Started with MaxDB

Setting the environment

  1. Execute the script maxdbenv to set the environment.
    . maxdbenv.sh
  2. This tutorial assumes that

Starting and stopping the database

  1. Is the database running?
    $ dbmcli -d MAXDB1 -u DBM, db_state
    Output  
    OK
    State
    ONLINE
    ONLINE state:
    (the database is accepting connections)
    OK
    State
    ADMIN
    ADMIN state:
    (the database is accepting only administration requests
    OK
    State
    OFFLINE
    OFFLINE state:
    (the database is not started)
    ERR
    ...
    some error occurred
    (was the dabase name and the user spelled correctly?)

    After installation, the demo database should be in in state WARM.

  2. Stopping the database
    $ dbmcli -d MAXDB1 -u DBM, db_offline
    Output  
    OK the database has been stopped
    ERR
    ...
    some error occurred

    All databases should be stopped using this command before a shutdown. Otherwise, loss of data may occur.

  3. Starting the database
    $ dbmcli -d MAXDB1 -u DBM, db_online
    Output  
    OK the database has been started
    ERR
    ...
    some error occurred

  4. Troubleshooting

Executing SQL

  1. Starting SQLCLI
    $ sqlcli -d MAXDB1 -u MONA,RED
    
    Welcome to the MaxDB interactive terminal.
    
    Type:  \h for help with commands
           \q to quit
    sqlcli => \h
  2. Executing simple SQL
    sqlcli => SELECT 'Hello, MaxDB' FROM DUAL
    | EXPRESSION1  |
    | ------------ |
    | Hello, MaxDB |
    
    1 row selected (2 msec)
    

Where to go from here