ttBackup

Creates a backup copy of a database that can be restored at a later time using the ttRestore utility.

For an overview of the TimesTen backup and restore facility, see Back Up, Restore, and Migrate Data in TimesTen Classic in Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

Required Privilege

This utility requires the ADMIN privilege.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage in TimesTen Scaleout and TimesTen Classic

This utility is supported in TimesTen Classic but not supported in TimesTen Scaleout.

Syntax

ttBackup {-h | -help | -?}
ttBackup {-V | -version}
ttBackup -dir directory [-type backupType]
[-fname fileprefix] [-force]
{-connStr connection_string | DSN} 

Options

ttBackup has the options:

Option Description

-connStr connection_string

An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.

DSN

Specifies an ODBC data source name of the database to be backed up.

-dir directory

Specifies the directory where the backup files should be stored.

-fname fileprefix

Specifies the file prefix for the backup files in the backup directory. The default value for this option is the file name portion of the DataStore parameter of the database's ODBC definition.

-force

Forces the backup into the specified directory. If a backup exists in that directory, ttBackup overwrites it. If this option is not specified, and you are creating a backup from a database other than the one previously backed up in the specified directory, ttBackup terminates with an end message without overwriting existing files.

-h -help -?

Prints a usage message and exits.

-type backupType

Specifies the type of backup to be performed. Valid values are:

fileFull (default) - Performs a full file backup to the backup path specified by the directory and fileprefix parameters. The resulting backup is not enabled for incremental backup.

fileFullEnable - Performs a full file backup to the backup path specified by the directory and fileprefix parameters. The resulting backup is enabled for incremental backup.

fileIncremental - Performs an incremental file backup to the backup path specified by the directory and fileprefix parameters, if that backup path contains an incremental-enabled backup of the database. Otherwise, an error is returned.

fileIncrOrFull - Performs an incremental file backup to the backup path specified by the directory and fileprefix parameters if that backup path contains an incremental-enabled backup of the database. Otherwise, it performs a full file backup of the database and marks it incremental enabled.

streamFull - Performs a stream backup to standard out

incrementalStop - Does not perform a backup. Disables incremental backups for the backup path specified by the directory and fileprefix parameters. This prevents transaction log files from accumulating for an incremental backup.

-V | -version

Prints the release number of ttBackup and exits.

Examples

To perform a full file backup of the FastIns database to the backup directory in/users/pat/TimesTen/backups, use:

% ttBackup -type fileFullEnable -dir /users/pat/TimesTen/backups FastIns

To copy the FastIns database to the file FastIns.back, use:

% ttBackup -type streamFull FastIns > FastIns.back

On UNIX and Linux systems, to save the FastIns database to a backup tape, use:

% ttBackup -type streamFull FastIns | dd bs=64k of=/dev/rmt0

To back up a database named origDSN to the directory /users/rob/tmp and restore it to the database named restoredDSN, use:

% ttBackup -type fileFull -dir /users/rob/tmp -fname restored origDSN
ttRestore -dir /users/rob/tmp -fname restored restoredDSN

Notes

The ttBackup utility and the ttRestore utility backup and restore databases only when the two parts of the TimesTen release and the platform are the same. For example, you can back up and restore files between TimesTen releases 22.1.1.21.0 and 22.1.1.22.0. You cannot backup and restore files between releases 11.2.2.8.35 and 18.1.2.1.0. You can use the ttBulkCp or CS (UNIX and Linux only) utility to migrate databases across major releases or operating systems.

When an incremental backup has been enabled, TimesTen creates a backup hold in the transaction log file. Call the ttLogHolds built-in procedure to see information about this hold. The backup hold determines which log records should be backed up upon subsequent incremental backups. Only changes since the last incremental backup are updated. A side effect to creating the backup hold is that it prevents transaction log files from being purged upon a checkpoint operation until the hold is advanced by performing another incremental backup or removed by disabling incremental backups.

Transactions that commit after the start of the backup operation are not reflected in the backup.

Up to one checkpoint and one backup may be active at the same time, with these limitations:

  • A backup never needs to wait for a checkpoint to complete.

  • A backup may need to wait for another backup to complete.

  • A checkpoint may need to wait for a backup to complete.

Databases containing cache groups can be backed up as normal with the ttBackup utility. However, when restoring such a backup, special consideration is required as the restored data within the cache groups may be out of date or out of sync with the data in the back end Oracle database. See the section on Backing Up and Restoring a TimesTen Classic Database with Cache Groups in Oracle TimesTen In-Memory Database Cache Guide for details.

You cannot back up temporary databases.