oracle DG broken工具配置

1)broken配置

可以在主库/备库/额外一台上配置

修改监听:

vi $ORACLE_HOME/network/admin/listener.ora

主库(新增如下代码):

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME= orcl)

(ORACLE_HOME =/oracle/app/product/11.2.0/db_1)

(SID_NAME =orcl)

)

(SID_DESC =

(GLOBAL_DBNAME=orcl_DGMGRL)

(ORACLE_HOME =/oracle/app/product/11.2.0/db_1)

(SID_NAME =orcl)

)

)

备库(新增):

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME= orcl_std)

(ORACLE_HOME =/oracle/app/product/11.2.0/db_1)

(SID_NAME =orcl)

)

(SID_DESC =

(GLOBAL_DBNAME=orcl_std_DGMGRL)

(ORACLE_HOME =/oracle/app/product/11.2.0/db_1)

(SID_NAME =orcl)

)

)

重启监听

lsnrctl reload

用tnsping进行检验是否配置正确。

2)参数设置(主备都要)

SQL> show parameter dg_broker_start

NAME TYPE VALUE


dg_broker_start boolean FALSE

SQL> alter system set dg_broker_start =true scope=both;

3)配置DG Broken

Oracle用户:

dgmgrl 执行命令

DGMGRL> connect sys/oracle

注意,这里有个bug:无论用什么密码连进去都是可以的,但最后切换时会报错

DGMGRL> help create

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

orcl为连接字符串

DGMGRL> help add

DGMGRL> add database orcl_std as connect identifier is orcl_std;

orcl_std为连接字符串

查看配置文件:

show configuration

启用配置文件:

enable configuration

停用配置:

disable configuration

显示数据库:

show database verbose orcl;

显示数据库状态报告:

show database orcl statusreport;


STATUS REPORT

INSTANCE_NAME SEVERITY ERROR_TEXT

yzw WARNING ORA-16714: the value of property ArchiveLagTarget is inconsistent with the database setting

yzw WARNING ORA-16714: the value of property LogArchiveMaxProcesses is inconsistent with the database setting

yzw WARNING ORA-16714: the value of property LogArchiveMinSucceedDest is inconsistent with the database setting


解决方法:重新定义以上参数

DGMGRL> edit database dbsty set property ArchiveLagTarget=0;

DGMGRL> edit database orcl set property LogFileNameConvert='/oracle/app/oradata/orcl/,/oracle/app/oradata/orcl/';

DGMGRL> edit database orcl_std set property LogFileNameConvert='/oracle/app/oradata/orcl/,/oracle/app/oradata/orcl/';

注意:LogFileNameConvert、LogFileNameConvert这两个参数dgmgrl读不到,需要重新配置一下

从主库连到备库的方法:

Sqlplus sys/oracle@orcl as sysdba

Ssqlplus sys/密码@tns中的名称 as sydba

检测是否开启DG Broken:

ps -ef | grep dmon

前提:

1.很重要,搭建dg broker 之前一定一定要使备库日志应用与主库一致;

2.DG broken 需要创建备库日志组 日志大小相同 推荐备库组数=主库组数+1

日志组数会自动增加

alter database add standby logfile ('/oracle/app/oradata/yzw/stdb_redo01.log') size 200m;

相关推荐
行走的bug...5 小时前
cmake总结
linux·运维·服务器
凌波粒5 小时前
Linux 面试题篇
linux·运维·服务器
列御寇5 小时前
MongoDB分片集群——集群组件概述
数据库·mongodb
Joren的学习记录5 小时前
【Linux运维疑难杂症】k8s集群创建calico网络失败
linux·运维·kubernetes
乾元5 小时前
现场运维机器人的工程化落地——移动探针采集 + AI 诊断,在真实网络中的实现路径
运维·网络·人工智能·架构·机器人·自动化
七夜zippoe5 小时前
领域驱动设计在Python中的实现:从理论到生产级实践
数据库·python·sqlite·ddd·pydantic
小CC吃豆子5 小时前
Qt的信号与槽机制
开发语言·数据库·qt
虾..5 小时前
Linux 线程控制
linux·运维·服务器
·云扬·5 小时前
系统与MySQL核心监控指标及操作指南
android·数据库·mysql
镜中人★5 小时前
408操作系统考纲知识点
linux·运维·服务器