暂无图片
哪个大佬能彻底把DG中的VALID_FOR这个参数讲清楚,谢谢
我来答
分享
暂无图片 匿名用户
哪个大佬能彻底把DG中的VALID_FOR这个参数讲清楚,谢谢
暂无图片 5M
以下是官方文档的解释,但是在实际使用中还是不清楚这个到底要怎么设置,请大佬详细解释一下,非常感谢
  • The VALID_FOR attribute is optional. However, Oracle recommends that the VALID_FOR attribute be specified for each redo transport destination at each database in a Data Guard configuration so that redo transport continues after a role transition to any standby database in the configuration.

  • To configure these factors for each LOG_ARCHIVE_DEST_n destination, you specify this attribute with a pair of keywords: VALID_FOR=(redo_log_type,database_role):

    • The redo_log_type keyword identifies the destination as valid for archiving one of the following:

      • ONLINE_LOGFILE—This destination is valid only when archiving online redo log files.

      • STANDBY_LOGFILE—This destination is valid only when archiving standby redo log files.

      • ALL_LOGFILES— This destination is valid when archiving either online redo log files or standby redo log files.

    • The database_role keyword identifies the role in which this destination is valid for archiving:

      • PRIMARY_ROLE—This destination is valid only when the database is running in the primary role.

      • STANDBY_ROLE—This destination is valid only when the database is running in the standby role.

      • ALL_ROLES—This destination is valid when the database is running in either the primary or the standby role.

  • If you do not specify the VALID_FOR attribute for a destination, by default, archiving online redo log files and standby redo log files is enabled at the destination, regardless of whether the database is running in the primary or the standby role. This default behavior is equivalent to setting the (ALL_LOGFILES,ALL_ROLES) keyword pair on the VALID_FOR attribute.

  • The VALID_FOR attribute enables you to use the same initialization parameter file for both the primary and standby roles.

我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
你好我是李白

要搞明白VALID_FOR参数,首先要明白log_archive_dest_n参数含义。

1.log_archive_dest_n

简而言之就是归档位置存储位置,所以DG的配置也只不过是把归档存储位置更改为DG这个库,即归档日志发送一份到DG库,当然log_archive_dest_n根据n编号不同也有不同配置,这个就可以参考官方文档了。

明白上面这个参数含义,那么接下来就可以看valid_for参数了。

2.valid_for

2.1 online_logfile

意味着该log_archive_dest_n参数只在归档的是v$Logfile中type为ONLINE的联机日志时生效,那也就是在DG环境中,主库归档时生效的log_archive_dest_n。

2.2 standby_logfile

意味着该log_archive_dest_n参数只在归档的是v$logfile中type为standby的联机日志时生效,那么什么时候归档的是type为standby呢?那肯定是在配置了standby redo log日志组,数据库当前角色为physical standby,所以就会理解为什么在一主一备一级联配置中,中间的备库的log_archive_dest_n参数发送到级联库时,为什么要配置的valid_for为standby_logfile。

3. database role

理解了上面就好理解数据库角色配置了,即当配置log_archive_dest_n参数的库在
select DATABASE_ROLE from v$database;
查询中为对应设置角色,归档日志才发送到该log_archive_dest_n设置。

暂无图片 评论
暂无图片 有用 2
JiekeXu
暂无图片

可以看看这篇,前几天总结的官方文档的加强版《爆肝一万字终于把 Oracle Data Guard 核心参数搞明白了》

https://mp.weixin.qq.com/s/m1S-ElWOYf_h2kcrre5HNA

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏