Hotcopy

This is a NuoDB Manager command. See NuoDB Manager.

Description

Obtain a copy of a running database. This copy contains the state of the storage manager or snapshot storage manager that it is run on as it was at approximately the time when the hot copy finished running. The database stored in the hot copy result is transactionally consistent. You can use it to open a database, start an SM or SSM, invoke the the nuochk utility, or save as a backup.

Snapshot storage managers and the ability to restore data to a snapshot are preview features.

Caution: NuoDB encourages you to use preview features in your development projects. However, the use of preview features in production is not supported.

Syntax

hotcopy database database_name
    [ host host_name[:port] ]
    [ pid { sm_id | ssm_id } ]
    [ snapshot number[-number ]]
    [ album number[-number] ]
    destinationArchiveDirectory archive_path
    [ destinationJournalDirectory journal_path ]
    [ destinationSnapshotDirectory snapshot_path ]
    [ timeout timeout_value ]

Parameters

Note: In interactive mode, nuodbmgr prompts for parameters related to snapshots even when you specify that you are copying from a storage manager.

Useful Properties

hotcopyTimeout

See NuoDB Manager Properties.

Interactive Example

Suppose you want to copy the current state of the test database, which is running on only the local host. There is only one storage manager running on the local host and you want the destination archive directory to be test_archive_hotcopy050515 in the default NuoDB database directory, which is the value of the host's archive_base key in the Automation Console. Here is the command you would enter:

nuodb [domain] > hotcopy database test
Snapshot to copy, or firstSnapshot-lastSnapshot (optional): 
Album to copy, or firstAlbum-lastAlbum, 0 means current state (optional): 
Destination directory: test_archive_hotcopy050515
Destination journal directory (optional): 
Destination snapshot directory (optional): 
Storage Manager host (optional): 
Storage Manager process id (optional): 
Timeout (ms/s/m/h/d/w) (optional): 
Hot copy to /var/opt/nuodb/production-archives/test_archive_hotcopy050515 completed on myhost-jdoe-mac, pid 12345

The hot copy operation does the following:

Following is an example of invoking hotcopy on a snapshot storage manager:

nuodb [domain] > hotcopy database test
Snapshot to copy, or firstSnapshot-lastSnapshot (optional): 123456
Album to copy, or firstAlbum-lastAlbum, 0 means current state (optional): 
Destination directory: /hotcopyResults/test_archive
Destination journal directory (optional): 
Destination snapshot directory (optional): /hotcopyResults/test_archive/snapshots
Storage Manager host (optional): myHost
Storage Manager process id (optional): 98765
Timeout (ms/s/m/h/d/w) (optional): 
Hot copy to /hotcopyResults/test_archive completed on myhost-jdoe-mac, pid 98765

Scripting Example

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

$ nuodbmgr --broker host --password password \
    --command "hotcopy database test destinationArchiveDirectory test_archive_hotcopy050515"
$ nuodbmgr --broker host --password password \
    --command "hotcopy database test \
    host myHost \
    pid 98765 \
    snapshot 123456 \
    destinationArchiveDirectory /hotcopyResults/test_archive \
    destinationSnapshotDirectory /hotcopyResults/test_archive/snapshot"