intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Replication – SQL Server

Chia sẻ: Pham Minh Tu Tu | Ngày: | Loại File: PPT | Số trang:14

858
lượt xem
267
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

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 . 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....

Chủ đề:
Lưu

Nội dung Text: Replication – SQL Server

  1. Replication – SQL  Server
  2. 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 
  3. 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
  4. Khai báo nhân bản  Subcription  Push Subcription : do Publisher phát ra  Pull Subcription : do subscriber phát ra  
  5. Các lọai bản sao  Snapshot : no­update  Transaction : update  Merge
  6.  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
  7. 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
  8. 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.
  9. 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.
  10. 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. 
  11. Xuất bản dữ liệu  How to Create Publications and Define Articles (Transact­SQL)  To create a snapshot or transactional publication  To create a snapshot or transactional publication   Execute sp_replicationdboption to enable publication of the current database. 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 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_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  Execute sp_addarticle n times to define each article in the publication.   To define an article for a snapshot or transactional publication  To define an article for a snapshot or transactional publication   Execute sp_addarticle to define an article. Execute sp_addarticle to define an article.  Execute sp_articlefilter to filter a table horizontally. Execute sp_articlefilter to filter a table horizontally.  Execute sp_articlecolumn to filter a table vertically. 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.  Execute sp_articleview to create the synchronization object for an article when a table is filtered vertically or horizontally.   To create a merge publication  To create a merge publication   Execute sp_replicationdboption to enable publication of the current database. Execute sp_replicationdboption to enable publication of the current database.  Execute sp_addmergepublication to define the publication. 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_addpublication_snapshot to create a Snapshot Agent and place the schema and data into the replication working directory.  Execute sp_addmergearticle  Execute sp_addmergearticle n times to define each article in the publication.   To define a merge article  To define a merge article   Execute sp_addmergearticle to define an article. Execute sp_addmergearticle to define an article.  Execute sp_addmergefilter to create a partitioned publication Execute sp_addmergefilter to create a partitioned publication
  12. Tạo phiên bản đầu tiên  Chọn Create the first snapshot immediately  trong Create Publication Wizard.
  13. Đồ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. 
  14. Đồng bộ
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2