SQLServer Database Replication

Snapshots: by setting the fixed time period for replication, the time period can be arbitrarily set in a range between one minute to a month, are the three most stable replication. Copy thing: real-time monitoring of database updates, replication of data and database objects at each update, the best real-time performance, but SQL Server can not provide the personal version of things replication, enterprise version although this feature, but not the content of the data screening, practicality and stability than the snapshot replication low. Merge replication: refers to two databases between any database update will make another database updated, poor security, less commonly used. Server configuration: 1, the new shared directory D: \ Program Files \ Microsoft SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ repldata share, add the Everyone user and given full privileges.

\

 

In the need to write SQL UNC path: \\ SYSSYS \ repldata (in running tests to see whether access); 2, set up ftp site, ftp service access using the snapshot file (by way of shared files can not access the snapshot files, I do not know the reason )

\

 

Physical path: D: \ Program Files \ Microsoft SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ repldata

\

 

All unassigned IP addresses; the SSL select no

 

\

 

Enter verify whether ftp://10.19.1.54/ page can access the folder; open the server as a firewall, the need to make an exception for ftp 3, the publication snapshot files (something to publish, for example)

\

 

Enter the Publisher's user name, password; as compared to the machine as the Publisher: sa, 123 4, right-click publish documents - snapshots property -FTP

\

 

As shown in FIG set, can be determined. Subscribe side configuration:

1, New Subscription

\

 

Select the client as a Subscriber

\

 

Enter here Publisher's user name and password 2, you can refresh the database synchronization results appear; if the amount of data synchronization time will be relatively longer explanation:

Loading...

1, publish and subscribe ip can not connect to the database; to be connected directly to a computer database name; publish and subscribe to perform

Loading...
\

 

2、局域网可采用发布与订阅都在发布服务器上完成(称为推送);如果类似于政务互联网与218之间的网络则必须在发布服务器(218)下发布快照文件,在客户端(政务互联网)订阅 问题:

1、 SQLServer复制需要有实际的服务器名称才能连接到服务器,请指定实际的服务器名。发现有这两种情况:

1)自己本身的计算机名称修改过,导致与服务器不一致。解决:在SQL SERVER里面执行下面语句: use master go select @@servername; select serverproperty('servername')

使用上面的语句查询服务器的名称和实际计算机的名称,如果两者不一致,就需要修改。不一致就执行下面的语句:

sp_dropserver 'WIN-EOJ9MM0SEE7'

GO

sp_addserver 'XCYL', 'local'

修改完后,重启SQL SERVER服务。 2)在直接用IP地址连接远程服务器时,如果不用别名来连接的话,就会出现上面这个错误提示框。解决:

为远程服务器增加“别名”,使用别名代替IP地址来连接远程数据库服务器。打开SQL SERVER2008的配置管理器,定位到“别名”服务选项,如下:

 

\

 

右键--->新建别名:

\

 

这里的这个"别名"就用服务器名称,就是用上面的SQL 语句查询出来的名称:(select @@servername;),IP地址就是这台服务器的访问地址。

接着在本机的hosts添加相应的IP地址和别名:

C:\Windows\System32\drivers\etc

hosts:

IP地址 别名

例如:

10.19.1.54 SYSSYSSingle

修改完,保存,重启一下SQL SERVER服务。再次连接的时候,使用“别名”代替IP地址去连接服务器即可(用别名登陆不可行,还提示需用计算机名);

\

 

At this point, problem solving 2, can not delete the database 'XXX', because it is being used for replication solutions:! Sp_removedbreplication 'newSql' DROP DATABASE newSql 3, Can not execute as the database principal because the subject "dbo" does not exist to solve: USE mete_data ;

EXEC sp_changedbowner 'sa'; 4, sometimes the client and the server is not inside the same LAN, this time it may not be used directly to the server name to identify the server, this time we can use the HOSTS file for name resolution to resolve: 1) Use Notepad to open the HOSTS file (normally located at C: \ \ System32 under Windows) 2) add a corresponding record IP addresses and server names, such as: 218.205.197.58 XCYL 10.9.34.111 GXX-PC 5, and sometimes can not modify the table design, as follows: remove the checkmark

\

 

Other: 1, router port mapping 1) does not matter in the absence of a network, the key is unreasonable Netcom, all white torn mesh barrier. 2) China Netcom have to check the 1433 port is available, install SQL Server 2000 that the server must open port 1433, the middle of the router firewalls have to open the 1433 port Han, SQL Server 2000 uses the default port is 1433 2, can be used in the Dos telnet client to check the server IP 1433 can not access the server's 1433 port 3, Teamviewer: remote control between the Internet, similar to QQ remote

Guess you like

Origin www.cnblogs.com/SyncNavigator8-4-1/p/10974176.html