Using Full Hot Copy

A full hot copy creates a transactionally-consistent copy of an SM. This copy includes every storage group that SM serves (note, this may not be every storage group in the database, use the plan syntax to coordinate hot copy across multiple SMs to ensure that every storage group is included in a hot copy when using TP/SG).

A full hot copy of an SM is approximately the same size as the archive of the SM being hot copied at the time the hot copy finishes, plus the size of the journal of the SM at the time the hot copy finishes.

How to use full hot copy

To request a full hot copy, specify type full when executing the hot copy. The type option is required when hot copying into a backup set.

When performing full hot copy into a backup set, full hot copy must create a new (empty) backup set. This means that the backupSetDirectory of the full hot copy must be empty or must not exist.

A full hot copy in a backup set must be restored into a new archive in order to use that full hot copy to start an SM. Restoring an archive from a full hot copy in a backup set is accomplished via the NuoDB Check utility (nuochk). This will extract the full hot copy from the backup set and copy it to a new archive directory.

Prior to version 3.1, all hot copies were full hot copies. When executing a hot copy with a destinationArchiveDirectory, the type option is optional and defaults to full.

Restore an archive from a full hot copy in a backup set

Restore an archive from a backup set using NuoDB Check with the --restore-dir option.

NuoDB Check options relevant to restoring a full hot copy from a backup set.

Usage: nuochk [--repair] [--quiet] [--full] [<nuodb options>] <location>
nuochk Options are:
--restore-dir Restore into this destination directory

Examples: running full hot copy into a backup set

Running full hot copy on a single host into a backup set. This command will create the /tmp/hotcopy/2017-12-18 backup set directory. Note that the type option is full.

nuodb [test] > hotcopy database test host localhost pid 23588 backupSetDirectory /tmp/hotcopy/2017-12-18 type full

Running a coordinated full hot copy on multiple hosts into backup sets is similar. Note that while the SMs on which to perform hot copy are specified in the plan, the type full option is unchanged from the previous example.

nuodb [test] > hotcopy database test plan '{ "archives": [ { "host": "host1", "pid": "12345", "backupSetDir": "/tmp/hotcopy/2017-12-18" }, { "host": "host2", "pid": "6789", "backupSetDir": "/tmp/hotcopy/2017-12-18" } ] }' type full

If each host has the same directory structure for storing backup sets, then defaultBackupSetDir can be used to simplify the plan syntax.

nuodb [test] > hotcopy database test plan '{ "defaultBackupSetDir": "/tmp/hotcopy/2017-12-18", "archives": [ { "host": "host1", "pid": "1234" }, { "host": "host2", "pid": "5678" } ] }' type full

A plan file can also be specified instead of issuing the plan as a string. See the hotcopy command syntax reference for more details.

Example: restoring a full hot copy from a backup set

Specify the directory to copy the restored archive to with the --restore-dir option. The directory given to --restore-dir must not exist or must be empty.

Restore from the backup set created in the previous example to archive directory /tmp/restore.

$ nuochk --restore-dir /tmp/restore /tmp/hotcopy/2017-12-18