|
|
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, Mimer SQL Shadowing, for details on databank shadowing.
If the
ADD integer PAGESclause is specified, the shadow file is extended by the number of Mimer SQL pages given by theintegerparameter.If the
INTOclause is specified, the shadow file location stored in the data dictionary is changed to the location specified in thefilename-stringparameter. The file specified byfilename-stringmust exist when theALTER SHADOWstatement 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 Mimer SQL System Management Handbook, Databank Check Functionality, for details on the DBC functionality.
The
ALTER SHADOWstatement 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 theALTER SHADOWstatement without any verification. In this case the file is validated when the shadow is next setONLINEand theSET SHADOWstatement will fail if the file does not verify correctly against the checks performed.If the
TO MASTERclause 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 isOFFLINEwhen theTO MASTERclause is specified, it is automatically setONLINEbefore the data dictionary is updated.Restrictions
ALTER SHADOWis only for use with the optional Mimer SQL Shadowing module.Only an ident with
SHADOWprivilege may use theALTER SHADOWstatement.
ALTER SHADOWmay not be used if the master databank isOFFLINE.The
ADD integer PAGESclause may not be used if the shadow isOFFLINE.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, andLOGDBcannot be altered with theALTER SHADOWstatement. These shadows must be altered by the Mimer SQL BSQL program, see Mimer SQL System Management Handbook, 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... ADDis generally recommended (used at the same time asALTER DATABANK... ADDis used to extend the master databank).Changing the location of a shadow with the
ALTER SHADOW... INTOstatement 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 theALTER SHADOWstatement to correct the location stored in the data dictionary.The value of
filename-stringmust 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 MASTERoption 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 aDROP SHADOWcommand to dispose of the original databank.Example
The following example alters
USRDB_S, a shadow of theUSRDBdatabank, to theUSRDBmaster databank:ALTER SHADOW USRDB_S TO MASTERFor more information, see the Mimer SQL System Management Handbook, Creating and Managing Shadows.
Standard Compliance
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|