ASA SQL Reference
SQL Statements
Use this statement to restore a backed up database from an archive.
RESTORE DATABASE filename
FROM archive_root
[ CATALOG ONLY |
[ [ RENAME dbspace_name TO new_dbspace_name ] ...] ]
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.
Each RESTORE DATABASE operation updates a history file called backup.syb, which is a text file held in the same directory as your database server executable file.
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.
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.
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.
This statement is not supported on Windows CE.
For more information, see -gu server option.
None.
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Not supported in Adaptive Server Enterprise.
Windows CE Not supported on the Windows CE platform.
The following example restores a database from a Windows NT 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 ON, but is OFF in utility_db. When connected to any database other than utility_db, the extra backslashes are required.
RESTORE DATABASE 'd:\\dbhome\\cust.db' FROM '\\\\.\\tape0'