12c Data Guard Broker 配置

简介: 12c Data Guard Broker 配置,18c Data Guard Broker 配置

cdb 数据库搭建dataguard
https://yq.aliyun.com/articles/630485
oracle 免密码登陆:(启动observer需要配置密钥钱包)
https://yq.aliyun.com/articles/632510

数据库版本:
Release 12.2.0.1.0

192.168.0.196 prod04 主
192.168.0.197 prod05 备

主备数据库已经配置为dataguard模式。

1,主备启动broker

alter system set dg_broker_start=true;

2 ,配置dg broker

[oracle@prod04 ~]$ dgmgrl 
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Fri Aug 31 08:39:49 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect / as sysdba
Connected to "cdb"
Connected as SYSDBA.
DGMGRL> CREATE CONFIGURATION cdbdg as PRIMARY DATABASE IS cdb  CONNECT IDENTIFIER IS cdb;
Configuration "cdbdg" created with primary database "cdb"
DGMGRL> add database sbcdb AS CONNECT IDENTIFIER IS  sbcdb;
Database "sbcdb" added

DGMGRL> SHOW CONFIGURATION;
Configuration - cdbdg
  Protection Mode: MaxPerformance
  Members:
  cdb   - Primary database
    sbcdb - Physical standby database 
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED

DGMGRL>  ENABLE CONFIGURATION;
Enabled.
DGMGRL> show  CONFIGURATION;

Configuration - cdbdg

  Protection Mode: MaxPerformance
  Members:
  cdb   - Primary database
    sbcdb - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 315 seconds ago)

3 ,检查同步状态

DGMGRL> SHOW DATABASE sbcdb;

Database - sbcdb

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 1 second ago)
  Apply Lag:          0 seconds (computed 1 second ago)
  Average Apply Rate: 3.00 KByte/s
  Real Time Query:    ON
  Instance(s):
    cdb

Database Status:
SUCCESS

4 ,更改数据库保护模式

DGMGRL>  SHOW DATABASE VERBOSE sbcdb LogXptMode;
  LogXptMode = 'ASYNC'
DGMGRL>  SHOW DATABASE VERBOSE cdb LogXptMode;  
  LogXptMode = 'ASYNC'
DGMGRL> EDIT DATABASE cdb  set PROPERTY 'LogXptMode'='sync';
Property "LogXptMode" updated
DGMGRL> EDIT DATABASE sbcdb set PROPERTY 'LogXptMode'='sync';
Property "LogXptMode" updated
DGMGRL> SHOW DATABASE VERBOSE sbcdb LogXptMode;
  LogXptMode = 'sync'
DGMGRL> SHOW DATABASE VERBOSE cdb LogXptMode;
  LogXptMode = 'sync'

DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.

DGMGRL> SHOW CONFIGURATION;
Configuration - cdbdg
  Protection Mode: MaxAvailability
  Members:
  cdb   - Primary database
    sbcdb - Physical standby database 
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS   (status updated 46 seconds ago)

5,开启快速故障切换

5,1 observer配置

#####
更改数据库保护模式MAXAVAILABILITY:
DGMGRL> EDIT DATABASE cdb  set PROPERTY 'LogXptMode'='sync';
Property "LogXptMode" updated
DGMGRL> EDIT DATABASE sbcdb set PROPERTY 'LogXptMode'='sync';
DGMGRL> EDIT DATABASE cdb SET PROPERTY FastStartFailoverTarget=sbcdb;
Property "faststartfailovertarget" updated
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
#####
主备数据库开启数据库闪回:
ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
SHOW PARAMETER UNDO;
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320 SCOPE=BOTH;
ALTER SYSTEM SET db_recovery_file_dest_size=5G;
ALTER SYSTEM SET db_recovery_file_dest='/u01/app/arc';
ALTER DATABASE FLASHBACK ON;
ALTER DATABASE OPEN;
#####
配置钱包
mkdir –p /u01/app/oracle/wallet/
mkstore –wrl /u01/app/oracle/wallet/ -create
mkstore -wrl /u01/app/oracle/wallet/ -createCredential cdb sys oracle
mkstore -wrl /u01/app/oracle/wallet/ -createCredential sbcdb sys oracle
#####
sqlnet.ora
[oracle@prod04 admin]$ cat sqlnet.ora 
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME,EZCONNECT)
WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/u01/app/oracle/wallet/)))
SQLNET.WALLET_OVERRIDE=TRUE
#####
启动observer
[oracle@prod04 admin]$ dgmgrl sys/oracle
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Fri Aug 31 11:27:23 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "cdb"
Connected as SYSDG.
DGMGRL> start observer ob1 in background logfile is '/u01/observerlog' connect identifier is cdb;
Submitted command "START OBSERVER" using connect identifier "cdb" 
DGMGRL> show observer
Configuration - cdbdg
Fast-Start Failover: DISABLED
Observer "ob1"
  Host Name:                    prod04
  Last Ping to Primary:         2 seconds ago
DGMGRL> 

5.2 停止observer

[oracle@prod04 ~]$ dgmgrl sys/oracle
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Fri Aug 31 10:36:30 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "cdb"
Connected as SYSDG.
DGMGRL> show observer

Configuration - cdbdg

Fast-Start Failover: DISABLED

Observer "observer01"

  Host Name:                    prod05
  Last Ping to Primary:         26 seconds ago

Observer "observer02"

  Host Name:                    prod04
  Last Ping to Primary:         15 seconds ago

DGMGRL> stop observer observer01
Observer stopped.
DGMGRL> stop observer observer02
Observer stopped.
DGMGRL> show observer

Configuration - cdbdg
Fast-Start Failover: DISABLED
No observers.

5.3 启动快速故障切换

[oracle@prod05 admin]$ dgmgrl sys/oracle
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Fri Aug 31 11:30:56 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "sbcdb"
Connected as SYSDG.
DGMGRL>  show observer;

Configuration - cdbdg

Fast-Start Failover: DISABLED

Observer "ob1"

  Host Name:                    prod04
  Last Ping to Primary:         28 seconds ago

DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.
DGMGRL>  SHOW FAST_START FAILOVER;

Fast-Start Failover: ENABLED

  Threshold:          30 seconds
  Target:             sbcdb
  Observer:           ob1
  Lag Limit:          30 seconds (not in use)
  Shutdown Primary:   TRUE
  Auto-reinstate:     TRUE
  Observer Reconnect: (none)
  Observer Override:  FALSE

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

  Oracle Error Conditions:
    (none)

DGMGRL> SHOW DATABASE  cdb FastStartFailoverTarget;
  FastStartFailoverTarget = 'sbcdb'
DGMGRL> SHOW DATABASE  sbcdb FastStartFailoverTarget;
  FastStartFailoverTarget = ''
DGMGRL> 
相关文章
|
1月前
|
消息中间件 Kafka
Kafka【问题记录 01】kill -9 导致 Kakfa 重启失败问题处理(doesn‘t match stored clusterId xxx in meta.properties)
【2月更文挑战第20天】Kafka【问题记录 01】kill -9 导致 Kakfa 重启失败问题处理(doesn‘t match stored clusterId xxx in meta.properties)
23 0
|
4月前
|
消息中间件 大数据 Kafka
记录一下Kafka报错:timeout expired while fetching topic metadata
记录一下Kafka报错:timeout expired while fetching topic metadata
139 0
|
26天前
|
消息中间件
PRECONDITION_FAILED - inequivalent arg ‘type‘ for exchange ‘exchange‘ in vhost ‘/‘: received ‘direct
PRECONDITION_FAILED - inequivalent arg ‘type‘ for exchange ‘exchange‘ in vhost ‘/‘: received ‘direct
9 0
|
消息中间件 前端开发 Java
记录CDH5.10一个clients.NetworkClient: Bootstrap broker ip:9092 disconnected问题
1.当前环境使用的稳定版本组合a.本套环境CDH经过四次升级,当然版本为CDH-5.10.0-1.cdh5.10.0.p0.41b.KAFKA版本为KAFKA-2.
5339 0
|
消息中间件 Java 数据处理
深入理解RabbitMQ中的prefetch_count参数
在某一次用户标签服务中大量用到异步流程,使用了RabbitMQ进行解耦。其中,为了提高消费者的处理效率针对了不同节点任务的消费者线程数和prefetch_count参数都做了调整和测试,得到一个相对合理的组合。这里深入分析一下prefetch_count参数在RabbitMQ中的作用。
590 5
深入理解RabbitMQ中的prefetch_count参数
|
Oracle 关系型数据库 数据库
|
Oracle 网络协议 关系型数据库