Oracle数据库同步技术
除了上面介绍的这些数据同步技术外,在国内市场上用于Oracle数据同步的产品还有DSG 公司的RealSync软件,RealSync的实现原理及功
基于Oracle数据库的数据同步技术大体上可分为两类:Oracle自己提供的数据同步技术和第三方厂商提供的数据同步技术。Oracle自己的同步技术有DataGuard,Streams,Advanced Replication和今年刚收购的一款叫做GoldenGate的数据同步软件。第三方厂商的数据同步技术有Quest公司的SharePlex和DSG的RealSync。下面对这些技术逐一进行介绍。
一、DataGuard数据同步技术
DataGuard是Oracle数据库自带的数据同步功能,基本原理是将日志文件从原数据库传输到目标数据库,然后在目标数据库上应用(Apply)这些日志文件,从而使目标数据库与源数据库保持同步。DataGuard提供了三种日志传输(Redo Transport)方式,分别是ARCH传输、LGWR同步传输和LGWR异步传输。在上述三种日志传输方式的基础上,提供了三种数据保护模式,即最大性能(Maximum Performance Mode)、最大保护(Maximum Protection Mode)和最大可用(Maximum Availability Mode),其中最大保护模式和最大可用模式要求日志传输必须用LGWR同步传输方式,最大性能模式下可用任何一种日志传输方式。
最大性能模式:这种模式是默认的数据保护模式,在不影响源数据库性能的条件下提供尽可能高的数据保护等级。在该种模式下,一旦日志数据写到源数据库的联机日志文件,事务即可提交,,不必等待日志写到目标数据库,如果网络带宽充足,该种模式可提供类似于最大可用模式的数据保护等级。
最大保护模式:在这种模式下,日志数据必须同时写到源数据库的联机日志文件和至少一个目标库的备用日志文件(standby redo log),事务才能提交。这种模式可确保数据零丢失,但代价是源数据库的可用性,一旦日志数据不能写到至少一个目标库的备用日志文件(standby redo log),源数据库将会被关闭。这也是目前市场上唯一的一种可确保数据零丢失的数据同步解决方案。
最大可用模式:这种模式在不牺牲源数据库可用性的条件下提供了尽可能高的数据保护等级。与最大保护模式一样,日志数据需同时写到源数据库的联机日志文件和至少一个目标库的备用日志文件(standby redo log),事务才能提交,与最大保护模式不同的是,如果日志数据不能写到至少一个目标库的备用日志文件(standby redo log),源数据库不会被关闭,而是运行在最大性能模式下,待故障解决并将延迟的日志成功应用在目标库上以后,源数据库将会自动回到最大可用模式下。
根据在目标库上日志应用(Log Apply)方式的不同,DataGuard可分为Physical Standby(Redo Apply)和Logical Standby(SQL Apply)两种。
Physical Standby数据库,在这种方式下,目标库通过介质恢复的方式保持与源数据库同步,这种方式支持任何类型的数据对象和数据类型,一些对数据库物理结构的操作如数据文件的添加,删除等也可支持。如果需要,Physical Standby数据库可以只读方式打开,用于报表查询、数据校验等操作,待这些操作完成后再将数据库置于日志应用模式下。
Logical Standby数据库,在这种方式下,目标库处于打开状态,通过LogMiner挖掘从源数据库传输过来的日志,构造成SQL语句,然后在目标库上执行这些SQL,使之与源数据库保持同步。由于数据库处于打开状态,因此可以在SQL Apply更新数据库的同时将原来在源数据库上执行的一些查询、报表等操作放到目标库上来执行,以减轻源数据库的压力,提高其性能。
DataGuard数据同步技术有以下优势:
1) Oracle数据库自身内置的功能,与每个Oracle新版本的新特性(如ASM)都完全兼容,且不需要另外付费;
2) 配置管理较简单,不需要熟悉其他第三方的软件产品;
3) Physical Standby数据库支持任何类型的数据对象和数据类型;
4) Logical Standby数据库处于打开状态,可以在保持数据同步的同时执行查询等操作;
5) 在最大保护模式下,可确保数据的零丢失;

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

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

How to check which table space a table belongs to in Oracle: 1. Use the "SELECT" statement and specify the table name to find the table space to which the specified table belongs; 2. Use the database management tools provided by Oracle to check the table space to which the table belongs. Tools usually provide a graphical interface, making the operation more intuitive and convenient; 3. In SQL*Plus, you can view the table space to which the table belongs by entering the "DESCRIBEyour_table_name;" command.

Overview of how to use PDO to connect to Oracle database: PDO (PHPDataObjects) is an extension library for operating databases in PHP. It provides a unified API to access multiple types of databases. In this article, we will discuss how to use PDO to connect to an Oracle database and perform some common database operations. Step: Install the Oracle database driver extension. Before using PDO to connect to the Oracle database, we need to install the corresponding Oracle

Steps for Oracle to fetch only one piece of duplicate data: 1. Use the SELECT statement combined with the GROUP BY and HAVING clauses to find duplicate data; 2. Use ROWID to delete duplicate data to ensure that accurate duplicate data records are deleted, or use "ROW_NUMBER" ()" function to delete duplicate data, which will delete all records except the first record in each set of duplicate data; 3. Use the "select count(*) from" statement to return the number of deleted records to ensure the result.

Implementing data import into PHP and Oracle databases In web development, using PHP as a server-side scripting language can conveniently operate the database. As a common relational database management system, Oracle database has powerful data storage and processing capabilities. This article will introduce how to use PHP to import data into an Oracle database and give corresponding code examples. First, we need to ensure that PHP and Oracle database have been installed, and that PHP has been configured to

The oracle database requires jdk. The reasons are: 1. When using specific software or functions, other software or libraries included in the JDK are required; 2. Java JDK needs to be installed to run Java programs in the Oracle database; 3. JDK provides Develop and compile Java application functions; 4. Meet Oracle's requirements for Java functions to help implement and implement specific functions.

How to efficiently use connection pooling in PHP and Oracle databases Introduction: When developing PHP applications, using a database is an essential part. When interacting with Oracle databases, the use of connection pools is crucial to improving application performance and efficiency. This article will introduce how to use Oracle database connection pool efficiently in PHP and provide corresponding code examples. 1. The concept and advantages of connection pooling Connection pooling is a technology for managing database connections. It creates a batch of connections in advance and maintains a

How to use PHP to extend PDO to connect to Oracle database Introduction: PHP is a very popular server-side programming language, and Oracle is a commonly used relational database management system. This article will introduce how to use PHP extension PDO (PHPDataObjects) to connect to Oracle database. 1. Install the PDO_OCI extension. To connect to the Oracle database, you first need to install the PDO_OCI extension. Here are the steps to install the PDO_OCI extension: Make sure

Oracle's steps to determine whether a table exists in a stored procedure: 1. Use the "user_tables`" system table to query the table information under the current user, compare the incoming table name "p_table_name" with the "table_name" field, and if the conditions are met, then "COUNT(*)" will return a value greater than 0; 2. Use the "SET SERVEROUTPUT ON;" statement and the "EXEC`" keyword to execute the stored procedure and pass in the table name to determine whether the table exists.
