Example of Invoking Hot Copy on a Storage Manager

This section provides an example of how to make a copy of a running database using hot copy. The database has a Storage Manager (SM) running on an archive with archive ID on a storage1.example.com host.

nuocmd show archives
[0] server0 : /var/opt/nuodb/production-archives/archive0 @ db [journal_path = ] [snapshot_archive_path = ] RUNNING
[SM] storage1.example.com:48006 [start_id = 0] [server_id = server0] [pid = 17737] [node_id = 1] [last_ack =  2.03] MONITORED:RUNNING

To take a full hotcopy of the database to a /tmp/sample_backup backup directory run:

$ nuocmd hotcopy database --db-name db --type full --backup-dirs 0 /tmp/sample_backup --timeout 10
HotCopyResponse(begin_timestamp=2019-06-10 11:25:44, coordinator_start_id=0, end_timestamp=2019-06-10 11:25:44, id=faa5ed2e-0a39-4cfe-b150-232566aaa70a, message=Hot copy successfully completed, status=completed)

This creates a backup set named sample_backup inside the /tmp/ directory.

/tmp
├── sample_backup
├── full
│ ├── control
│ └── data
├── state.xml
└── tmp

Now that a full backup has been taken, an incremental hotcopy can be taken. We point the backup location at the backup set:

nuocmd hotcopy database --db-name db --type incremental --backup-dirs 0 /tmp/sample_backup --timeout 10
HotCopyResponse(begin_timestamp=2019-06-06 12:02:13, coordinator_start_id=0, end_timestamp=2019-06-06 12:02:13, id=628a49db-c754-4e8b-a7f9-31e5fb7132b6, message=Hot copy successfully completed, status=completed)

This creates and populates a directory for the incremental hotcopy inside the sample_backup directory.

tree -L 3 /tmp/
/tmp/
├── sample_backup
├── 1.inc
│ ├── control
│ └── data ├── full │ ├── control
│ └── data
├── state.xml
└── tmp

Assuming the SM was started using --journal-hot-copy enable, a journal hotcopy can also be run:

nuocmd hotcopy database --db-name db --type journal --backup-dirs 0 /tmp/sample_backup --timeout 10
HotCopyResponse(begin_timestamp=2019-06-06 12:07:03, coordinator_start_id=0, end_timestamp=2019-06-06 12:07:03, id=2b3b2b40-9bfb-4ed6-85c7-2ec1fa3b0096, message=Hot copy successfully completed, status=completed)

This creates and populates a directory for the journal inside the sample_backup directory.

tree -L 3 /tmp/
/tmp/
├── sample_backup
├── 1.inc
│ ├── control
│ └── data ├── 1.jl
│ ├── control
│ └── data ├── full │ ├── control
│ └── data
├── state.xml
└── tmp