ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在Dataguard Broker上配置fast_start failover

在Dataguard Broker上配置fast_start failover

原创 Linux操作系统 作者:liyijie78 时间:2011-01-27 11:15:33 0 删除 编辑

要配置成功fast_start failover 需要满足以下5项条件.

  • 1. dataguard 的配置要么是maxAvailability模式要么是maxPerformance模式.
  • 2. 当dataguard的配置为maxAvailability模式时,fast-start failover的目标standby数据库的log传送模式必须设置为Sync.
  • 3. 当dataguard的配置为maxPerformance模式时,fast-start failover的目标standby数据库的log传送模式必须设置为Async.
  • 4. 主库与fast-start failover的目标standby数据库都必须激活flashback 功能.
  • 5. 当配置了多个standby数据库时,没有在主库的配置属性FastStartFailoverTarget指定目标standby 数据库.

下面将分别配置这几项.
1. 设置standby database的dataguard模式为maxAvailablity.
在配置好dataguard broker以后, 可以在主库的sqlplus 界面修改此配置,也可以直接在dataguard manager(dgmgrl)里面修改此值.

--在dgmgrl中修改此配置.
DGMGRL> edit configuration set protection mode as maxAvailability;
Succeeded.
DGMGRL>
--在sqlplus中修改此配置.
SQL> alter database set standby database to maximize availability;

Database altered.

2. 通过dgmgrl 分别修改主库与standby数据库的log file传送模式.

DGMGRL> show database verbose dbmain 'LogXptMode'
  LogXptMode = 'SYNC'
DGMGRL> edit database dbstby set property LogXptMode = 'SYNC';
Property "logxptmode" updated
DGMGRL> show database verbose dbstby 'LogXptMode'
  LogXptMode = 'SYNC'
DGMGRL>

3. 在数据库上配置flashback功能.

--主库配置语句
mkdir -p /data/oradata/flasharea/
----两个参数的设置顺序不能颠倒,否则会报错.
alter system set db_recovery_file_dest_size = 1024m scope=both;
alter system set db_recovery_file_dest = '/data/oradata/flasharea/' scope=both;
alter database flashback on;

SQL> show parameter recover

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /data/oradata/flasharea/
db_recovery_file_dest_size           big integer 1G
recovery_parallelism                 integer     0

SQL> select flashback_on,force_logging,database_role,db_unique_name from v$database;

FLASHBACK_ON       FOR DATABASE_ROLE    DB_UNIQUE_NAME
------------------ --- ---------------- ------------------------------
YES                YES PRIMARY          dbmain

--standby库配置语句.
mkdir -p /data/oradata/flasharea/
alter system set db_recovery_file_dest_size = 1024m scope=both;
alter system set db_recovery_file_dest = '/data/oradata/flasharea/' scope=both;
recover managed standby database cancel;
alter database flashback on;
recover managed standby database disconnect from session using current logfile;
SQL> show parameter recover

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /data/oradata/flasharea/
db_recovery_file_dest_size           big integer 1G
recovery_parallelism                 integer     0
SQL> select flashback_on,force_logging,database_role,db_unique_name from v$database;

FLASHBACK_ON       FOR DATABASE_ROLE    DB_UNIQUE_NAME
------------------ --- ---------------- ------------------------------
YES                YES PHYSICAL STANDBY DBSTBY

4. 在dgmgrl 中配置主库与standby数据库的FastStartFailoverTarget属性.

DGMGRL> show database verbose dbmain 'FastStartFailoverTarget';
  FastStartFailoverTarget = ''
DGMGRL> edit database dbmain set property FastStartFailoverTarget='dbstby';
Property "faststartfailovertarget" updated
DGMGRL> show database verbose dbmain 'FastStartFailoverTarget';
  FastStartFailoverTarget = 'dbstby'
DGMGRL>
DGMGRL> rem set property for dbstby
DGMGRL> show database verbose dbstby 'FastStartFailoverTarget';
  FastStartFailoverTarget = ''
DGMGRL> edit database dbstby set property FastStartFailoverTarget='dbmain';
Property "faststartfailovertarget" updated
DGMGRL> show database verbose dbstby 'FastStartFailoverTarget';
  FastStartFailoverTarget = 'dbmain'
DGMGRL>

5. 在一个dgmgrl命令中启动observer.

--在一个终端的命令中启动observer命令.
DGMGRL>
DGMGRL> start observer
Observer started

--在另外一个终端的dgmgrl命令中查看fast_start failover的状态.
DGMGRL> show fast_start failover

Fast-Start Failover: DISABLED

  Threshold:        30 seconds
  Target:           (none)
  Observer:         dbmain    --显示observer 已经启动.
  Lag Limit:        30 seconds
  Shutdown Primary: TRUE
  Auto-reinstate:   TRUE

Configurable Failover Conditions
  Health Conditions:
    Corrupted Controlfile          YES
    Corrupted Dictionary           YES
    Inaccessible Logfile            NO
    Stuck Archiver                  NO
    Datafile Offline               YES

  Oracle Error Conditions:
    (none)

6. 在dgmgrl中激活fast_start failover 功能.

DGMGRL> enable fast_start failover;
Enabled.
DGMGRL> show fast_start failover

Fast-Start Failover: ENABLED

  Threshold:        30 seconds
  Target:           dbstby
  Observer:         dbmain
  Lag Limit:        30 seconds (not in use)
  Shutdown Primary: TRUE
  Auto-reinstate:   TRUE

Configurable Failover Conditions
  Health Conditions:
    Corrupted Controlfile          YES
    Corrupted Dictionary           YES
    Inaccessible Logfile            NO
    Stuck Archiver                  NO
    Datafile Offline               YES

  Oracle Error Conditions:
    (none)
 
 - THE END -

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

上一篇: DGMGRL管理Data Guard
请登录后发表评论 登录
全部评论

注册时间:2011-01-07

  • 博文量
    93
  • 访问量
    275349