Show Database

This is a NuoDB Manager command. See NuoDB Manager.

Description

Displays information about a database.

Syntax

show database { config | hosts | updateCommand } database database_name

show database processes [ inclOptions optionsList ] database database_name

Parameters

Useful Properties

showServerConfig
showUnreachable

See NuoDB Manager Properties.

Interactive Example

Show database configuration information about database test including its status, template variables, database options, archive locations and template.

nuodb [domain] > show database config
Database: test
Database: test, (unmanaged) ACTIVE, Status=RUNNING, 
  Variables: {REGION=us-west-2}
  Options: {} 
  Default Options: { "commit": "${COMMIT:remote:1}","backoff.reqMinUptime":"30000","hostLimit":"${HOST_LIMIT:false}"}
  DB UUID: 0d1212bb-7228-174c-c787-d93d4b367a6c
  Process group options:
  Process group tag constraints:
  Archive Locations:
    ec2-52-24-143-83.us-west-2.compute.amazonaws.com/52.24.143.83:48004, requirements: SMs, region: us-west-2:
      archive: /var/opt/nuodb/production-archives/test
      journal-dir: /var/opt/nuodb/production-archives/test
    ip-172-31-13-183/52.24.2.248:48004, requirements: SMs, region: us-west-2:
      archive: /var/opt/nuodb/production-archives/test
      journal-dir: /var/opt/nuodb/production-archives/test
 

Show which hosts in the domain are servicing the database test:

nuodb [domain] > show database hosts
Database: test
[broker] * ec2-52-24-143-83.us-west-2.compute.amazonaws.com/52.24.143.83:48004 (us-west-2) CONNECTED
[broker] ip-172-31-13-183/52.24.2.248:48004 (us-west-2) CONNECTED
[broker] ip-172-31-14-56/52.25.88.188:48004 (us-west-2) CONNECTED

Show which database processes (TE, SM, SSM) are servicing the database test:

nuodb [domain] > show database processes
Database: test
Include options (optional): 
[SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 20433 ] [ db = test ] [ nodeId = 1 ] RUNNING
[SM] ip-172-31-13-183/52.24.2.248:48005 (us-west-2) [ pid = 26457 ] [ db = test ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-13-183/52.24.2.248:48006 (us-west-2) [ pid = 26486 ] [ db = test ] [ nodeId = 4 ] RUNNING
[TE] ip-172-31-14-56/52.25.88.188:48005 (us-west-2) [ pid = 2885 ] [ db = test ] [ nodeId = 2 ] RUNNING
 

Suppose the following command was used to create the foo database:

nuodb [domain] > create database dbname foo template 'Minimally Redundant' 
     dbaUser dba dbaPassword dba 
     options 'mem 1g' region us-west tagConstraints:SMs 'archive_base ex:'

When you want to update a database, it is important to know these settings. You can obtain them by invoking show database updateCommand, for example:

nuodb [domain] > show database updateCommand database foo
update database dbname foo  
     variables 'REGION us-west' 
     options 'mem 1g' 
     groupOptions:TEs 'mem 500m' 
     tagConstraints:SMs 'archive_base ex:'

Starting with the provided update database command line, you can invoke the NuoDB Manager update database command, for example to change the amount of memory the database uses. See Update Database.

When listing process information include settings for the database options, mem and commit:

nuodb [domain] > show database processes
Database: test
Include options (optional): mem commit
[SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 20433 ] [ db = test ] 
   [ nodeId = 1 ] [ commit = remote:1 ] [ mem = 2147483648 ] RUNNING
[SM] ip-172-31-13-183/52.24.2.248:48005 (us-west-2) [ pid = 26457 ] [ db = test ] 
   [ nodeId = 3 ] [ commit = remote:1 ] [ mem = 2147483648 ] RUNNING
[TE] ip-172-31-13-183/52.24.2.248:48006 (us-west-2) [ pid = 26486 ] [ db = test ] 
   [ nodeId = 4 ] [ commit = remote:1 ] [ mem = 2147483648 ] RUNNING
[TE] ip-172-31-14-56/52.25.88.188:48005 (us-west-2) [ pid = 2885 ] [ db = test ] 
   [ nodeId = 2 ] [ commit = remote:1 ] [ mem = 2147483648 ] RUNNING

Scripting Example

The same show database commands can be executed with --command as follows:

nuodbmgr --broker host --password password \
    --command "show database config database test"nuodbmgr --broker host --password password \
    --command "show database hostsdatabase test"nuodbmgr --broker host --password password \
    --command "show database processes database test"nuodbmgr --broker host --password password \
    --command "show database processes inclOptions 'mem commit' database test"