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

SQL Anywhere 11.0.0 » SQL Anywhere Server - Database Administration » Maintaining Your Database » Automating tasks using schedules and events » Schedule and event internals


How the database server checks for system events

System events are classified according to their event type, as specified directly in the CREATE EVENT statement or using Sybase Central. There are two kinds of event types:

  • Active event types   Some event types are the result of action by the database server itself. These active event types include growing database files, or the start and end of different database actions (BackupEnd and so on) or RAISERROR.

    When the database server takes the action, it checks to see whether the trigger conditions defined in the WHERE clause are satisfied, and if so, triggers any events defined for that event type.

  • Polled event types   Some event types are not triggered solely by database actions. The free disk space types (DBDiskSpace and so on), as well as the IdleTime type, are examples.

    For these types of events, the database server polls every thirty seconds, starting approximately thirty seconds after the database server is started.

    For the IdleTime event type, the database server checks whether the server has been idle for the entire thirty seconds. If no requests have started and none are currently active, it adds the idle check interval time in seconds to the idle time total; otherwise, the idle time total is reset to 0. The value for IdleTime is therefore always a multiple of thirty seconds. When IdleTime is greater than the interval specified in the trigger condition, event handlers associated with IdleTime are fired.