none
資料庫鏡像FailOver的Notification RRS feed

  • 一般討論

  • Dears!

    客戶的環境使用的是SQL Server 2005 SP4

    而我們有找到「http://technet.microsoft.com/library/Cc966392#XSLTsection129121120120」這一篇內容,但是內容有點長所以看不是很懂

    想請教各位一下,如果資料庫鏡像發生AutoFailOver時的發送Email通知設定應該如何做呢?

    感謝 :-)

    PS.環境中共有三台SQL Server,分別擔任Principle、Mirror和Witness角色
    • 已編輯 DannyLee 2014年1月3日 上午 07:22
    • 已變更類型 ricoismeModerator 2014年1月3日 下午 01:47 提問者自行解決
    2014年1月3日 上午 07:17

所有回覆

  • 看到有Script Sample - Record Database Mirroring State Changes,可以查询Mirroring State 的状况然后用DB Mail发邮件。

    或者用Alert,Creating Alerts Based on State Change Events

    You can define alerts on these events using SQL Server Agent or any application that detects WMI events, such as Microsoft Operations Manager. Figure 3 shows the dialog box you use to create a SQL Server Agent alert in Management Studio.

    Cc966392.29317_figure3(en-us,TechNet.10).jpg

    Figure 3:  Alert Properties Dialog Box showing a WMI-based alert.

    To create an alert using SQL Server Agent, do the following:

    1. In Management Studio, connect to the principal or mirror server instance on which you want to define an alert.

    2. Expand the SQL Server Agent folder in Object Explorer.

    3. Right-click Alerts and click New Alert.

    4. In the New Alert dialog box, type the name of the alert.

    5. In the Type list, select WMI event alert. The dialog box then changes to show the relevant properties. The WMI namespace for the current server instance event is entered automatically.

    6. In the Query box, enter a query that selects the events on which you want to alert. See below for a discussion of how this query can be written.

    7. In Select a page, click Response to specify the actions to take when the event occurs, such as executing a job or notifying an operator.

    8. In Select a page, click Options to specify how often to send a notification on this event, the format of the message sent to operators, and other options.


    Please Mark As Answer if it is helpful.

    2014年1月3日 上午 08:47
  • 看到有Script Sample - Record Database Mirroring State Changes,可以查询Mirroring State 的状况然后用DB Mail发邮件。

    或者用Alert,Creating Alerts Based on State Change Events

    You can define alerts on these events using SQL Server Agent or any application that detects WMI events, such as Microsoft Operations Manager. Figure 3 shows the dialog box you use to create a SQL Server Agent alert in Management Studio.

    Cc966392.29317_figure3(en-us,TechNet.10).jpg

    Figure 3:  Alert Properties Dialog Box showing a WMI-based alert.

    To create an alert using SQL Server Agent, do the following:

    1. In Management Studio, connect to the principal or mirror server instance on which you want to define an alert.

    2. Expand the SQL Server Agent folder in Object Explorer.

    3. Right-click Alerts and click New Alert.

    4. In the New Alert dialog box, type the name of the alert.

    5. In the Type list, select WMI event alert. The dialog box then changes to show the relevant properties. The WMI namespace for the current server instance event is entered automatically.

    6. In the Query box, enter a query that selects the events on which you want to alert. See below for a discussion of how this query can be written.

    7. In Select a page, click Response to specify the actions to take when the event occurs, such as executing a job or notifying an operator.

    8. In Select a page, click Options to specify how often to send a notification on this event, the format of the message sent to operators, and other options.


    Please Mark As Answer if it is helpful.

    我們這邊一直測試不出來您說的這種Solution,所以退而求其次改用下面的Solution

    使用Windows 事件檢視器對特定事件觸發管理動作

    感謝您的回覆!

    2014年1月3日 上午 09:58