Use the BACKUP DATABASE statement to make a server-side backup

This topic describes a backup that leaves the transaction log untouched. For information about other transaction log management options when making a backup, see BACKUP statement.

The BACKUP statement makes an entry in the text file backup.syb that is stored in the same directory as the database server executable.

Make an image backup
To make an image backup (SQL)

For information about recovering from an image backup, see Restore from an image backup.

Make an archive backup
To make an archive backup to tape (SQL)

For information about recovering from an archive backup, see Restore from an archive backup.

Examples

The following statement makes an image backup of the current database and the transaction log, saves them to different files, and renames the existing transaction log.

BACKUP DATABASE
DIRECTORY 'd:\\temp\\backup'
TRANSACTION LOG RENAME;

The following statement makes an archive backup to the first tape drive on a Windows computer:

BACKUP DATABASE
TO '\\\\.\\tape0'
ATTENDED OFF
WITH COMMENT 'May 6 backup';

The first tape drive on Windows is \\.\tape0. Because the backslash is an escape character in SQL strings, each backslash is preceded by another.

See also