RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysMirrors Class

Provides the column names of the system table SYS.MIRRORS.

Pascal
SysMirrors = class;
C++
class SysMirrors;

SysMirrors.cs

Provides the column names of the system table SYS.MIRRORS. In addition to providing the column names for the system table SYS.MIRRORS, the same column names should be used to create a property string for the built-in stored procedures DB_ADMIN.CREATE_MIRROR and DB_ADMIN.ALTER_MIRROR. The columns of the system table SYS.MIRRORS are:

Column 
Description 
ID  
This is assigned a unique value when a mirror is first created. Although a mirror's name can be changed, its ID can never be changed. If a mirror definition is deleted, its ID is not reused by mirrors created afterwards.  
NAME  
Unique name for this mirror.  
TYPE  
Type of mirror. This can only be set to one of the values in MirrorTypes.  
HOST  
The host computer name that this mirror can be accessed from. This is needed for remotely connecting to this mirror.  
PORT  
The port of computer through which this mirror can be accessed. This is needed for remotely connecting to this mirror. Defaults to DataStoreServer.DEFAULT_PORT.  
FILE_NAME  
The file name for this mirror located on the HOST computer  
AUTO_FAIL_OVER  
This boolean property can be set to true for READONLY and PRIMARY mirrors.
When a READONLY mirror has this property set to true, all write transactions are guaranteed to be durable on this mirror and the PRIMARY mirror. This allows one of the READONLY mirrors with this property setting to automatically become the PRIMARY mirror if the existing PRIMARY mirror should fail. It is useful to set this property to true for a PRIMARY mirror, so that if the PRIMARY mirror fails and another mirror automatically becomes the PRIMARY, the old PRIMARY knows to assume the role of a READONLY mirror with the AUTO_FAIL_OVER option enabled.
To prevent more than one PRIMARY mirror existing at one time, a majority of the mirrors that have the AUTO_FAIL_OVER column set to true must be attachable (connected to). This implies that 3 or more mirrors must be configured with the AUTO_FAIL_OVER column set to true. In addition, a PRIMARY mirror does not allow transactions to start or commit if the log records for such a transaction cannot be durably written to a majority of AUTO_FAIL_OVER mirrors. The combination of these two rules are needed to prevent automatic fail over from allowing two primary mirrors to simultaneously accept write transactions. Automatic fail over will also be disabled if a majority of AUTO_FAIL_OVER mirrors do not have the same contents for the SYS.MIRRORS table. This can happen even if the AUTO_FAIL_OVER mirrors have the most recent log records from the PRIMARY mirror. Whenever the contents of the SYS.MIRRORS table are changed, an attempt is made to synchronize all mirrors. If a mirror is off line it will not be synchronized and the DB_ADMIN.SYNCH_MIRROR method needs to be called when that mirror is brought back on online.
Note that in the situation where a majority of AUTO_FAIL_OVER mirrors cannot be attached to by the PRIMARY mirror, the PRIMARY mirror can be made writable by setting the AUTO_FAIL_OVER column to false for the PRIMARY mirror. This disables automatic fail over for the PRIMARY mirror.
When a client's connection begins to encounter network errors indicating that the PRIMARY server has failed or there is a network failure, the client initiates an automatic fail over process when its failed transaction is rolled back. This process starts off by connecting to one of the READONLY mirrors with AUTO_FAIL_OVER set to true that has the lowest value in its FAIL_OVER_PRIORITY column. The highest priority mirror is asked to become the new PRIMARY mirror. If two mirrors have the same priority, then the ID column is used as the tie breaker. Again, this only succeeds if the PRIMARY candidate can connect to a majority of other AUTO_FAIL_OVER mirrors that have also lost their connection with the existing PRIMARY mirror.  
FAIL_OVER_PRIORITY  
Mirrors with a higher priority are chosen for fail over before mirrors with a lower priority setting.  
INSTANT_SYNCH  
This causes a mirror to have all log records of committed transactions. These mirrors can slow down the write performance of applications, since no transaction can commit until all of the INSTANT_SYNCH mirrors have made the transaction durable. INSTANT_SYNCH is automatically set to true if AUTO_FAIL_OVER is set to true. However, INSTANT_SYNCH can be enabled without enabling AUTO_FAIL_OVER.
Note that this setting only causes the mirror's log files to be updated with the committed log records from the primary mirror. The database does not reflect these changes until these log records have been replayed by calling the DB_ADMIN.SYNCH_MIRROR method.  
SYNCH_MIRROR_NAME  
The name of another mirror that this mirror is synchronized from. This can only be set to one of the NAME column values of another mirror in the SYS.MIRRORS table. Mirrors with AUTO_FAIL_OVER do not need to specify a value for this column, since they always synchronize with the primary mirror. Mirrors with either INSTANT_SYNCH or AUTO_FAIL_OVER set to true have their log files kept in sync with their sync mirror on all commit/rollback operations. However the log files are only replayed when DB_ADMIN.SYNCH_MIRROR method is called.  
BIRTH_STAMP  
Birth stamp used by the primary mirror that this mirror is owned by.  
LAST_KNOWN_REPLAY  
Last known replay address for this mirror. Used internally to determine if old log files can be dropped.  
CLIENT_HASH_CODE  
Unique client side hash code.  
VALIDATED_PRIMARY  
Only meaningful for mirror configurations that have enabled automatic fail over. When set to true, this indicates that this mirror has been verified as the primary mirror and can accept write transactions.  

 

DB_ADMIN 

ALTER_MIRROR 

CREATE_MIRROR 

SYNCH_MIRROR

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!