Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Statements

RESIGNAL statement Next Page

RESTORE DATABASE statement


Use this statement to restore a backed up database from an archive.

Syntax

RESTORE DATABASE file-name
FROM archive-root
[ CATALOG ONLY
| [ RENAME dbspace-name TO new-dbspace-name ] ... ]
[ HISTORY { ON | OFF } ]

file-name : string | variable
archive-root : string | variable
new-dbspace-name : string | variable

Parameters

CATALOG ONLY clause    Retrieve information about the named archive, and place it in the backup history file (backup.syb), but do not restore any data from the archive.

RENAME clause    Specifies a new location to restore each dbspace to.

HISTORY clause    By default, each RESTORE DATABASE operation appends a line to the backup.syb. You can prevent updates to the backup.syb file by specifying HISTORY OFF. You may want to prevent the file from being updated if all of the following conditions apply:

Remarks

Each RESTORE DATABASE operation updates a history file called backup.syb.

For more information about the backup.syb file, see SALOGDIR environment variable.

The RENAME clause provides a way to change the restore location for each dbspace. The dbspace name in a RENAME clause cannot be SYSTEM or TRANSLOG. See Pre-defined dbspaces.

RESTORE DATABASE replaces the database that is being restored. If you need incremental backups, use the image format of the BACKUP command and save only the transaction log; however, image backups to tape are not supported.

Permissions

The permissions required to execute this statement are set on the server command line, using the -gu option. The default setting is to require DBA authority. See -gu server option.

This statement is not supported on Windows CE.

Side effects

None.

See also
Standards and compatibility
Example

The following example restores a database from a tape drive. The number of backslashes that are required depends on which database you are connected to when you execute RESTORE DATABASE. The database affects the setting of the escape_character option. It is normally set to On, but is set to Off in utility_db. When connected to any database other than utility_db, the extra backslashes are required.

RESTORE DATABASE 'd:\\dbhome\\mydatabase.db'
FROM '\\\\.\\tape0';