Backup and Restore Operations
Use ttGridAdmin
commands in this section to back up and restore databases, display the status of those operations, or delete a backup.
Also see Migrating, Backing Up and Restoring Data in Oracle TimesTen In-Memory Database Scaleout User's Guide.
Back Up a Database (dbBackup)
The dbBackup
command initiates a backup of the specified database.
ttGridAdmin dbBackup dbname -repository reponame [-name backupname] [-backupType normal|staged] [-bwlimit limit] [-compress value]
In some cases you must use dbExport
instead. This would be the case, for example, if the grid topology at the restore location has fewer replica sets than the backed up database, or the restore location is running a version of TimesTen that is not patch-compatible with the version of the backed up database. See Migrating, Backing Up and Restoring Data in Oracle TimesTen In-Memory Database Scaleout
User's Guide for additional information.
TimesTen Scaleout enables you to create staged backups for SCP repositories. This type of backup eliminates the overhead of creating local copies of the checkpoints and log files and reduces the WAN traffic of creating a remote copy in the repository. See Back Up a Database into a Remote Repository (WAN-Friendly) in the Oracle TimesTen In-Memory Database Scaleout User's Guide for more information.
Note:
Be aware of the following if the specified repository was created with -method scp
:
For normal backups, backup file for each element is stored on the local file system where the element is located before being copied to the remote repository.
A backup is stored as a collection under a repository. You first must create the repository. See Repository Operations.
Options
The dbBackup
command has the options:
Option | Description |
---|---|
|
Name of the database to back up. |
|
Name of the repository where the backup will be located. |
|
Specifies a name for the backup. The default is the letter "B" followed by the date and time of the backup, in the format: |
|
For repositories using the SCP method, specifies the type of backup to create. Supported options are
By default, TimesTen creates normal backups. |
|
For staged backups, specifies the aggregated maximum bandwidth (in MB per second) used to copy and synchronize files between hosts and repository. By default, staged backups use as much WAN bandwidth as possible. |
|
For staged backups, specifies the level of compression used to copy and synchronize files between hosts and repository. Supported values range from 0 to 9, where 0 represents no compression and 9 represents the maximum compression available. By default, staged backups use no compression. |
Examples
This example backs up database1
into repository repo1
. It uses the default name for the backup, according to the current timestamp (2/22/17 at 14:55:44).
% ttGridAdmin dbBackup database1 -repository repo1 dbBackup B20170222145544 started
You can then use dbBackupStatus
to check progress, as shown in the example in Display the Status of a Database Backup (dbBackupStatus). The backup is finished when each element and the database as a whole are indicated as complete.
Notes
-
The backup is performed asynchronously. Use the
dbBackupStatus
command to check progress. -
One element from each replica set is backed up.
-
Each replica set is stored as a sub-collection.
-
For disk space requirements, see Backing Up and Restoring a Database in Oracle TimesTen In-Memory Database Scaleout User's Guide.
Delete a Database Backup (dbBackupDelete)
The dbBackupDelete
command deletes the specified database backup.
ttGridAdmin dbBackupDelete -repository reponame -name backupname
Options
The dbBackupDelete
command has the options.
Option | Description |
---|---|
|
Name of the repository where the backup is located. |
|
Name of the backup to delete. |
Examples
This example deletes the backup created in the example in Back Up a Database (dbBackup).
% ttGridAdmin dbBackupDelete -repository repo1 -name B20170222145544 Backup B20170222145544 deleted
Note:
This command is typically used to delete old or failed backups.
Display the Status of a Database Backup (dbBackupStatus)
The dbBackupStatus
command shows the status of a database backup or backups previously started.
ttGridAdmin dbBackupStatus dbname [-name backupname]
Options
The dbBackupStatus
command has the options:
Option | Description |
---|---|
|
Name of the database being backed up. |
|
Name of the backup to check. The default is all backups of the specified database. |
Examples
This example shows status upon completion of the backup from the example in Back Up a Database (dbBackup).
% ttGridAdmin dbBackupStatus database1 -name B2017022245544 Database Backup Repository Host Instance Elem State Started Finished --------- --------------- --------- ----- --------- ---- --------- ---------------------- -------- database1 B20170222145544 repo1 Completed 2017-02-22T14:55:44.000Z Y host3 instance1 1 Complete host4 instance1 2 Complete host5 instance1 3 Complete
Notes
-
When you believe the backup is complete, confirm that
dbBackupStatus
shows that the backup as a whole and for each instance is shown as complete. If there were any failures, see Check the Status of a Backup in Oracle TimesTen In-Memory Database Scaleout User's Guide. -
Y
in theFinished
column indicates that the command has finished running, regardless of state—that each instance has succeeded or failed. -
The metadata associated with a database backup is deleted when the database is deleted. After a database is deleted, you can use the
repositoryList
command to see existing backups.
Restore a Database (dbRestore)
The dbRestore
command restores a database backup into a new database.
ttGridAdmin dbRestore dbname -repository reponame -name backupname
Options
The dbRestore
command has the options:
Option | Description |
---|---|
|
Name of the database to be created, then restored from the backup. |
|
Name of the repository where the backup is located. |
|
Name of the backup to use for the restore. |
Examples
This example creates and restores a database res_db1
from a backup mybkup
.
% ttGridAdmin dbRestore res_db1 -repository repo1 -name mybkup dbRestore mybkup started
You can then use dbRestoreStatus
to check progress, as shown in the example in Display the Status of a Database Restore (dbRestoreStatus). The restore is finished when each element and the database as a whole are indicated as complete.
Notes
-
This database must already be defined (with
dbdefCreate
) but not yet created. -
The restore is performed asynchronously. Use the
dbRestoreStatus
command to check progress. -
The restored database is loaded into memory when
dbRestore
completes, but not opened. -
You can restore to the original database definition or to a newly created database definition.
-
You cannot restore to a database with fewer replica sets than what was backed up. (If the number of data instances on hosts in each data space group is not sufficient to support the number of replica sets in the database that was backed up, you must use
dbExport
anddbImport
instead.) -
If you restore to a database with more replica sets than what was backed up, only the number of replica sets that were backed up will be added to the database distribution map. For example, if you back up a database with two replica sets and restore to a database with four replica sets, only the elements in two replica sets will be added to the distribution map. You would then have to redistribute data with
dbDistribute
to get four replica sets. -
For disk space requirements, see Backing Up and Restoring a Database in Oracle TimesTen In-Memory Database Scaleout User's Guide.
Display the Status of a Database Restore (dbRestoreStatus)
The dbRestoreStatus
command shows the status of a database restore previously started.
ttGridAdmin dbRestoreStatus dbname
Options
The dbRestoreStatus
command has the option:
Option | Description |
---|---|
|
Name of the database where the restore is being checked. |
Examples
This example shows status upon completion of the restore from the example in Restore a Database (dbRestore).
% ttGridAdmin dbRestoreStatus res_db Database Restore Repository Host Instance Elem State Started Finished -------- ------- ---------- ----- --------- ---- ------------------------------------------------ - res_db1 mybkup repo1 Restore_Finale_Complete 2017-03-03T13:19:39.000Z Y host3 instance1 Restore_Instance_Complete host4 instance1 Restore_Instance_Complete host5 instance1 Restore_Finale_Complete
Notes
-
When you believe the restore is complete, confirm that
dbRestoreStatus
showsRestore_Finale_Complete
for the restore as a whole andResore_Instance_Complete
orRestore_Finale_Complete
for each instance. If there were any failures, see Check the Status of a Restore in Oracle TimesTen In-Memory Database Scaleout User's Guide. -
Y
in theFinished
column indicates that the command has finished running, regardless of state—that each instance has succeeded or failed.