search
HomeDatabaseMysql TutorialOracle 11gR2 DataGuard环境BROKER配置Fast-Start Failover

FAST-START failover 就是在当主数据库出现故障时,能快速与可靠的把standby切换成主数据库,在整个过程中不需要人来干预。fast-

FAST-START failover 就是在当主数据库出现故障时,能快速与可靠的把standby切换成主数据库,在整个过程中不需要人来干预。fast-start failover只能通过dgmgrl与Enterprise Managerg来配置。

只有maximum availability mode or maximum performance mode才能启用fast-start failover模式。在maximum availability模式下面,在切换时可以保证无数据丢失,在maximum performance mode下面,会有数据丢失,丢失多少数据由 FastStartFailoverLagLimit这个参数来配置。

只要observer进程启动过,我们就不需要人为的干预。当observer与指定的备数据库与主数据库失去连接的时间超过FastStartFailoverThreshold后,,observer就会启动fast-start failover 到备数据库。如果配置了FastStartFailoverPmyShutdown为true,此时原来的主数据库将会自动的shutdown。如果配置FastStartFailoverAutoReinstate为true,当failover完成后,启动数据库时,会自动的执行Reinstate database,把原来的主数据库变成备库,并与新主库进行同步。

  fast-start failover包含3个过程,如下图:

 

测试开始:

   环境:OS RedHat 5.6 X86_64 ,DB 11.2.0.2

 

1,DG环境的搭建。

见Oracle 11GR2 搭建活动的物理DG/DataGuard (READ ONLY模式)

 

2,broker的配置

3,配置保护模式与日志传递方式

之前已经说了FAST-START FAILOVER只 maximum availability mode与maximum performance mode

下面我们看一下每一种保护模式对应的日志传递方式。

3.1修改保护模式:

  • 3.2 修改日志传递方式

  • 4 配置数据库的flashback

    4.1 主库上面

  • 4.2 备库上面

  • 5 配置observer服务器

    5.1 配置tnsnames.ora文件。

  • [oracle@test admin]$ cat tnsnames.ora 
  • HTZB = 
  •   (DESCRIPTION = 
  •     (ADDRESS_LIST = 
  •       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.31)(PORT = 1521)) 
  •     ) 
  •     (CONNECT_DATA = 
  •       (SERVER = dedicate) 
  •       (SERVICE_NAME = htzb) 
  •     ) 
  •   ) 
  •  
  • HTZ = 
  •   (DESCRIPTION = 
  •     (ADDRESS_LIST = 
  •       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.30)(PORT = 1521)) 
  •     ) 
  •     (CONNECT_DATA = 
  •       (SERVER = dedicate) 
  •       (SERVICE_NAME = htz) 
  •     ) 
  •   ) 
  • 5.2 启动observer进程

  • 6 配置fast-start failover

  • 于fst-start failove相关的其它几个参数:

    FastStartFailoverPmyShutdown

    FastStartFailoverLagLimit

    FastStartFailoverAutoReinstate

    ObserverConnectIdentifier

    这里我们都使用默认值;我们来看一下这些值的默认值;

  • 7 启用fast-start failover

  • 8.测试FAST-START FAILOVER是否生效

  • DGMGRL> show configuration 
  •  
  • Configuration - htz 
  •  
  •   Protection Mode: MaxAvailability 
  •   Databases: 
  •     htz  - (*) Physical standby database 
  • Fast-Start Failover: ENABLED 
  • Configuration Status: 
  • SUCCESS 
  • #原主库直接shutdown abort; 
  • SQL> shutdown abort; 
  • ORACLE instance shut down. 
  • SQL>  
  • #observer进程的日志 
  • 19:03:03.93  Friday, September 07, 2012
    Initiating Fast-Start Failover to database "htz"...
    Performing failover NOW, please wait...
    Failover succeeded, new primary is "htz"
    19:03:13.24  Friday, September 07, 2012
  • #提示已经把主切换到htz 
  • #在htz上面查看一下 
  •  
  • OPEN_MODE            DATABASE_ROLE 
  • -------------------- ---------------- 
  • 已经成功
  • 手动启动原主库
  • DGMGRL> show configuration;

    Configuration - htz

      Protection Mode: MaxAvailability
      Databases:
        htz  - Primary database
          Warning: ORA-16817: unsynchronized fast-start failover configuration

        htzb - (*) Physical standby database (disabled)
          ORA-16661: the standby database needs to be reinstated

    Fast-Start Failover: ENABLED

    Configuration Status:
    WARNING

    DGMGRL> connect sys/oracle@htzb
    Connected.
    DGMGRL> startup
    ORACLE instance started.
    Database mounted.
    ORA-16649: possible failover to another database prevents this database from being opened
  • #过一分会后我们再查看一下状态
  • DGMGRL> connect sys/oracle@htz
    Connected.
    DGMGRL> show configuration

    Configuration - htz

      Protection Mode: MaxAvailability
      Databases:
        htz  - Primary database
        htzb - (*) Physical standby database

    Fast-Start Failover: ENABLED

    Configuration Status:
    SUCCESS
  • 查看状态,一切正常。
  • linux

    Statement
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    How to solve the problem of mysql cannot open shared libraryHow to solve the problem of mysql cannot open shared libraryMar 04, 2025 pm 04:01 PM

    This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

    Reduce the use of MySQL memory in DockerReduce the use of MySQL memory in DockerMar 04, 2025 pm 03:52 PM

    This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

    How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

    The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

    Run MySQl in Linux (with/without podman container with phpmyadmin)Run MySQl in Linux (with/without podman container with phpmyadmin)Mar 04, 2025 pm 03:54 PM

    This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

    What is SQLite? Comprehensive overviewWhat is SQLite? Comprehensive overviewMar 04, 2025 pm 03:55 PM

    This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

    How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

    Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

    Running multiple MySQL versions on MacOS: A step-by-step guideRunning multiple MySQL versions on MacOS: A step-by-step guideMar 04, 2025 pm 03:49 PM

    This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

    What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

    Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

    See all articles

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    AI Hentai Generator

    AI Hentai Generator

    Generate AI Hentai for free.

    Hot Article

    Repo: How To Revive Teammates
    1 months agoBy尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
    2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: How To Get Giant Seeds
    1 months agoBy尊渡假赌尊渡假赌尊渡假赌

    Hot Tools

    Atom editor mac version download

    Atom editor mac version download

    The most popular open source editor

    MantisBT

    MantisBT

    Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

    Dreamweaver Mac version

    Dreamweaver Mac version

    Visual web development tools

    PhpStorm Mac version

    PhpStorm Mac version

    The latest (2018.2.1) professional PHP integrated development tool

    Safe Exam Browser

    Safe Exam Browser

    Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.