Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Relational Database Service/ Best Practices/ RDS for SQL Server/ Microsoft SQL Server Publication and Subscription

Microsoft SQL Server Publication and Subscription

Updated on 2024-09-06 GMT+08:00

The publication and subscription function provided by Microsoft SQL Server uses the replication technology for data synchronization. This function makes it possible to split data read and write operations and synchronize offline and online data.

This section describes how to use SQL Server Management Studio (SSMS) to configure publication and subscription. You can create publications and subscriptions for RDS for SQL Server instances on the console. For details, see Creating a Publication.

Preparations

Environments

  1. Local environment: a local database running Microsoft SQL Server 2014 Standard Edition in Windows
  2. Online environment:
    • One single DB instance with 2 vCPUs and 16 GB of memory running Microsoft SQL Server 2014 Standard Edition, bound with an EIP
    • One primary/standby DB instance with 4 vCPUs and 8 GB of memory running Microsoft SQL Server 2014 Standard Edition, bound with an EIP

Environment Setup

  • Publisher: maintains source data and distributes specific data to the distributor. In this example, use the local server as the publisher.
    1. Use SSMS to log in to the local database as user sa. Right-click the Replication folder and then click Configure Distribution. You can use your local server as the distributor or use another server as the distributor. Click Next.
      NOTICE:
      • sa is the administrator account.
      • The login account must have the sysadmin permission. Otherwise, publication and subscription cannot be configured.
    2. Specify a root snapshot folder and click Next.
      NOTE:

      Related agent permissions must be configured for the publication so that the agent account has the permissions to read from and write to the folder.

    3. Specify the names and directories of the distribution database and log files, and click Next.
    4. Specify the distributor for the publisher and then click Next.
    5. Click Finish to complete the configuration.
  • Configuring the agent account control file
    1. You need to add the agent account to the control property of the snapshot folder according to the folder directory. Otherwise, an error message will be displayed, indicating that the access is denied.
    2. Open the local SQL Server Configuration Manager, right-click the corresponding agent, choose Properties from the shortcut menu, and copy the account name.
    3. Return to the directory of the snapshot folder. Right-click the folder and choose Properties from the shortcut menu. In the displayed dialog box, choose Security > Edit > Add. Select the local path and agent account name, click OK, and select all permissions.
  • Distributor: distributes data to specific subscribers. In this example, the distributor and publisher share the same server. Therefore, no extra configuration is required. For more information, see Configure Distribution at the official website.
  • Subscriber: receives data from the distributor. Subscription includes push subscription and pull subscription.
    • Push subscription: The publisher propagates changes to a subscriber without a request from the subscriber. Changes can be pushed to subscribers continuously or on a frequently recurring schedule.
    • Pull subscription: The subscriber requests changes made at the publisher. The data is usually synchronized on demand or on a schedule rather than continuously. RDS for SQL Server instances do not support pull subscription. In this example, only push subscription can be configured.

    Before the subscription, ensure that the RDS for SQL Server instance can be accessed from the local server.

    Before configuring the local subscription, you need to configure the RDS instance information on the local server.

    1. Configure an alias name for the subscriber on the local server. The subscription service does not support IP address-based access. Therefore, you need to map the EIP of the RDS DB instance to an alias name. To obtain the alias name, log in to the RDS DB instance and run the following SQL statement:
      select  @@SERVERNAME
    2. After obtaining the alias name, open the local SQL Server Configuration Manager, select the native clients, right-click Aliases, and choose New Aliases from the shortcut menu.
    3. Enter related information and click OK.
      Table 1 Parameter description

      Parameter

      Description

      Alias Name

      Alias name configured in 1

      Port No

      Port number of the RDS instance

      Server

      EIP bound to the RDS instance

    4. In C:\Windows\System32\drivers\etc, open the host file and add a mapping:
      Server_address MSSQL-177FFD84\MSSQL2014STD

Creating a Publication

  1. Create a publication.

    Expand the Replication folder, and then right-click the Local Publications folder. Click New Publication.

  2. Select Transactional publication.
  3. Select a table as the publication object.
  4. Add the object to be filtered for personalized publication.
  5. Create a snapshot to replicate the current state of the table. You can also set up a snapshot agent to execute the plan.
  6. Configure the agent security. You need to set the login account to the local sa account.
  7. Configure the publication name and click Finish.

  8. Check whether the publication is created by using the replication monitor.

Creating a Subscription

  1. Right-click the publication for which you want to create one or more subscriptions, and then select New Subscriptions.
  2. Configure the required parameters and click Next.
  3. Select push subscription and click Next.
  4. Click Add Subscriber. Both the SQL Server engine and non-SQL Server engine can be used as subscribers. In this example, use the RDS for SQL Server instance as the subscriber.
  5. Select a database as the subscription object.
  6. Configure the connection to the subscriber.
  7. Use a database account that is valid for a long time to ensure the subscription validity. You can use the account for logging in to the RDS for SQL Server instance. Then, click OK.
  8. Check whether the subscription is created successfully.
  9. Move the cursor to the publication to view the subscription information.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback