First, customer demand
Customers now have a demand, the company has a very important SQL database, Payouyitian server or system crash, leading to all SQL database data loss, the customer wants to database data, the number of libraries in some way by real-time synchronization to another server on, so you can make a backup.
Then how the customer needs to achieve it?
Second, the solution:
Through the analysis and research, using a built-in SQL publish and subscribe capabilities, the old version of SQL Server 2008, to install a new version of SQL Server 2014, released by the old SQL Serer, and then through the SQL Server2014 subscribe to synchronize database data.
Third, the implementation process
3.1 released
Before release preparation: first between the two servers to be able to communicate with each other, which is able to ping command can pass. Usually when we connect to the database, it is often used ip landing, but when released can not do this, we must use the server name.
If you can add the corresponding IP address and host name of the hosts file on both servers in different segments of two database servers.
On the old server, open the SQL Server database software, SQL database publishing.
1, on the old server, find the copy - a local publication, right-click on the new release.
2. Select the name of the database needs to be published.
3, choose a transactional publication.
4, in this database to view the table, whether can normally be released, as shown below, some of the tables can not be released properly, then how to do?
5, since these tables are found to not have a primary key, which need to set the primary key three table.
6, set the primary key.
8, I found that there is a table can not be published.
9 to see why.
10, you need a table, save this requirement to prevent re-create the table to change the entry to remove the check.
11, after removal, may be found in the table set the primary key normal.
12, you can see all the tables are normally released.
13, the next step.
14, select Add.
15, select Create a snapshot immediately and snapshot remains available to initialize subscriptions.
16, select Security Settings.
17, entered into the database sa user name and password.
18, select Next. Then pay attention, we need to open the proxy service database, and SQL browser service is turned on.
19, create a publication.
20, a new name.
21, publishing success.
22, released at the same time, we must ensure that the following SQL This directory can read and write.
3.2, subscribe
1, to the new server, locate the SQL Server Agent server, turn it on, automatically.
2, find the SQL Browser service will be open.
3. Ping the host name of the server release.
4, find the copy - local subscription.
5, select Next.
6, select Find SQL Server Publisher.
7, select the name of the publisher, or input manually publish the server name, user name sa entered Publisher, the Publisher database sa password.
8, you can query the database names we have just released.
9, select Run all agents at the Publisher PRD-SQL.
10, choose New Database.
11, create a new database, to synchronize the Publisher database.
12, the new database is complete, click Next.
13, connected to the subscriber's choice.
14, enter the subscriber database sa user name and password.
15, select Next.
16, select continuous operation.
17, select the initialization time immediately.
18, choose to create a subscription.
19, select Done.
20, subscribe to create success.
3.3 Test Results
1, see the synchronization status on the publisher.
2, you can see the database tables being synchronized.
3. After synchronization is complete, you can view the database data and how many subscribers comparison, if the same description successful.
4, at the subscriber, you can view all the tables are synchronized over. And total data entry and publisher data, the real-time data backup success.
When, publisher of this database are subject to change, subscriber database will change in real time.