欢迎来到天天文库
浏览记录
ID:34725891
大小:113.41 KB
页数:10页
时间:2019-03-10
《sqlserver2008中远程servicebroker实现》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、SQLServer2008中远程ServiceBroker实现本文将通过实例演示如何进行ServiceBroker远程通信。以下是实现远程ServiceBroker的基本步骤:一、启用传输安全二、启用对话安全三、创建路由四、创建远程服务绑定下图显示的是两个SQLServer实例间的ServiceBroker网络通信的高级视图。预备工作/************************************************************/------远程ServiceBroker------3w@live.cn-----源服务器实例,在本例中为ap4
2、agronet09USEmasterGO--EnableServiceBrokerforthedatabaseALTERDATABASEBookStoreSETENABLE_BROKERGOALTERDATABASEBookStoreSETTRUSTWORTHYONGOUSEBookStoreGO--CreatethemessagesCREATEMESSAGETYPE[//SackConsulting/SendBookOrder]VALIDATION=WELL_FORMED_XMLGOCREATEMESSAGETYPE[//SackConsulting/BookOr
3、derReceived]VALIDATION=WELL_FORMED_XMLGO--CreatethecontractCREATECONTRACT[//SackConsulting/BookOrderContract]([//SackConsulting/SendBookOrder]SENTBYINITIATOR,[//SackConsulting/BookOrderReceived]SENTBYTARGET)GO--CreatethequeueCREATEQUEUEBookStoreQueueWITHSTATUS=ONGO--CreatetheserviceCREA
4、TESERVICE[//SackConsulting/BookOrderService]ONQUEUEdbo.BookStoreQueue([//SackConsulting/BookOrderContract])GO-----目标服务器实例,在本例中为ap2agronetserverUSEmasterGOIFNOTEXISTS(SELECTnameFROMsys.databasesWHEREname='BookDistribution')CREATEDATABASEBookDistributionGO--EnableServiceBrokerforthedatab
5、aseALTERDATABASEBookDistributionSETENABLE_BROKERGOALTERDATABASEBookDistributionSETTRUSTWORTHYONGOUSEBookDistributionGO--CreatethemessagesCREATEMESSAGETYPE[//SackConsulting/SendBookOrder]VALIDATION=WELL_FORMED_XMLGOCREATEMESSAGETYPE[//SackConsulting/BookOrderReceived]VALIDATION=WELL_FORM
6、ED_XMLGO--CreatethecontractCREATECONTRACT[//SackConsulting/BookOrderContract]([//SackConsulting/SendBookOrder]SENTBYINITIATOR,[//SackConsulting/BookOrderReceived]SENTBYTARGET)GO--CreatethequeueCREATEQUEUEBookDistributionQueueWITHSTATUS=ONGO--CreatetheserviceCREATESERVICE[//SackConsultin
7、g/BookDistributionService]ONQUEUEdbo.BookDistributionQueue([//SackConsulting/BookOrderContract])GO一、启用传输安全在ServiceBroker的安全传输,是指两个SQLServer实例之间进行网络连接时,启用或限制它们之间的加密通信。传输安全是在SQLServer实例级别,因此这个示例演示如何创建在两个SQLServer实例的主数据库对象。您可以选择两种形式的运输安全:Windows身份验证或基于证书的安全认证。--EnablingTransportSe
此文档下载收益归作者所有