Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » SQL Anywhere High Availability » Introduction to database mirroring

Database mirroring and transaction log files Next Page

Database mirroring system events

The following system events are supported for database mirroring:

Events are not fired on a server that is currently acting as the mirror server. As well, mirroring events cannot be defined to execute on an arbiter, since events only run in the context of the database in which they are defined, and the arbiter does not use a copy of the database being mirrored.

You can use these events as a mechanism to send notification via email that action may be required on the mirror database. These events may not fire in all situations that result in the database running on the primary server becoming unavailable. For example, a power outage affecting both the primary and mirror servers would prevent either of these events from being fired. If this type of monitoring is required, it can be implemented on a separate computer via a scripting language by calling dbping to periodically connect to the mirror database. See Ping utility (dbping).

The following example creates an event that notifies an administrator when failover occurs:

CREATE EVENT mirror_server_unavailable
TYPE  MirrorServerDisconnect 
 CALL xp_startmail ( mail_user ='George Smith',
                     mail_password ='mypwd' );
 CALL xp_sendmail( recipient='DBAdmin',
    subject='Database failover occurred',
    "message"='The following server is unavailable in the mirroring system: '
    || EVENT_PARAMETER( 'MirrorServerName' ) );
 CALL xp_stopmail ( );