Difference between revisions of "PACK DATABASE"

From Recital Documentation Wiki
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Databases
 
 
 
 
==Purpose==
 
==Purpose==
 
Packs each table in the active database or packs the catalog and rebuilds the catalog index tags for a specified database
 
Packs each table in the active database or packs the catalog and rebuilds the catalog index tags for a specified database
Line 12: Line 8:
  
 
==See Also==
 
==See Also==
[[ADATABASES()]], [[ALTER INDEX]], [[ALTER TABLE]], [[BACKUP DATABASE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[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]], [[REBUILD DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]  
+
[[ADATABASES()]], [[ALTER INDEX]], [[ALTER TABLE]], [[BACKUP DATABASE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[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]], [[REBUILD DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]  
  
  
Line 18: Line 14:
 
The PACK DATABASE command packs all the tables in the active database.  Packing a table removes all records previously marked for deletion from the table.
 
The PACK DATABASE command packs all the tables in the active database.  Packing a table removes all records previously marked for deletion from the table.
  
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 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 OPEN DATABASE command.
  
 
If the <database name> is specified, the PACK DATABASE command will operate on the specified database's catalog file: the catalog file will be packed and its index tags rebuilt using INDEX ON.  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.
 
If the <database name> is specified, the PACK DATABASE command will operate on the specified database's catalog file: the catalog file will be packed and its index tags rebuilt using INDEX ON.  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.
Line 25: Line 21:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
VFP/SQL>open database southwind
+
open database southwind
VFP/SQL>pack database
+
pack database
VFP/SQL>close databases
+
close databases
VFP/SQL>pack database southwind
+
pack database southwind
 
</code>
 
</code>
  
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Latest revision as of 17:29, 22 December 2009

Purpose

Packs each table in the active database or packs the catalog and rebuilds the catalog index tags for a specified database


Syntax

PACK DATABASE [<database name> | ?]


See Also

ADATABASES(), ALTER INDEX, ALTER TABLE, BACKUP DATABASE, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, COPY DATABASE, CREATE DATABASE, CREATE TABLE, CREATE INDEX, CREATE VIEW, 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, REBUILD DATABASE, RESTORE DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE


Description

The PACK DATABASE command packs all the tables in the active database. Packing a table removes all records previously marked for deletion from the table.

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 OPEN DATABASE command.

If the <database name> is specified, the PACK DATABASE command will operate on the specified database's catalog file: the catalog file will be packed and its index tags rebuilt using INDEX ON. 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.


Example

open database southwind
pack database
close databases
pack database southwind


Products

Recital Server, Recital