When you configure the publish and disable copy functions, the system prompts that the distributor is not correctly installed.

Source: Internet
Author: User

Error message (the distribution server is incorrectly installed when the replication function is configured and disabled .) :

1. The distribution server or distribution database cannot be found for the local server. The distributor may not be installed, or the local server may not be configured as the publisher on the distributor.

2. SQL Server cannot disable publishing and distribution on "XXXX.

------------------------------
Other information:

An exception occurred when executing a Transact-SQL statement or batch processing. (Microsoft. sqlserver. connectioninfo)

------------------------------

The distribution server is not correctly installed, so the database cannot be published.

 

Cause:

The server has changed the host, so the machine name is different at this time. Previous release projects are all previous machine names, and all released projects cannot be deleted successfully on the current machine name, eventually, the replication function becomes unavailable. Since the SQL replication function is addressing by machine name, the distribution server is prompted to be correctly installed because the new machine name is different from the old one after the host is changed.

 

The solution is as follows:

// Clear all subscription and release items of the dbname Database
All data that has been published or subscribed to on the server can be cleared with the following command.
Sp_removedbreplication 'dbname'

// If the previous machine name has a publish or subscribe project, run the following command to view it:
Use dbname
Select * From syspublications

Use dbname
Select * From syspublications

----------------------- The following are some practical commands ----------------------------

// View the linked server
Select * From SYS. Servers
// View the server instance name
Select @ servername

Use master
// Enable database publishing and merging
Exec sp_dboption 'dbname', 'merge publish ', 'true'
// Start Database Replication
Exec sp_dboption 'dbname', 'published', 'true'

// View the registered server instance
Exec sp_helpserver

 

Note: The preceding dbname indicates the database name. Write based on your own data name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.