BACKUP DATABASE

From Lianjapedia
Jump to: navigation, search

Purpose

Creates a database backup

Syntax

BACKUP DATABASE [<database name>]

See Also

ADATABASES(), ADD TABLE, ALTER INDEX, ALTER TABLE, CHECK DATABASE, CHECK TABLE, CLOSE DATABASES, CLOSE TABLES, COMPARE DATABASE, COMPILE DATABASE, COPY DATABASE, CREATE DATABASE, CREATE INDEX, CREATE TABLE, CREATE VIEW, DATABASE(), DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), INDEX, LIST BACKUPS, LIST DATABASE, LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, PACK, PACK DATABASE, REBUILD DATABASE, REINDEX DATABASE, RESTORE DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE

Description

The BACKUP DATABASE command creates a backup of the active or specified database. This is the equivalent of the 'Backup...' menu option from the Additional Commands or Context Menu in the Data Workspace.

The backup is created under the backups sub-directory of the data directory by year, month, day and time.

If the <database name> is not specified, BACKUP DATABASE operates on the currently open database, otherwise the specified database.

Databases are opened using the OPEN DATABASE command. The backup created can be restored using the RESTORE DATABASE command. Available backups can be displayed using the LIST BACKUPS command.

Example

open database southwind
backup database
close databases
backup database southwind
list backups
restore database southwind