SQL2005 数据库数据同步
由于公司业务原因,一台服务器放置于网通机房,一台服务器放置于电信机房,不同业务需要共享一台数据库,原先的做法是把数据库放置于网通机房服务器上,电信服务器远程连接网通机房服务器上数据库,由于网通机房带宽以及网通电信互连互通的一些原因,导致电
由于公司业务原因,一台服务器放置于网通机房,一台服务器放置于电信机房,不同业务需要共享一台数据库,原先的做法是把数据库放置于网通机房服务器上,电信服务器远程连接网通机房服务器上数据库,由于网通机房带宽以及网通电信互连互通的一些原因,导致电信服务器经常无法连接上网通服务器上的数据库。经过商量后,决定分离数据库,在网通和电信服务器上都放置数据库但必须实现数据库的同步更新。
开始想到的方法是采用数据库的复制订阅功能:从网上搜索了相关文档,也实现了本机2个数据库的复制订阅测试,但要实现公网上的二台服务器上数据库的复制订阅必须要有服务器的远程操作权限,电信服务器是租用的空间,所以这种方法只好放弃。相关文档可以查阅:http://blog.csdn.net/wwwdbs/archive/2008/11/06/3237102.aspx
考虑的方法2,在程序操作时同时更新2个数据库的数据,这个方法的弊端是同时要连接2个数据库,且是不稳定的二个连接,很容易出现连接错误,影响效率。
看来要实现完全的实时同步是有点难度了,再来说一下我们公司的这个业务,公司运营三网融合电视增值服务电视黄页项目,电视黄页业务使用有线集团网通服务器数据库,大部分数据更新都是在网通服务器上进行,网通服务器上数据库的数据必须是最新的数据,不能因为连接电信服务器数据库而影响网通服务器上应用的速率和效率;电信服务器上数据库提供电视黄页网数据服务,由于电视黄页网只是公司主营业务电视黄页项目的附属产品,提供的只是电视黄页信息在互联网上的展示,所以只需要同步最基本的黄页信息就可以了,同时对实时性的要求也不是很高,考虑到这些情况,仿照数据跟踪的方法来实现数据库数据的同步,同时提供手动和自动二种方法来具体的实现。
手动:在更新完数据后,工作人员可以手动点击同步按钮,将网通服务器数据同步到电信服务器。
自动:在空闲时间,比如晚上3点,自动执行同步程序,将网通服务器数据同步到电信服务器。
操作的步骤:
需要记录的信息:数据对象数据表名、数据ID、操作类型(insert\update\delete)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Recently, the military circle has been overwhelmed by the news: US military fighter jets can now complete fully automatic air combat using AI. Yes, just recently, the US military’s AI fighter jet was made public for the first time and the mystery was unveiled. The full name of this fighter is the Variable Stability Simulator Test Aircraft (VISTA). It was personally flown by the Secretary of the US Air Force to simulate a one-on-one air battle. On May 2, U.S. Air Force Secretary Frank Kendall took off in an X-62AVISTA at Edwards Air Force Base. Note that during the one-hour flight, all flight actions were completed autonomously by AI! Kendall said - "For the past few decades, we have been thinking about the unlimited potential of autonomous air-to-air combat, but it has always seemed out of reach." However now,

Last week, amid the internal wave of resignations and external criticism, OpenAI was plagued by internal and external troubles: - The infringement of the widow sister sparked global heated discussions - Employees signing "overlord clauses" were exposed one after another - Netizens listed Ultraman's "seven deadly sins" Rumors refuting: According to leaked information and documents obtained by Vox, OpenAI’s senior leadership, including Altman, was well aware of these equity recovery provisions and signed off on them. In addition, there is a serious and urgent issue facing OpenAI - AI safety. The recent departures of five security-related employees, including two of its most prominent employees, and the dissolution of the "Super Alignment" team have once again put OpenAI's security issues in the spotlight. Fortune magazine reported that OpenA

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

70B model, 1000 tokens can be generated in seconds, which translates into nearly 4000 characters! The researchers fine-tuned Llama3 and introduced an acceleration algorithm. Compared with the native version, the speed is 13 times faster! Not only is it fast, its performance on code rewriting tasks even surpasses GPT-4o. This achievement comes from anysphere, the team behind the popular AI programming artifact Cursor, and OpenAI also participated in the investment. You must know that on Groq, a well-known fast inference acceleration framework, the inference speed of 70BLlama3 is only more than 300 tokens per second. With the speed of Cursor, it can be said that it achieves near-instant complete code file editing. Some people call it a good guy, if you put Curs

According to news on June 26, at the opening ceremony of the 2024 World Mobile Communications Conference Shanghai (MWC Shanghai), China Mobile Chairman Yang Jie delivered a speech. He said that currently, human society is entering the fourth industrial revolution, which is dominated by information and deeply integrated with information and energy, that is, the "digital intelligence revolution", and the formation of new productive forces is accelerating. Yang Jie believes that from the "mechanization revolution" driven by steam engines, to the "electrification revolution" driven by electricity, internal combustion engines, etc., to the "information revolution" driven by computers and the Internet, each round of industrial revolution is based on "information and "Energy" is the main line, bringing productivity development

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.
