DG broker使用dgmgrl配置及start fast failover

来源:互联网 发布:网络架构师英语怎么说 编辑:程序博客网 时间:2024/05/01 13:34

Data guardbroker配置

http://docs.oracle.com/cd/E11882_01/server.112/e17023/cli.htm#i1005573

 

1.配置 dg_broker_config_filen(For RAC)

alter systemset dg_broker_start=false scope=both;

alter systemset dg_broker_config_file1='+DATA1/DGBROKE/DR1.DAT' scope=both;

alter systemset dg_broker_config_file2='+DATA1/DGBROKE/DR2.DAT' scope=both;

2开启闪回

SQL>select flashback_on from V$database;

 

FLASHBACK_ON

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

NO

 

ALTER SYSTEM SET UNDO_RETENTION=3600SCOPE=SPFILE;

SHUTDOWN IMMEDIATE;

STARTUP MOUNT;

SHOW PARAMETERUNDO;

ALTER SYSTEM SETDB_FLASHBACK_RETENTION_TARGET=4320 SCOPE=BOTH;

ALTER DATABASEARCHIVELOG;

ALTER SYSTEMSET db_recovery_file_dest='/u01/flashback' scope=both;

ALTER SYSTEMSET db_recovery_file_dest_size=500m scope=both;

 

SQL> alter database flashback on;

 

主库:

ALTER SYSTEM SETUNDO_RETENTION=3600 SCOPE=SPFILE;

[grid@oeltan1 ~]$srvctl stop database -d tantest

STARTUP MOUNT;

 

ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320SCOPE=BOTH;

 

ALTER SYSTEMSET db_recovery_file_dest_size=500m scope=both;

SQL> ALTERSYSTEM SET db_recovery_file_dest='/u01/flashback' scope=both;

SQL> alterdatabase flashback on;

3.启动borke

两端:

SQL> altersystem set dg_broker_start=true scope=both;

4.网络配置:

设置主备两端监听为静态

RAC端的配置

[grid@oeltan1admin]$ pwd

/apps/grid/gridhome/11.2.0/grid/network/admin

[grid@oeltan1admin]$ vi listener.ora

 

 

SID_LIST_LISTENER=

   (SID_LIST=

       (SID_DESC=

        (GLOBAL_DBNAME=tantest_DGMGRL)

          (SID_NAME=tantest)

         (ORACLE_HOME=/apps/grid/gridhome/11.2.0/grid)

       )

   )

以上RAC两个节点都做。

 

重启监听

[grid@oeltan1admin]$ srvctl stop listener -l LISTENER

[grid@oeltan1admin]$ srvctl start listener -l LISTENER

[grid@oeltan1admin]$ srvctl status LISTENER

ListenerLISTENER is enabled

ListenerLISTENER is running on node(s): oeltan2,oeltan1

 

 db_unique_name_DGMGRL.db_domain

设置备库监听

5.主库归档

6. dgmgrl配置

连接到主库

oracle@oeltoddadmin]$ dgmgrl

DGMGRL>connect sys/system@tantest

创建一个配置

DGMGRL>create configuration 'DRSolution' as

> primarydatabase is 'tantest'

> connectidentifier is tantest;

Configuration"DRSolution" created with primary database "tantest"

DGMGRL>

 

查看配置

DGMGRL>show configuration;

Configuration- DRSolution

  Protection Mode: MaxPerformance

  Databases:

    tantest - Primary database

Fast-StartFailover: DISABLED

 

ConfigurationStatus:

DISABLED

 

增加一个备库:

DGMGRL>add database 'dgbro' as

> connectidentifier is dgbro

> ;

Database"dgbro" added

 

DGMGRL>show configuration;

 

Configuration- DRSolution

 

  Protection Mode: MaxPerformance

  Databases:

    tantest - Primary database

    dgbro  - Physical standby database

 

Fast-StartFailover: DISABLED

 

ConfigurationStatus:

DISABLED

配置下面的属性:

 

有几个参数按需要修改:

DGMGRL> editdatabase 'dgbro' set property 'LogArchiveFormat'='%t_%s_%r.dbf';

DGMGRL>edit database 'dgbro' set property 'ArchiveLagTarget'='0';

DGMGRL>edit database 'dgbro' set property 'LogArchiveMinSucceedDest'='1';

DGMGRL>edit database 'dgbro' set property 'LogArchiveTrace'='0';

这个参数得大于0

DGMGRL>edit database 'dgbro' set property 'DelayMins'='1';

DGMGRL>edit database 'tantest' set property 'DelayMins'='1';

启动该配置:

DGMGRL>enable configuration;

Enabled.

DGMGRL>show configuration

Configuration- DRSolution

  Protection Mode: MaxPerformance

  Databases:

    tantest - Primary database

    dgbro  - Physical standby database

Fast-StartFailover: DISABLED

ConfigurationStatus:

SUCCESS

7启动fast fail over

DGMGRL>edit database tantest set property LogXptMode='SYNC';

SQL> alterdatabase set standby database to maximize availability;

Databasealtered.

DGMGRL>  edit database tantest set propertyfaststartfailovertarget=dgbro;

Property"faststartfailovertarget" updated

DGMGRL>EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;

主备库都启用闪回

SQL> select flashback_on from V$database;

YES

启动 observer

DGMGRL> start observer;

Observer started

启动fast_start failover

DGMGRL> enable fast_start failover

Enabled

DGMGRL> show database tantest faststartfailovertarget;

  FastStartFailoverTarget = 'dgbro'

DGMGRL> show database dgbro faststartfailovertarget;

  FastStartFailoverTarget = 'tantest'