Difference between revisions of "BACKUP DATABASE"

From Recital Documentation Wiki
Jump to: navigation, search
 
(Description)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=REBUILD DATABASE=
 
 
 
==Class==
 
Databases
 
 
 
 
==Purpose==
 
==Purpose==
Rebuilds a database catalog
+
Exports bridge, table, and associated files from the current or specified database in ASCII format to allow them to be transferred to a binary incompatible platform
  
  
 
==Syntax==
 
==Syntax==
REBUILD DATABASE [<database name> | ?]
+
BACKUP DATABASE [<database name> | ?]
  
  
 
==See Also==
 
==See Also==
[[ADATABASES()]], [[ADD TABLE]], [[ALTER INDEX]], [[ALTER TABLE]], [[BACKUP DATABASE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DATABASE()]], [[DB_DATADIR]], [[DB_MAXWKA]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[INDEX]], [[LIST DATABASE]], [[LIST INDEXES]], [[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]], [[BUILD]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[Configuration Files]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DATABASE()]], [[DB_BACKUPDIR]], [[DB_DATADIR]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[INSTALL]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST SCHEMAS]], [[LIST TABLES]], [[OPEN DATABASE]], [[PACK DATABASE]], [[REBUILD DATABASE]], [[REINDEX DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]
  
  
 
==Description==
 
==Description==
The REBUILD DATABASE command rebuilds the catalog for the active or specified database.  This packs the catalog file and rebuilds its index tags.  All valid programs, tables and known associated indexes from the database's directory are added into the catalog.
+
The BACKUP DATABASE command issues a BUILD on the bridge files, tables and associated memo, dictionary and multiple index files from the currently open database or specified database.  This exports these files into ASCII format to allow them to be transferred to a binary incompatible platform.
  
Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database.  Operating System file protection can be applied individually to the files for added security.  The directories are sub-directories of the Recital data directory.  The environment variable / symbol DB_DATADIR points to the current Recital data directory and can be queried using the GETENV() function.  Files from other directories can be added to the database using the ADD TABLE command or via the database catalog and SET AUTOCATALOG functionality. Databases are opened using the SQL OPEN DATABASE command. 
+
Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database.  Operating System file protection can be applied individually to the files for added security.  The directories are sub-directories of the Recital data directory.  The environment variable DB_DATADIR points to the current Recital data directory and can be queried using the GETENV() function.  Files from other directories can be added to the database using the ADD TABLE command or via the database catalog and SET AUTOCATALOG functionality.
  
If the question mark, '?', is included instead of the <database name>, the 'SELECT A FILE' dialog will be displayed, allowing the user to select the database.  The dialog defaults to the DB_DATADIR directory.  This is only applicable for Recital Terminal Developer: for Recital Database and Mirage Servers, the <database name> must be specified.
+
If the <database name> is omitted, the BACKUP DATABASE command will operate on the active database.  If no database is currently open, an error will be returned.  If the question mark, '?', is included instead of the <database name>, the 'SELECT A FILE' dialog will be displayed, allowing the user to select a database.  The dialog defaults to the DB_DATADIR directory.  This is only applicable for Recital: for Recital Server, the <database name> must be specified if the required database is not already open.
  
 +
The ASCII files are created in a sub-directory of the Recital backup directory.  The environment variable / symbol DB_BACKUPDIR points to the current Recital backup directory and can be queried using the GETENV() function.  The sub-directory is created automatically and has the same name as the database.  If the sub-directory already exists, any files it previously contained are deleted.  Once the BACKUP DATABASE has completed successfully, the sub-directory and its contents can be copied to the DB_BACKUPDIR directory on another platform and the database recreated using the RESTORE DATABASE command.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
VFP/SQL>open database southwind
+
// On Source machine:
VFP/SQL> rebuild database
+
backup database southwind
VFP/SQL>close databases
+
 
VFP/SQL> rebuild database southwind
+
// Transfer southwind sub-directory from DB_BACKUPDIR on source machine
VFP/SQL> rebuild database ?
+
// to DB_BACKUPDIR on target machine
 +
 
 +
// On Target Machine
 +
restore database southwind
 
</code>
 
</code>
  
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Databases]]
 +
[[Category:Databases Commands]]

Latest revision as of 09:21, 11 October 2010

Purpose

Exports bridge, table, and associated files from the current or specified database in ASCII format to allow them to be transferred to a binary incompatible platform


Syntax

BACKUP DATABASE [<database name> | ?]


See Also

ADATABASES(), ADD TABLE, ALTER INDEX, ALTER TABLE, BUILD, CLOSE TABLES, COMPILE DATABASE, Configuration Files, COPY DATABASE, CREATE DATABASE, CREATE TABLE, CREATE INDEX, CREATE VIEW, DATABASE(), DB_BACKUPDIR, DB_DATADIR, DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), INSTALL, LIST DATABASE, LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, PACK DATABASE, REBUILD DATABASE, REINDEX DATABASE, RESTORE DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE


Description

The BACKUP DATABASE command issues a BUILD on the bridge files, tables and associated memo, dictionary and multiple index files from the currently open database or specified database. This exports these files into ASCII format to allow them to be transferred to a binary incompatible platform.

Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database. Operating System file protection can be applied individually to the files for added security. The directories are sub-directories of the Recital data directory. The environment variable DB_DATADIR points to the current Recital data directory and can be queried using the GETENV() function. Files from other directories can be added to the database using the ADD TABLE command or via the database catalog and SET AUTOCATALOG functionality.

If the <database name> is omitted, the BACKUP DATABASE command will operate on the active database. If no database is currently open, an error will be returned. If the question mark, '?', is included instead of the <database name>, the 'SELECT A FILE' dialog will be displayed, allowing the user to select a database. The dialog defaults to the DB_DATADIR directory. This is only applicable for Recital: for Recital Server, the <database name> must be specified if the required database is not already open.

The ASCII files are created in a sub-directory of the Recital backup directory. The environment variable / symbol DB_BACKUPDIR points to the current Recital backup directory and can be queried using the GETENV() function. The sub-directory is created automatically and has the same name as the database. If the sub-directory already exists, any files it previously contained are deleted. Once the BACKUP DATABASE has completed successfully, the sub-directory and its contents can be copied to the DB_BACKUPDIR directory on another platform and the database recreated using the RESTORE DATABASE command.

Example

// On Source machine:
backup database southwind
 
// Transfer southwind sub-directory from DB_BACKUPDIR on source machine
// to DB_BACKUPDIR on target machine
 
// On Target Machine
restore database southwind


Products

Recital Server, Recital