Update Database

This is a NuoDB Manager command. See NuoDB Manager

Description

Updates a managed database. This will modify either the template and/or variables, options or constraints set for the database.

Some database updates take effect immediately. For example, if you add a transaction engine or a storage manager, these new processes can immediately start and they use any updated option settings. This assumes, of course, that hosts for new processes are available.

Other database updates do not take effect until you stop and restart processes. For example, you can use the update database command to change database option settings. You must shutdown and restart each running process for that process to use the new settings.

To obtain the current database settings for options, variables and constraints, invoke show database updateCommand before you update the database. See Show Database

Syntax

update database
    dbname database_name
    template 'template_name'
    [ host host_name | region region_name ]
    [ options option_list ]
    [ variables variable_list ]
    [ groupOptions:groupName option_list ]...
    [ tagConstraints:groupName constraint_list ]...

Parameters

Interactive Example

Update a database from Single Host to Minimally Redundant and specify other optional parameters:

nuodb [domain] > update database
Database Name: 

Database Options (optional): commit remote:1 mem 2g
Database Options for SMs (optional): journal-max-directory-entries 500
Tag Constraints for SMs (optional):    
Database Options for TEs (optional): verbose sql-statements
Tag Constraints for TEs (optional): 

A common operation is to update a database to use more memory. To do this, start by invoking show database updateCommand to obtain a command line that you could invoke to update the database but that would not make any changes. For example:

nuodb [domain] > show database updateCommand database foo
   update database dbname (unmanaged) variables 'REGION us-west' 
   options 'commit remote:1 mem 2g'

Copy this command line, edit it to make your changes and run it with the --command parameter. For example, you could invoke update database as follows to increase the amount of memory and to add a storage manager constraint :

nuodbmgr --broker myBroker --password myPassword --command "update database dbname foo 
   unmanaged, variables 'REGION us-west' options 'commit remote:1 mem 2g'
   tagConstraints:SMs 'archive_base ex'" 

While you can change database options while processes are running, the changes do not take effect until a process stops and restarts. However, the addition of a process happens immediately and the new process uses any updated option settings. In this example, you must stop and restart the running processes for those processes to be able to use 2g of memory for the database. Likewise, the new tag constraint is not immediately in effect and will not prevent the use of an already running storage manage on a host that does not have this tag. The new tag constraint will be in effect for the next storage manager in this group that is started.

Scripting Example

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

nuodbmgr --broker host --password password \
    --command "update database dbname test \
   
    region us-west-2 \
    options 'commit remote:1 mem 2g' \
    variables 'SM_MAX 3' \
    groupOptions:SMs 'journal-max-directory-entries 500' \
    groupOptions:TEs 'verbose sql-statements'"