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;

相关推荐
搬山境KL攻城狮32 分钟前
ssh密钥对使用
运维·ssh
道亦无名1 小时前
Linux下是STM32的编译修改配置文件tensorflow
linux·运维
悦数图数据库2 小时前
图数据库如何重塑行业智能决策 | 破局金融数据关联困局 悦数图数据库
数据库·金融
2401_879693872 小时前
Python深度学习入门:TensorFlow 2.0/Keras实战
jvm·数据库·python
Azure DevOps2 小时前
Azure DevOps Server:2026年3月份补丁
运维·microsoft·azure·devops
Nsequence3 小时前
图书馆-读者等级(附:MySQL)
数据库·mysql
知识分享小能手6 小时前
Redis入门学习教程,从入门到精通,Redis 概述:知识点详解(1)
数据库·redis·学习
xixihaha13248 小时前
将Python Web应用部署到服务器(Docker + Nginx)
jvm·数据库·python
wanhengidc8 小时前
云手机的运行环境如何
运维·服务器·游戏·智能手机·生活
夕除8 小时前
Mysql--07
数据库·mysql