FirebirdSQL logo
 DATABASEDOMAIN 

Options for CREATE SHADOW

LENGTH

Specifies the maximum size of the primary or secondary shadow file in pages.The LENGTH value does not affect the size of the only shadow file, nor the last if it is a set.The last (or only) file will keep automatically growing as long as it is necessary.

STARTING AT

Specifies the shadow page number at which the next shadow file should start.The system will start adding new data to the next shadow file when the previous file is filled with data up to the specified page number.

Tip

You can verify the sizes, names and location of the shadow files by connecting to the database using isql and running the command SHOW DATABASE;

Who Can Create a Shadow

The CREATE SHADOW statement can be executed by:

docnext count = 4

Examples Using CREATE SHADOW

  1. Creating a shadow for the current database as “shadow number 1”:

    CREATE SHADOW 1 'g:\data\test.shd';
  2. Creating a multi-file shadow for the current database as “shadow number 2”:

    CREATE SHADOW 2 'g:\data\test.sh1'
      LENGTH 8000 PAGES
      FILE 'g:\data\test.sh2';

DROP SHADOW

Drops (deletes) a shadow file from the current database

Available in

DSQL, ESQL

Syntax
DROP SHADOW sh_num
  [{DELETE | PRESERVE} FILE]
Table 1. DROP SHADOW Statement Parameter
Parameter Description

sh_num

Shadow number — a positive number identifying the shadow set

The DROP SHADOW statement deletes the specified shadow for the current database.When a shadow is dropped, all files related to it are deleted and shadowing to the specified sh_num ceases.The optional DELETE FILE clause makes this behaviour explicit.On the contrary, the PRESERVE FILE clause will remove the shadow from the database, but the file itself will not be deleted.

Who Can Drop a Shadow

The DROP SHADOW statement can be executed by:

Example of DROP SHADOW

Deleting “shadow number 1”.
DROP SHADOW 1;