ITPub博客

首页 > 数据库 > Oracle > [Data Guard]Oracle10g Data Guard学习笔记(一)

[Data Guard]Oracle10g Data Guard学习笔记(一)

原创 Oracle 作者:chenyan995 时间:2008-12-15 23:33:36 0 删除 编辑

1. Oracle Data Guard: Overview

Types of Standby Databases

Physical standby database block-for-block, redo apply

Logical standby database Shares the same schema definition, SQL apply

Types of Services

Redo transport services, Log apply services, Role-management services

Role Transitions

Switchover

Failover

Data Protection Modes

Maximum protection:commit完成前保证redo已被写入主数据库和至少一个备数据库,备机若异常不能传输redo则主库自动下掉

Maximum availability:备机正常情况下同最大保护模式,异常情况下同最大性能模式

Maximum performance:redo异步传输,不影响主数据库性能

2. Understanding the Oracle Data Guard Architecture

Data Guard Operational Requirements: Hardware and Operating System

硬件配置可不同,操作系统版本可不同,操作系统和平台必须一致。如主备数据库在同一服务器,必须保持操作系统支持。

Data Guard Operational Requirements: Oracle Database Software

数据库版本一致,具有 sysdba权限,主备数据库有各自的控制文件,主数据库打开归档,enable forcing logging,如使用ASM或OMF,则主备同时配置。

Primary Database Flow(process)

LGWR:同步方式下直接与RFS交互并等待确认,异步方式下直接提一个网络请求给LNSn

ARCn:也可与RFS交互进行redo的传输,同时对主备间的gap进行检查和处理

FAL:提供一种client/server的机制来处理主备间的gap,只要需要时启动进程。

Standby Database Flow(process)

RFS:负责接收redo,并将其写如standby redo log或直接写如archive log。与ARCn或LNSn一一对应。

ARCn:负责将standby redo log归档

MRP:负责redo apply,只用与physical standby。使用alter database recover managed standby database则使用当前进程进行recovery。加上disconnect from session则起MRP后台进程。

LSP:对logical standby的SQL apply操作进行控制

三种必须使用Standby Redo Logs的情况:

The maximum protection and maximum availability levels of data protection

Real-time apply

Cascaded redo log destinations

SQL Apply Process: Architecture

• The reader process reads redo records from the archived redo log files.

• The preparer processes convert the block changes into table changes or logical change records

(LCRs). At this point, the LCRs do not represent any specific transactions.

• The builder process assembles completed transactions from the individual LCRs.

• The analyzer process examines the records, possibly eliminating transactions and identifying

dependencies between the different transactions.

• The coordinator process (LSP):

- Assigns transactions

- Monitors dependencies between transactions and coordinates scheduling

- Authorizes the commitment of changes to the logical standby database

• The applier process:

- Applies the LCRs to the database

- Asks the coordinator process to approve transactions with unresolved dependencies (the

transactions are scheduled appropriately so that the dependencies are resolved)

- Commits the transactions

Real-Time Apply

普通方式下使用archive log进行redo apply,real-time方式下使用standby redo log进行apply

Start Real-Time Apply

Physical standby:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;

Logical standby:

ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

Setting the DB_UNIQUE_NAME Parameter

Data guard使用db_unique_name参数来识别数据库,默认与db_name相同。使用EM配置DG时会自动为每个备库配置一个唯一的db_unique_name。

Specifying Role-Based Destinations

可在log_archive_dest_n中配置valid项以使得数据库在不同的角色下使用不同的归档路径。

例如:LOG_ARCHIVE_DEST_2= location="/u01/app/oracle/oradata/orcldg2/arc",

valid_for=(STANDBY_LOGFILE,STANDBY_ROLE)

The RFS process writes to an archive redo log file if any of the following conditions are met:

• There are no standby redo logs.

• It cannot find the same size standby redo log as the incoming online redo log file.

• All of the standby redo logs of the correct size have not yet been archived.

Standby Database Modes

physical standby: redo apply/open read-only

logical standby: open read/write

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8558093/viewspace-1014781/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    34
  • 访问量
    73625