Difference between revisions of "BACKUP DATABASE"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Creates a database backup ==Syntax== BACKUP DATABASE [<database name>] ==See Also== ADATABASES(), ADD TABLE, ALTER INDEX, ALTER TABLE, CHECK DA...")
 
(See Also)
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
==See Also==
 
==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]], [[REINDEX DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]
+
[[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]], [[SQL USE|USE]]
  
 
==Description==
 
==Description==
The BACKUP DATABASE command creates a backup of the active or specified database.  This is the equivalent of the menu option from the [[Data_Files#Additional_Commands|Additional Commands]] or [[Data_Files#Context_Menu|Context Menu]] in the Data Workspace.
+
The BACKUP DATABASE command creates a backup of the active or specified database.  This is the equivalent of the 'Backup...' menu option from the [[Data_Files#Additional_Commands|Additional Commands]] or [[Data_Files#Context_Menu|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.
 
The backup is created under the backups sub-directory of the data directory by year, month, day and time.
Line 21: Line 21:
 
open database southwind
 
open database southwind
 
backup database
 
backup database
close database
+
close databases
 
backup database southwind
 
backup database southwind
 
list backups
 
list backups

Latest revision as of 07:05, 30 March 2022

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