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;

相关推荐
jnrjian3 分钟前
Oracle 计算表 + LOBs 大小
oracle
Leon-Ning Liu6 分钟前
Oracle恢复DELETE数据的PACKAGE(介绍篇)(仅做研究使用)
数据库·oracle
daad7779 分钟前
sitl_5760_io记录
linux·运维·服务器
l1t11 分钟前
DeepSeek总结的从 DeepSeek 到 Quack:分布式 DuckDB 的梦想何时开始变得真实
数据库·分布式
Albert Edison13 分钟前
【Docker】镜像仓库(Registry)
运维·docker·容器
小猿姐14 分钟前
MongoDB Kubernetes Operator 实测对比:Community、Percona 与 KubeBlocks,谁更适合团队落地?
数据库·mongodb·kubernetes
小则又沐风a15 分钟前
今日算法----一篇文章学会背包问题
运维·服务器·算法
zyl8372120 分钟前
Matplotlib/Seaborn:数据可视化
数据库·oracle
赵渝强老师20 分钟前
【赵渝强老师】MongoDB的视图
数据库·mongodb