Data Guard Introduction

Source: Internet
Author: User
Tags failover

I. Summary

Oracle Dataguard is an Oracle-brought data synchronization feature that transfers log files from the original database to the target database and then applies the log files on the target database to keep the target database synchronized with the source database, which is a database-level high availability scenario.

Dataguard can provide Oracle database redundancy, data protection, failure recovery, and so on to achieve rapid database switching and catastrophic recovery.

When transactional consistency is guaranteed in the production database, a standby is created using a physical full backup of the production library, which automatically maintains an alternate database through an archive log or redo entry that is transmitted over the production library.

Dataguard Data synchronization technology has the following advantages:

1. The features built into the Oracle database itself are fully compatible with the new features of each Oracle new version, and do not require an additional fee.

2. Configuration management is simple and does not require familiarity with other third-party software products.

3. The physical standby database supports any type of data object and data type.

4. The logical standby database is open to perform operations such as querying while keeping data synchronized.

5. In maximum protection mode, you can ensure that 0 of the data is lost.

Second, the structure

Oracle Dataguard consists of a primary database (production database) and one or more standby databases (up to 9). The database that makes up data guard is connected through Oracle NET and can be distributed across different geographies.

As long as the libraries can communicate with each other, their physical location is not limited by the operating system.

1. Primary Database

The Dataguard contains a primary database, which is a production database accessed by most applications, which can be either a single-instance database or a RAC.

2. Standby Database

The standby database is a replication of the primary database (transactionally consistent). You can create up to 9 standby databases in the same data guard, and once created, Data guard automatically maintains each standby database by applying the redo of the primary database.

The standby database can also be a single-instance database or a RAC structure.

3. Structure diagram

Iii. Types of Standby databases

Standby databases are usually divided into two categories: logical standby and physical standby.

1. Logic Standby

A. Logical standby is achieved by receiving the redo log of the primary database and converting it into an SQL statement, and then executing the SQL statement on the standby database for synchronization;

B. Share the same schema definition as the main library;

C. Be consistent with the main library by applying SQL (SQL apply);

D. When the log is accepted from the main library, the logical standby database is converted to SQL via LOGMNR, and in the table of the logical repository, the table can be used for both recovery and report query functions;

2. Physical Standby

A. Physical standby is synchronized by receiving and applying the redo log of the primary database in the form of media recovery, not only the physical structure of the file, but also the storage location of the block on the disk is identical;

B. Consistent with the data block level and the primary database;

C. Keep in sync with the main library via the Application log (redo apply);

D. Application log recovery at Mount Standby stage, while open read only provides report query;

Iv. Backup Library Status

1. Physical Standby Library

(1). Managed Recovery State

In this mode, log Transport service archives logs to the repository, and log apply service automatically applies these logs. The database is not in Mount state, and any read is not allowed.

(2). Read only State

If we want to prepare the repository for reporting, in the standby environment, we open the database in Read Only form. The archive log will not be able to be applied to the standby library in the standby log, but the log transport service of the main library can continue to pass the archive log to the standby repository.

We can easily switch between these two running processes in a non-productive way, and in general we will switch processes in the following scenarios:

A. Physical standby for report mode

B. For disaster protection, check that the data is properly transferred to the standby library

2. Logical Standby Library

Open Read Write mode

This mode, the repository can still continue to apply the archive log, but the repository can also provide report query function.

When the log apply service is updating a table, the table can still be queried, but there is no DML operation on the table. If objects in other modes are not maintained by the log apply service, then we can update those objects in that mode.

Five, service

1. Redo Transfer Service (Redo Transport Services)

Control the transmission of redo data to one or more archived destinations.

2. Log Application Service (logs apply services)

Apply redo data to the standby database to maintain consistency with the transactions of the primary database. The redo data can be read from an archive file in the standby database or directly by applying an alternate log file.

3. Role conversion Service (roles transitions)

There are two types of roles in Dataguard: Primary and Standby. The role transformation is to have the database switch between the two roles,

4. There are two types of switching: switchover and failover

(1). Switchover:

A. Convert the primary database to the standby database.

B. Switchover ensures that no data loss is possible.

C. Planned role conversion, mainly for operating system and hardware maintenance, the repository switch to the main library, and the main library switch to standby, after the switch is complete, this process without any data loss and loss.

(2). Failover:

A. When the primary database fails and cannot be restored in a timely manner, the failover is called to convert a standby database to a new primary database.

B. In maximum protection mode or maximum availability mode, the failover guarantees that no data loss is possible.

C. Non-planned role conversions, used in emergency situations, with little or no data loss depending on the protection model of the data

Vi. Mode of protection

1. Maximum protection

This mode is the default data protection mode, providing the highest possible level of data protection without affecting the performance of the source database.

In this mode, once the log data is written to the online log file of the source database, the transaction can be committed without waiting for the log to be written to the target database, and if the network bandwidth is sufficient, the mode provides a level of data protection similar to the maximum available mode.

2. Maximum Availability

This model is basically the same as "maximum protection". Under normal circumstances, the master repository is synchronized.

When there is a problem with the network or the standby, it will not affect the main library's machine, the main library will automatically convert the library "maximum performance" mode, wait for the repository to be available, transfer the archive to the standby for recovery.

3. Maximum Performance

This mode ensures maximum performance of the main library, and the data is transmitted asynchronously between the main repositories.

That is, the primary and standby logs are archived and then transferred to the standby library, and the archive log file is used for recovery operations on the standby.

Seven, installation conditions

The following conditions are required to run Dataguard:

1. The same version of Oracle Enterprise Edition must be installed on all machines in the main library and from the library.

2. The main library must be running in archive mode.

3. The main library and the operating system from the library must be the same (allowing versions to be different), and the library can use a different directory structure from the main library.

4. The architecture of the master-slave library hardware system must be the same. For example: The main library is running on a 64-bit sun SPARC system, which is not allowed if the Linux Intel system is 32-bit from the library. The configuration of the master-slave library hardware can be different, such as: Number of CPUs, memory size, storage configuration, etc.

Reference Document: Http://blog.chinaunix.net/uid-14877370-id-2782040.html

-------------------------------------------------------------------------

Etl,extraction-transformation-loading abbreviations, Chinese names are data extraction, conversion, and loading . ETL tools are: OWB (Oracle Warehouse Builder), ODI (Oracle Data Integrator),informatic PowerCenter, Aicloudetl, DataStage, Repository Explorer, beeload, kettle, Dataspider

Data Guard Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.