Replication – SQL Server

Publisher : là server chứa bản chính của dư liệu sẽ nhân bản

Distributor: người ghi nhận và quản lý việc phân phối dữ liệu hay giao tác

Subcribers : là các server nhận các bản sao được nhân từ bản chính của một publisher

 

 

ppt13 trang | Chuyên mục: Vi Xử Lý – Vi Điều Khiển | Chia sẻ: dkS00TYs | Lượt xem: 2296 | Lượt tải: 1download
Tóm tắt nội dung Replication – SQL Server, để xem tài liệu hoàn chỉnh bạn click vào nút "TẢI VỀ" ở trên
Replication – SQL Server Các vai trò Publisher : là server chứa bản chính của dư liệu sẽ nhân bản Distributor: người ghi nhận và quản lý việc phân phối dữ liệu hay giao tác Subcribers : là các server nhận các bản sao được nhân từ bản chính của một publisher Các đơn vị dữ liệu Article : là một mảnh dữ liệu Publication : là một tập hợp gồm một hay nhiều article Khai báo nhân bản Subcription Push Subcription : do Publisher phát ra Pull Subcription : do subscriber phát ra Các lọai bản sao Snapshot : no-update Transaction : update Merge Cấu hình cho quá trình nhân bản Tạo và sao chép bản sao đầu tiên Hiệu chỉnh các bản sao Đồng bộ và lan truyền dữ liệu Cấu hình Chỉ ra distributor Tạo CSDL phân tán trên distributer Xác định (enable) các publisher sẽ sử dụng distributer Enable cơ sở dư liệu xuất bản Enable các subscribes sẽ nhận dư liệu xuất bản Sử dụng EM Mở rộng SQL Server group Mở rộng một server trong nhóm Click mouse phải vào Replication Click Configure Publishing, Subscribers, and Distribution. Theo sự hướng dẫn của wizard để chọn Distributor, tạo distribution database, và rồi Trên Customize the Configuration chọn Publisher and Subscriber defaults Hoặc chọn Yes, let me set the distribution database properties, enable Publishers or set the publishing settings. Sử dụng T-SQL Thực hiện sp_adddistributor ở server sẽ làm distributor. Thực hiện sp_adddistributiondb tạo server distributor để tạo cơ sở dữ liệu chứa các dữ liệu sễ nhân bản.  Thực hiện sp_adddistpublisher tại mỗi server sẽ là các publisher sẽ dùng distributor đã tạo. Trên CSDL master trên Publisher, thực hiện sp_replicationdboption cho mỗi CSDL mà sẽ nhân bản. Xuất bản dữ liệu Tại server Publisher,right click vào Publications folder, chọn New Publication. Chọn Show advanced options in this wizard Chọn publication database. Sử dụng một khuôn mẩu xuất bản publication template. Chọn lọai xuất bản (type of publication.) Chọn lọai nhân bản updatable subscriptions or transformable subscriptions (snapshot replication or transactional replication). Chỉ ra lọai Subscriber types. Xác định data and database object articles to publish. Chọn tên của xuất bản. Xác định các thông số cho xuất bản.  Xuất bản dữ liệu How to Create Publications and Define Articles (Transact-SQL) To create a snapshot or transactional publication Execute sp_replicationdboption to enable publication of the current database. Execute sp_addpublication with repl_freq set to snapshot to define the publication. Execute sp_addpublication_snapshot to create a Snapshot Agent, set the publication agent_id, and place the schema and data into the replication working directory. Execute sp_addarticle n times to define each article in the publication. To define an article for a snapshot or transactional publication Execute sp_addarticle to define an article. Execute sp_articlefilter to filter a table horizontally. Execute sp_articlecolumn to filter a table vertically. Execute sp_articleview to create the synchronization object for an article when a table is filtered vertically or horizontally. To create a merge publication Execute sp_replicationdboption to enable publication of the current database. Execute sp_addmergepublication to define the publication. Execute sp_addpublication_snapshot to create a Snapshot Agent and place the schema and data into the replication working directory. Execute sp_addmergearticle n times to define each article in the publication. To define a merge article Execute sp_addmergearticle to define an article. Execute sp_addmergefilter to create a partitioned publication Tạo phiên bản đầu tiên Chọn Create the first snapshot immediately trong Create Publication Wizard. Đồng bộ Đồng bộ một push subscription Tại Publisher, click Replication, Publications, chọn publication cần đồng bộ. Click chuột phải vào subscription cần đồng bộ, rồi click Start Synchronizing. Đồng bộ pull or anonymous subscription Tại Subscriber, click Replication, Subscriptions. Click chuột phải vào subscription cần đồng bộ, rồi click Start Synchronizing. Đồng bộ 

File đính kèm:

  • pptReplication – SQL Server.ppt