sp_RestoreDatabase

Advantage Concepts

Restore a data dictionary and its associated tables using a backup image from a previous call to sp_BackupDatabase.

Syntax

sp_RestoreDatabase(

SourcePath, MEMO,

SourcePassword, MEMO,

DestinationPath, MEMO,

Options, MEMO );

 

Parameters

SourcePath (I)

Path to the existing backup image, including the name of the .add file. An example SourcePath would be \\myserver\myshare\mybackupdir\mydd.add. This path can be any form recognized by the server operating system. For example, in Microsoft Windows this path can be UNC ( \\myserver\myshare\mydir ) or a local drive letter ( c:\mydir ). If using drive letters, keep in mind the drive letter must be recognized by the server machine, any drives mapped on the client executing the restore command are irrelevant. If using a drive letter for the source path, the drive must be a "local" drive, it cannot be a mapped drive.

SourcePassword (I)

Password to the dictionary specified in the SourcePath parameter.

DestinationPath (I)

Path to restore the database to, including the name of the new .add file to create. An example DestinationPath would be \\myserver\myshare\myrestoredir\mydd.add. This path can be any form recognized by the server operating system. For example, in Microsoft Windows this path can be UNC ( \\myserver\myshare\mydir ) or a local drive letter ( c:\mydir ). If using drive letters keep in mind the drive letter must be recognized by the server machine, any drives mapped on the client executing the restore command are irrelevant. Mapped network drive letters are not supported, and should not be used.

Options (I)

Options. See Backup and Restore Options for details.

 

Remarks

The sp_RestoreDatabase procedure can be used to restore a database from a backup image created with the sp_BackupDatabase procedure.

This procedure can be called from a free connection or a dictionary connection.

If you are connected to a different data dictionary you must still be logged in as the ADSSYS user (or a user in the DB:Backup group) in that database in order to call sp_BackupDatabase.

As an alternative to using this canned procedure, you can also use the command line utility adsbackup.

Result Set

See Backup and Restore Canned Procedure Result Sets

Examples

Restore a data dictionary:

EXECUTE PROCEDURE sp_RestoreDatabase(

‘\\server\share\backupdir\mydd.add’,

‘password_to_mydd’,

‘\\server\share\restoredir\mydd.add’,

NULL );

 

Restore two specific tables:

EXECUTE PROCEDURE sp_RestoreDatabase(

‘\\server\share\backupdir\mydd.add’,

‘password_to_mydd’,

‘\\server\share\restoredir\mydd.add’,

‘include=table1,table2’ );