Alters the file location or the size of a shadow, or switches a databank shadow to be the master databank.
Usage
Embedded, Interactive, Module, ODBC, JDBC.
Description
Alters an existing databank shadow, see the Mimer SQL Programmer's Manual, Mimer SQL Shadowing, for details on databank shadowing.
If the ADD integer PAGES clause is specified, the shadow file is extended by the number of Mimer SQL pages given by the integer parameter.
If the INTO clause is specified, the shadow file location stored in the data dictionary is changed to the location specified in the filename-string parameter. The file specified by filename-string must exist when the ALTER SHADOW statement is executed.
The new file must be identifiable as a copy of the databank shadow created for the current Mimer SQL database. The first page of the databank file is read to verify that it was closed correctly the last time it was used and that the internal timestamp information is consistent with the current contents of LOGDB.
If the file is flagged internally as not being closed correctly, a full databank check is effectively done on it, see the System Management Manual, Databank Check Functionality, for details on the DBC functionality.
The ALTER SHADOW statement will fail if the new file does not verify correctly against the checks performed.
If the shadow is OFFLINE, however, the new file will be accepted by the ALTER SHADOW statement without any verification. In this case the file is validated when the shadow is next set ONLINE and the SET SHADOW statement will fail if the file does not verify correctly against the checks performed.
If the TO MASTER clause is specified, the data dictionary is changed so that the file location stored for the shadow file is set for the databank file and vice versa, i.e. the shadow becomes the master and the master becomes a shadow. If the shadow is OFFLINE when the TO MASTER clause is specified, it is automatically set ONLINE before the data dictionary is updated.
Restrictions
ALTER SHADOW is only for use with the optional Mimer SQL Shadowing module.
Only an ident with SHADOW privilege may use the ALTER SHADOW statement.
ALTER SHADOW may not be used if the master databank is OFFLINE.
The ADD integer PAGES clause may not be used if the shadow is OFFLINE.
The databank for which the shadow exists cannot be used by any other user while the shadow is being altered.
Shadows for the system databanks SYSDB, TRANSDB and LOGDB cannot be altered with the ALTER SHADOW statement. These shadows must be altered by the Mimer SQL BSQL program, see System Management Manual, Restoring System Databanks.
Notes
If the extension of the shadow exceeds the available disk space, the shadow is expanded as much as possible.
A shadow will be extended automatically in systems supporting dynamic file extension (provided that there is space on the disk). However, such incremental extensions may lead to the file becoming fragmented and use of explicit ALTER SHADOW… ADD is generally recommended (used at the same time as ALTER DATABANK… ADD is used to extend the master databank).
Changing the location of a shadow with the ALTER SHADOW… INTO statement only changes the location as stored in the data dictionary, it does not move any physical files in the host operating system. You must first copy or move the shadow file to its new location using operating system commands and then use the ALTER SHADOW statement to correct the location stored in the data dictionary.
The value of filename-string must always be enclosed in string delimiters. The maximum length of the filename string is 256 characters.
Refer to Specifying the Location of User Databanks for details concerning the specification of path name components in filename-string.
The TO MASTER option is used when the original databank file has been lost or is inaccessible for any reason. Since this option swaps the information about the shadow and the master databank stored in the data dictionary, the command may be followed by a DROP SHADOW command to dispose of the original databank.
Example
The following example alters USRDB_S, a shadow of the USRDB databank, to the USRDB master databank:
ALTER SHADOW USRDB_S TO MASTER
For more information, see the System Management Manual, Creating and Managing Shadows.
Standard Compliance
Standard |
Compliance |
Comments |
---|---|---|
|
Mimer SQL extension |
The ALTER SHADOW statement is a Mimer SQL extension. |