1、两台不同服务器;
2、从oracle10g定时同步(每天凌晨2:00)到sqlserver2005;
3、处于安全性考虑,客服方不提供sqlserver2005的账户密码,只需我们提供数据集;
4、双方程序语言都为java;
在这些前提下我提出了几套方案,仅供参考:
a:如果oracle能在客户服务器上访问,由oracle方提供接口给客户服务器实现,返回给客户服务器所需同步数据,并由客户服务器操作数据存储到sqlserver2005中,接口代码描述:远程建立jdbc连接oracle(临时帐户),查询oracle方提供的视图,并访问客户所需数据集,打成jar包,由客户方调用接口实现方法获得数据。
b:如果oracle方不能被客户服务器访问,则将需同步数据置入xml中,并由客服服务器方访问其xml(http or socket),并有oracle方提供解析机制,返回数据集。
c:通过开源数据库同步软件实现不同(google结果:symmetricds、opendbdiff(针对sqlserver))
前面三种方案均可实现从oracle同步到sqlserver2005,不过如果数据量较大时可能导致中途数据丢失或者同步速度较慢等情况,于是制定如下方案:
建立同步表,将客户方所需数据表中字段放入到同步表中,如:
用户表:wid,userid,password
用户同步表:wid,userid,password,no,operationtype,operationdate
可以看到同步表中多了三个字段:no,operationtype,operationdate
no为序号,由oracle序列生成,operationtype为操作类型,0为新增,1为修改,2为删除,operationdate为操作日期,取当前完整时间(年月日分秒)
建立用户表触发器,如果用户表有操作则将客户方所需用户表字段放入同步表中,如果新增将operationtype的值插入0,以此类推
在客服服务器方,oracle方提供接口查询同步表得到结果集,并和客服商议如何操作这些数据
这样就可以实现哪些数据修改过就同步哪些数据,减免了双方服务器的压力

In database optimization, indexing strategies should be selected according to query requirements: 1. When the query involves multiple columns and the order of conditions is fixed, use composite indexes; 2. When the query involves multiple columns but the order of conditions is not fixed, use multiple single-column indexes. Composite indexes are suitable for optimizing multi-column queries, while single-column indexes are suitable for single-column queries.

To optimize MySQL slow query, slowquerylog and performance_schema need to be used: 1. Enable slowquerylog and set thresholds to record slow query; 2. Use performance_schema to analyze query execution details, find out performance bottlenecks and optimize.

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

MySQL asynchronous master-slave replication enables data synchronization through binlog, improving read performance and high availability. 1) The master server record changes to binlog; 2) The slave server reads binlog through I/O threads; 3) The server SQL thread applies binlog to synchronize data.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The installation and basic operations of MySQL include: 1. Download and install MySQL, set the root user password; 2. Use SQL commands to create databases and tables, such as CREATEDATABASE and CREATETABLE; 3. Execute CRUD operations, use INSERT, SELECT, UPDATE, DELETE commands; 4. Create indexes and stored procedures to optimize performance and implement complex logic. With these steps, you can build and manage MySQL databases from scratch.

InnoDBBufferPool improves the performance of MySQL databases by loading data and index pages into memory. 1) The data page is loaded into the BufferPool to reduce disk I/O. 2) Dirty pages are marked and refreshed to disk regularly. 3) LRU algorithm management data page elimination. 4) The read-out mechanism loads the possible data pages in advance.

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

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