Difference between revisions of "REBUILD DATABASE"

From Recital Documentation Wiki
Jump to: navigation, search
(Example)
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:
  
 
==See Also==
 
==See Also==
[[ADATABASES()]], [[ADD TABLE]], [[ALTER INDEX]], [[ALTER TABLE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DATABASE()]], [[DB_DATADIR]], [[DB_MAXWKA]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[INDEX]], [[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]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE INDEX]], [[CREATE TABLE]], [[CREATE VIEW]], [[DATABASE()]], [[DB_DATADIR]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[INDEX]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST SCHEMAS]], [[LIST TABLES]], [[OPEN DATABASE]], [[PACK]], [[PACK DATABASE]], [[REINDEX DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]
  
  
Line 14: Line 14:
 
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 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.
  
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.  Databases are opened using the SQL OPEN DATABASE command.   
  
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 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: for Recital Server, the <database name> must be specified.
  
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
VFP/SQL>open database southwind
+
open database southwind
VFP/SQL> rebuild database
+
rebuild database
VFP/SQL>close databases
+
close database
VFP/SQL> rebuild database southwind
+
rebuild database southwind
VFP/SQL> rebuild database ?
+
rebuild database ?
 
</code>
 
</code>
 
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]

Latest revision as of 11:37, 16 December 2009

Purpose

Rebuilds a database catalog


Syntax

REBUILD DATABASE [<database name> | ?]


See Also

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


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.

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. Databases are opened using the SQL OPEN DATABASE command.

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: for Recital Server, the <database name> must be specified.


Example

open database southwind
rebuild database
close database
rebuild database southwind
rebuild database ?

Products

Recital Server, Recital