ORACLE流复制

来源:互联网 发布:《洞》电影韩国 知乎 编辑:程序博客网 时间:2024/05/23 01:24
ORACLE流复制
Author: Rainny
Date:2009-5-3


ORACLE流复制(Stream Replication)9I以后推出的,在银行,电信等大型系统中应用广泛.相对于ORACLE前期的复制技术,流复制是新推出的技术,存在一些BUG,但它是ORACLE未来数据同步的趋势.原因如下:
(1)相当于实体化视图和高级复制,流复制对于PRIMARY数据库性能的影响更小
(2)流复制相对于高级复制来讲,所需的硬件成本要小
(3)流复制更加灵活,支持异构数据库对象的同步

数据同步一直是数据库技术中投资成本比较大,维护难度大的一点.我们拿生活中的例子来说,最活生生的实例就是银行系统.我们知道,银行系统的数据量非常大,所以,在全国,任何银行都有很多数据中心,哪怕是一个省一个数据中心(像北京,上海,广州,深圳等这样的一线的大城市一个市需要一个数据中心),中国大陆就会有31个数据中心.最理想的状况是只有一个数据中心,这样就不存在同步的问题,可是,这在现实中不允许,由于数据量大,如果只使用一个数据库,性能无法承受.银行系统需要同步,你比如,最简单的例子,我们跨省存取款,或跨行存取款,各个数据中心之间就需要同步来进行结算,所以,银行要购置大量的昂贵设备来进行这样的数据同步.银行为什么要对异地存取款收取手续费,原因就在此.同样,银行之所以要对借记卡收取年费,原因也在于成本,对于一个银行帐户,即使你很少交易,可是银行要维护这些帐户数据,所以需要在硬件存储,人力技术上花大量的金钱.大型跨国公司的IT系统和银行的例子类似.另外一个生活中的例子就是电信的系统,全国的手机用户这么多,而电信和移动需要提供的服务又这么多,刚就话费的管理和结算,电信公司就要花很多的成本来维护很多省公司的数据中心,而各个数据中心的数据同步,更需要投很多的钱.
我们来回顾一下ORACLE数据同步的技术.数据同步和复制的概念其实是重叠的,数据复制,一大部分原因是为了同步.
(1)DATAGUARD:物理STANDBY本质是日志传输和应用重做(介质恢复),逻辑STANDBY本质上是日志挖掘(log miner
(2)实体化视图:ORACLE早期的版本称为快照(SNAPSHOT),通过实体化日志捕获主表的变化,然后通过刷新机制传送到另一端.
(3)高级复制:分两种:多主体双向同步和实体化视图复制.多主体实时双向同步本质上是触发器加队列(TRIGGER+QUEUE),对硬件要求比较高,对主数据库的性能也影响也比较大
(4)流复制:本质上是日志挖掘(通过LOG MINER捕获主数据库的逻辑变化记录LCRs,通过传播,转换成SQL应用到复制的另一端)加队列.原理上和逻辑STANDBY相似.只不过逻辑STANDBY是整个数据库的复制,而流复制可以是单个数据库对象的复制,所以比逻辑STANDBY更加灵活,所以支技异构数据库对象的同步.ORACLE 10G对流复制进行了增强,通过实时的日志挖掘,流复制的性能提升不少.
Oracle Streams enables information sharing. Using Oracle Streams, each unit of shared information is called a message, and you can share these messages in a stream. The stream can propagate information within a database or from one database to another. The stream routes specified information to specified destinations. The result is a feature that provides greater functionality and flexibility than traditional solutions for capturing and managing messages, and sharing the messages with other databases and applications. Streams provides the capabilities needed to build and operate distributed enterprises and applications, data warehouses, and high availability solutions. You can use all of the capabilities of Oracle Streams at the same time. If your needs change, then you can implement a new capability of Streams without sacrificing existing capabilities.
Using Oracle Streams, you control what information is put into a stream, how the stream flows or is routed from database to database, what happens to messages in the stream as they flow into each database, and how the stream terminates. By configuring specific capabilities of Streams, you can address specific requirements. Based on your specifications, Streams can capture, stage, and manage messages in the database automatically, including, but not limited to, data manipulation language (DML) changes and data definition language (DDL) changes. You can also put user-defined messages into a stream, and Streams can propagate the information to other databases or applications automatically. When messages reach a destination, Streams can consume them based on your specifications.
原创粉丝点击