Replication 的建立步骤 (主服务器Main Server) Connect to Server,Server name 要用当前服务器的名字,Authentication要用SQL Server Authentication,Login use sa,Password: PASSWORDissecret123 在作replication前,请check数据库的SQL Server Agent是否启动。 1. 打开数据库,选择Replication>Local Publication右键New Publication。随后就Next。 2. 选择Publication Database,default是marsdb。Click ‘Next’ button 3. 选择Publication Type,select第二个(Transaction publication)。Click ‘Next’ button。 4. 选择Articles,在Objects to publish这里Click Tables这个选择项的框框便可(由于我只对table进行publish)。Click ‘Next’ button。 5. Filter Table Rows,这里是若是对全部表的行列进行,那么不须要进行“Add”不然就直接Click ’Next’ button(咱们的是直接Next)。 6. Snapshot Agent,选择第一个选项“Create a snapshot immediately…..”。 7. Agent Security,Click ”Security Settings” button,在Snapshot Agent Security 页面,选择“Run under the SQL Server Agent service…..”这个选项。在Connect to the Publisher中选择第二个“Using the following SQL Server login” Login:sa Password: PASSWORDissecret123 Confirm Password: PASSWORDissecret123 Click Ok,返回Agent Security page,Click ”Next” button。 8. Wizard Actions,click ‘Next’ button. 9. Complete the Wizard,keyin “Publication name:”(这里的名字用回以前那个就好)。Click ‘Finish’。 10. 主服务器的replication完成。 (子服务器Sub Server) Connect to Server,Server name 要用当前服务器的名字,Authentication要用SQL Server Authentication,Login use sa,Password: PASSWORDissecret123 在作replication前,请check数据库的SQL Server Agent是否启动。 1. 打开数据库,选择Replication>Local Subscriptions右键New Subscriptions。随后就Next。 2. Publication page,选择publisher,click Find SQL Server Publisher,选择主服务器(Main Server)的名字,一选择就会出现每一个输入框都keyin好的,直接选择Connect.若是没有就请输入Connect主服务器的登陆信息。随后会出现Database and publications下有你建立好的主服务器的publication名字。 3. Distribution Agent Location,选择push subscriptions(第一个)。Click next. 4. Subscribers,click next. 5. Distribution Agent Security page,Click “….”这个button。会出现和主服务器同样的安全登陆设置。这一点和主服务器同样。 6. 完成了第5点,就continue Click “Next”button,最后Click Finish button。等待完成 7. 最后返回主服务器检查是否成功(查看状态)