我的编程空间,编程开发者的网络收藏夹
学习永远不晚

DG Broker如何搭建

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

DG Broker如何搭建

这篇文章主要介绍了DG Broker如何搭建,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

DG Broker搭建 

1.环境说明

databasesid db_name db_unique_namenet service  name
primary oggoggoggogg_p
physical standbydoggoggdoggdogg_s

2.查看参数

----主库

SYS@ogg>show parameter broker

NAME                               TYPE       VALUE

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

dg_broker_config_file1             string     /u01/app/oracle/product/11.2.0 /dbhome_1/dbs/dr1ogg.dat

dg_broker_config_file2             string     /u01/app/oracle/product/11.2.0 /dbhome_1/dbs/dr2ogg.dat

dg_broker_start                    boolean     FALSE

----备库

SYS@dogg> show parameter broker

NAME                               TYPE     VALUE

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

dg_broker_config_file1             string     /u01/app/oracle/product/11.2.0 /db_1/dbs/dr1dogg.dat

dg_broker_config_file2             string     /u01/app/oracle/product/11.2.0/db_1/dbs/dr2dogg.dat

dg_broker_start                    boolean    FALSE

------修改dg_broker_config_file参数。这里就用默认的路径,也可以自己指定。如果是在RAC环境中,这个把这个文件把到共享的存储上面,如果有ASM可以放到ASM中。

3.启用BROKER

----在两个数据库上面都执行:

alter system set dg_broker_start=true scope=both;

4.登录配置

---在其中任意一台做下面的操作就可以了,另它安装了client的客户端也是可以的

[oracle@ogg-80 ~]$ dgmgrl

(1)连接到当前的主数据库

DGMGRL> connect sys/oracle@ogg_p

DGMGRL> help create    -----查看帮助

Creates a broker configuration

Syntax:

  CREATE CONFIGURATION <configuration name> AS

    PRIMARY DATABASE IS <database name>

    CONNECT IDENTIFIER IS <connect identifier>;

(2)创建一个配置文件(ogg是db_unique_name,oggDG是配置的名字--可以修改,ogg_p是连接到prod数据库的tnsname)

create configuration oggDG as primary database is ogg connect identifier is ogg_p;

(3)启用配置文件

DGMGRL> enable configuration;

(4)增加备库到配置文件中 (dogg是备机的db_unique_name,dogg_s是连接到sprod数据库的tnsname)

DGMGRL> add database dogg as connect identifier is dogg_s;

(5)启用备库

DGMGRL> enable database dogg;

(6)查看配置文件

DGMGRL> show configuration

Configuration - oggdg

  Protection Mode: MaxPerformance

  Databases:

    ogg  - Primary database

    dogg - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

(7)查看主库的配置消息

DGMGRL> show database verbose ogg;

Database - ogg

  Role:            PRIMARY

  Intended State:  TRANSPORT-ON

  Instance(s):

    ogg

  Properties:

    DGConnectIdentifier             = 'ogg_p'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'ASYNC'

    DelayMins                       = '0'

    Binding                         = 'optional'

    MaxFailure                      = '0'

    MaxConnections                  = '1'

    ReopenSecs                      = '300'

    NetTimeout                      = '30'

    RedoCompression                 = 'DISABLE'

    LogShipping                     = 'ON'

    PreferredApplyInstance          = ''

    ApplyInstanceTimeout            = '0'

    ApplyParallel                   = 'AUTO'

    StandbyFileManagement           = 'auto'

    ArchiveLagTarget                = '0'

    LogArchiveMaxProcesses          = '4'

    LogArchiveMinSucceedDest        = '1'

    DbFileNameConvert               = '/u01/app/oracle/oradata/dogg/, /u01/app/oracle/oradata/ogg/'

    LogFileNameConvert              = '/u01/app/oracle/oradata/dogg/, /u01/app/oracle/oradata/ogg/'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'ogg'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ogg-80)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ogg_DGMGRL)(INSTANCE_NAME=ogg)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/app/oracle/archive'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.dbf'

    TopWaitEvents                   = '(monitor)'

Database Status:

SUCCESS

(8)查看备库的配置消息

DGMGRL> show database verbose dogg;

Database - dogg

  Role:            PHYSICAL STANDBY

  Intended State:  APPLY-ON

  Transport Lag:   0 seconds (computed 0 seconds ago)

  Apply Lag:       0 seconds (computed 0 seconds ago)

  Apply Rate:      0 Byte/s

  Real Time Query: ON

  Instance(s):

    dogg

  Properties:

    DGConnectIdentifier             = 'dogg_s'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'ASYNC'

    DelayMins                       = '0'

    Binding                         = 'OPTIONAL'

    MaxFailure                      = '0'

    MaxConnections                  = '1'

    ReopenSecs                      = '300'

    NetTimeout                      = '30'

    RedoCompression                 = 'DISABLE'

    LogShipping                     = 'ON'

    PreferredApplyInstance          = ''

    ApplyInstanceTimeout            = '0'

    ApplyParallel                   = 'AUTO'

    StandbyFileManagement           = 'auto'

    ArchiveLagTarget                = '0'

    LogArchiveMaxProcesses          = '4'

    LogArchiveMinSucceedDest        = '1'

    DbFileNameConvert               = '/u01/app/oracle/oradata/ogg/, /u01/app/oracle/oradata/dogg/'

    LogFileNameConvert              = '/u01/app/oracle/oradata/ogg/, /u01/app/oracle/oradata/dogg/'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'dogg'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=d-ogg)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dogg_DGMGRL)(INSTANCE_NAME=dogg)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/app/oracle/archive'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.dbf'

    TopWaitEvents                   = '(monitor)'

Database Status:

SUCCESS

(9)修改StaticConnectIdentifier参数,记得两个数据库都要修改。

DGMGRL>  edit database ogg set property  StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.80)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ogg)(SERVER=DEDICATED)))';

DGMGRL>  edit database dogg set property  StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.90)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dogg)(SERVER=DEDICATED)))';

(10)开始切换

DGMGRL>  switchover to dogg;

Performing switchover NOW, please wait...

Operation requires a connection to instance "dogg" on database "dogg"

Connecting to instance "dogg"...

Connected.

New primary database "dogg" is opening...

Operation requires startup of instance "ogg" on database "ogg"

Starting instance "ogg"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "dogg"

(11)查看状态

DGMGRL> show configuration;

Configuration - oggdg

  Protection Mode: MaxPerformance

  Databases:

    dogg - Primary database

    ogg  - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

(12)再次切换回去

DGMGRL> switchover to ogg;

感谢你能够认真阅读完这篇文章,希望小编分享的“DG Broker如何搭建”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

DG Broker如何搭建

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

2024-04-02

​Oracle 11g dg broker如何自动failover

这篇文章主要为大家展示了“Oracle 11g dg broker如何自动failover”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Oracle 11g dg broker如何自动failo
2023-06-03

oracle 11g dg broker如何开启和配置

这篇文章主要为大家展示了“oracle 11g dg broker如何开启和配置”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“oracle 11g dg broker如何开启和配置”这篇文章
2023-06-03

编程热搜

目录