ttRestore

Description

Restores a database specified by the connection string from a backup that has been created using the ttBackup C function or ttBackup utility. If the database already exists, ttRestore does not overwrite it.

Also see ttRestore in Oracle TimesTen In-Memory Database Reference.

Required Privilege

Instance administrator

Syntax

ttRestore (ttUtilHandle handle, const char* connStr, 
           ttRestoreType type, const char* backupDir, 
           const char* baseName, ttUtFileHandle stream,
           unsigned intflags)

Parameters

Parameter Type Description

handle

ttUtilHandle

Specifies the TimesTen utility library environment handle allocated using ttUtilAllocEnv.

connStr

const char*

This is a null-terminated string specifying a connection string that describes the database to be restored.

type

ttRestoreType

Indicates whether the database is to be restored from a file or a stream backup. Valid values are the following:

  • TT_RESTORE_FILE: The database is to be restored from a file backup located at the backup path specified by the backupDir and baseName parameters.

  • TT_RESTORE_STREAM: The database is to be restored from a stream backup read from the given stream.

backupDir

const char*

For TT_RESTORE_FILE, specifies the directory where the backup files are stored.

For TT_RESTORE_STREAM, this parameter is ignored.

baseName

const char*

For TT_RESTORE_FILE, specifies the file prefix for the backup files in the backup directory specified by the backupDir parameter.

If NULL is specified, the file prefix for the backup files is the file name portion of the DataStore attribute of the database ODBC definition.

For TT_RESTORE_STREAM, this parameter is ignored.

stream

ttUtFileHandle

For TT_RESTORE_STREAM, specifies the stream from which the backup is to be read.

On Linux or UNIX, it is an integer file descriptor that can be read from using read(2). Pass 0 to read the backup from stdin.

On Windows, it is a handle that can be read from using ReadFile. Pass the result of GetStdHandle(STD_INPUT_HANDLE) to read from the standard input.

For TT_RESTORE_FILE, this parameter is ignored. The application can pass TTUTIL_INVALID_FILE_HANDLE for this parameter.

flags

unsigned int

This is reserved for future use. Set it to 0.

See Also