ITPub博客

首页 > 数据库 > Oracle > [20201110]How to get the Data Guard broker configuration from a SQL query.txt

[20201110]How to get the Data Guard broker configuration from a SQL query.txt

原创 Oracle 作者:lfree 时间:2020-11-10 10:13:28 0 删除 编辑

[20201110]How to get the Data Guard broker configuration from a SQL query.txt

--//链接:http://www.ludovicocaldara.net/dba/get-broker-config-sql/
--//介绍一种方法如果设置dg broker的情况下,可以通过sql语句查询,做一个记录:

SYS@xxxx1> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SELECT piv.*, obj.status
  FROM (SELECT object_id, attribute, VALUE
          FROM x$drc
         WHERE object_id IN (SELECT object_id
                               FROM x$drc
                              WHERE attribute = 'DATABASE')) drc PIVOT (MAX
                                                                        (
                                                                           VALUE
                                                                        )
                                                                    FOR attribute
                                                                    IN ('DATABASE' DATABASE
                                                                      ,'intended_state' intended_state
                                                                      ,'connect_string' connect_string
                                                                      ,'RAC' RAC
                                                                      ,'enabled' enabled
                                                                      ,'role' role
                                                                      ,'receive_from' receive_from
                                                                      ,'ship_to' ship_to
                                                                      ,'dgb_connect' dgb_connect
                                                                      ,-- 'static_connect_identifier'    static_connect_identifier    ,
                                                                       'FSFOTargetValidity' FSFOTargetValidity)) piv
       JOIN x$drc obj
          ON (obj.object_id = piv.object_id AND obj.attribute = 'DATABASE');

SYS@xxxx1> @ &r/prxx
==============================
OBJECT_ID                     : 16842752
DATABASE                      : xxxx
INTENDED_STATE                : READ-WRITE-XPTON
CONNECT_STRING                : xxxx
RAC                           : YES
ENABLED                       : YES
ROLE                          : PRIMARY
RECEIVE_FROM                  :
SHIP_TO                       :
DGB_CONNECT                   :
FSFOTARGETVALIDITY            :
STATUS                        : SUCCESS
==============================
OBJECT_ID                     : 33619968
DATABASE                      : xxxxdg
INTENDED_STATE                : PHYSICAL-APPLY-ON
CONNECT_STRING                : xxxxdg
RAC                           : NO
ENABLED                       : YES
ROLE                          : PHYSICAL
RECEIVE_FROM                  :
SHIP_TO                       :
DGB_CONNECT                   :
FSFOTARGETVALIDITY            :
STATUS                        : SUCCESS
==============================
OBJECT_ID                     : 50397184
DATABASE                      : xxxxdg2
INTENDED_STATE                : OFFLINE
CONNECT_STRING                : xxxxdg2
RAC                           : NO
ENABLED                       : NO
ROLE                          : PHYSICAL
RECEIVE_FROM                  :
SHIP_TO                       :
DGB_CONNECT                   :
FSFOTARGETVALIDITY            :
STATUS                        : SHUTDOWN
PL/SQL procedure successfully completed.

--//有一台机器offline,马上检查看看。
         

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2733180/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969454