温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

12c DataGuard Broker配置步骤

发布时间:2020-07-05 07:20:21 来源:网络 阅读:984 作者:roidba 栏目:关系型数据库

一、描述

Oracle 12c

RHEL 7.3


二、配置DataGuard Broker

1.源端

sqlplus / as sysdba

alter system set dg_broker_config_file1='/oracle/oradata/orcl/dr1.dat';

alter system set dg_broker_config_file2='/oracle/oradata/orcl/dr2.dat';

alter system set dg_broker_start=true;


2.目的端

sqlplus / as sysdba

alter system set dg_broker_config_file1='/oracle/oradata/orcl/dr1.dat';

alter system set dg_broker_config_file2='/oracle/oradata/orcl/dr2.dat';

alter system set dg_broker_start=true;


3.查看dmon进程

<roidb01:orcl:/oracle/oradata/orcl>$ps -ef|grep dmon

oracle    5768     1  0 20:28 ?        00:00:00 ora_dmon_orcl

oracle    5773  4404  0 20:28 pts/1    00:00:00 grep --color=auto dmon


4.配置DG

源端使用oracle用户执行

<roidb01:orcl:/home/oracle>$dgmgrl /

DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production


Copyright (c) 2000, 2013, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

Connected as SYSDG.

DGMGRL> create configuration 'dg_config' as  primary database is 'orcl' connect identifier is orcl;

Error: ORA-16698: LOG_ARCHIVE_DEST_n parameter set for object to be added


Failed.

DGMGRL> 


5.查看报错

<roidb01:orcl:/home/oracle>$oerr ora 16698

16698, 0000, "LOG_ARCHIVE_DEST_n parameter set for object to be added"

// *Cause:  One or more LOG_ARCHIVE_DEST_n initialization parameters that

//          contain a SERVICE attribute but not the NOREGISTER attribute were

//          set when attempting to create a configuration or add a standby or

//          far sync instance to the configuration.

// *Action: If creating a configuration, clear all LOG_ARCHIVE_DEST_n

//          initialization parameters that contain a SERVICE attribute but not

//          the NOREGISTER attribute. If adding a standby database or far sync

//          instance, clear the LOG_ARCHIVE_DEST_n initialization parameter

//          that specifies the database or far sync instance to be added.

<roidb01:orcl:/home/oracle>$


6.报错处理

主库备库都需要执行!!!

这个错误可以通过在Primary 和 Standby上取消log_archive_dest_n参数来解决,

实际这一块的参数应当是交给DG broker 来管理了,不再需要人为介入设置。


SQL> alter system reset log_archive_dest_2;  

System altered.


SQL> alter system reset log_archive_dest_1;

System altered.


SQL> startup force;

ORACLE instance started.


Total System Global Area 1560281088 bytes

Fixed Size                  2924784 bytes

Variable Size            1006636816 bytes

Database Buffers          536870912 bytes

Redo Buffers               13848576 bytes

Database mounted.

Database opened.

SQL> 



7.配置、启用、查看DG

<roidb01:orcl:/home/oracle>$dgmgrl /

DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production


Copyright (c) 2000, 2013, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

Connected as SYSDG.

DGMGRL> 

DGMGRL> create configuration 'dg_config' as  primary database is 'orcl' connect identifier is orcl;

Configuration "dg_config" created with primary database "orcl"

DGMGRL> add database 'orcldg' as connect identifier is orcldg;

Database "orcldg" added

DGMGRL> 

DGMGRL> enable configuration;

Enabled.

DGMGRL> show configuration;


Configuration - dg_config


  Protection Mode: MaxPerformance

  Members:

  orcl   - Primary database

    orcldg - Physical standby database 


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS   (status updated 6 seconds ago)


DGMGRL> 


三、小结

本来测试环境DG没有使用broker,不过客户的环境都是broker来管理,

只好把自己的环境修改为broker的管理方式。


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI