oracle dataguard (一)

一.什么是data guard及data guard的工作原理

    Data Guard 是一个集合,由一个primary数据库(生产数据库)及一个或多个standby数据库(最多9个)组成。组成Data Guard的数据库通过 Oracle Net连接,并且有可能分布于不同地域。只要各库之间可以相互通信,它们的物理位置并没有什么限制,至于操作系统就更无所谓了(某些情况 下),只要支持oracle就行了。

1. Primary  数据库

      前面提到,Data Guard包含一个primary数据库即被大部分应用访问的生产数据库,该库即可以是单实例数据库,也可以是RAC。

2. Standby  数据库

Standby 数据库是primary数据库的复制(事务上一致)。在同一个Data Guard中你可以最多创建9个standby数据库。一旦创建完 成,Data Guard通过应用primary数据库的redo自动维护每一个standby数据库。Standby数据库同样即可以是单实例数据库, 也可以是RAC结构。关于standby数据库,通常分两类:逻辑standby和物理standby,如何区分,两类各有什么特点,如何搭建,这方面内 容就是后面的章节主要介绍的,在这里呢三思先简单白话一下:

  • 物理standby(physical standby database)

      identical to the primary database on a block-for-block basis

      synchronized with the primary database through application of redo data received from the primary database

      can be used concurrently for data protection and reporting

      就像拿相机拍照,你长什么样出来的照片就是什么样,眼睛绝对在鼻子上头。或者说就像你去照镜子,里外都是你,哇哈哈。具体到数据库就是不仅文件的物理结构相同,甚至连块在磁盘上的存储位置都是一模一样的(默认情况下)。

为什么会这样呢?这事就得从同步的机制说起了。逻辑standby是通过接收primary数据库的redo log并转换成sql语句,然后在 standby数据库上执行SQL语句(SQL Apply)实现同步,物理standby是通过接收并应用primary数据库的redo log以介 质恢复的方式(Redo Apply)实现同步。

另外,不知道大家是否注意到形容词上的细节:对于相机拍照而言,有种傻瓜相机功能强大而操作简便,而对于素描,即使是最简单的画法,也需要相当多的练习才能掌握。这个细节是不是也说明逻辑standby相比物理standby需要操作者拥有更多的操作技能呢?

    • 逻辑standby

      就像你请人帮你素描画像,基本器官是都会有的,这点你放心,但是各器官位置啦大小啦肤色啦就不一定跟你本人一致了。

       shares the same schema definition

        synchronized with the primary database by transforming the data in the redo received from the primary database into SQL statements and then executing the SQL statements

       can be used concurrently for data protection,reporting(查询),and database upgrades

snapshot standby database

1.fully updatable standby database

2.created by converting a physical standby database

3.local updates are discarded when a snapshot standby database is converted back into a physical standby database

4.can be used for testing

Data Guard provides three types of services:

1.Redo transport services

2.Apply services

  - Redo Apply

  -SQL Apply

3.Role management services

Role Transitions:Switchover and Failover

Oracle Data Guard supports two role-transition operations:

1.Switchover

    -Planned role reversal

    -Used for OS or hardware maintenance

2.Failover

    -Unplanned role reversal

    -Emergency use

    -Zero or minimal data loss(depending on choice of data protection mode)

    -Can be initiated automatically when fast-start failover is enabled

 

posted @ 2015-04-09 15:11  田园沃土  阅读(537)  评论(0编辑  收藏  举报