Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site

http://developer.mimer.com


ALTER SHADOW


Alters the file location or the size of a shadow, or switches a databank shadow to be the master databank.

Usage

Embedded/Interactive/ODBC/JDBC.

Description

Alters an existing databank shadow, see the Mimer SQL Programmer's Manual, chapter 9, Mimer SQL Shadowing, for details on databank shadowing.

If the ADD... 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 DBC check is effectively done on it, see the Mimer SQL Systmen Management Handbook, chapter 6, 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... 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 UTIL program.

Notes

If the extension of the shadow exceeds the available disk space, the shadow is expanded as much as possible.

If a shadow is full, it 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.

Note that the ALTER SHADOW... TO MASTER and DROP SHADOW commands used together are equivalent to transforming a shadow into a master using the Shadowing utilities in the UTIL program, see the Mimer SQL Systmen Management Handbook, chapter 9, Mimer SQL Shadowing.

Example

The following example alters SYSDB_S, a shadow of the SYSDB databank, to the SYSDB master databank:

 ALTER SHADOW SYSDB_S TO MASTER  
 

For more information, see the Mimer SQL Systmen Management Handbook, chapter 9, Creating and Managing Shadows.

Standard Compliance

Standard
Compliance
Comments
X/Open-95
SQL-92
MIMER EXTENSION
The ALTER SHADOW statement is a Mimer SQL extension.



Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL Documentation TOC PREV NEXT INDEX