[Notes] [1.5] monitoring event notification (event Notification)

Keywords: DDL monitoring

[Notes] [1.5] monitoring event notification (event Notification)

 

[1] concept

  Event notification is a special type of database objects, used to send information about the server and database practices to Service Broker service.

  Perform event notification to respond to respond to a variety of T-SQL data definition language DDL statements and SQL Trace events take is to send information about these events to the Service Broker service.

[2] design event notification

  T-SQL statement or group of statements must define the scope of the notice, triggered event notification!

  (1) define the scope of notification:

      Users can specify event notification is a response to the statements of all the objects [sql server instance of the implementation of the current database] or [].

      Scope for Queue_activation specified time and Broker_queue_disabled event notification is limited to a single queue. All concurrent events can be executed at any scope level.

      For example Create_database event can only be performed at the server instance level.

      Instead, the time created for Alter_table notification time can be performed for all tables in the database or server instance by program.

  (2) specify the T-SQL statements or groups of statements:

      You can create the following notification response time

      Specific DDL statements, SQL Service Broker trace events or incidents. Predefined set of DDL statements or SQL Trace event group.

  (3) to select a specific DDL statements and SQL Trace triggered event notification

      After an event may be designed to perform a specific operation or T-SQL statements stored procedure, as described later in the example, the event notification alter - performed after an event table.

      A list of related trigger event notification can refer to related events, can also query sys.event_notification_event_types catalog view to obtain.

      Note, SQL Trace event can only be performed at the server instance scope.

  (4) Service Broker selected specific event triggered event notification

      Event notification can be designed to excite or after Queue_activation Broker_Queue_disabled Service Broker events.

      When there is a message queue to be processed, Queue_Activation event will occur.

      But when the queue status is set to Off, Broker_Queue_Disabled event will occur.

  (5)

 

Guess you like

Origin www.cnblogs.com/gered/p/10944007.html