Bo's Oracle Station

【博客文章2023】超远程MAA Oracle Dataguard主备库网络优化

2023-4-15 11:58| 发布者: admin| 查看: 12| 评论: 0

摘要: 来自真实生产环境案例,主备库两处地理位置距离很远,网络有足够的带宽但是略有延迟。为了应对这种使用场景,主机station4.example.com上运行有Far sync实例c01FS;主机station6.example.com上运行有Far sync实例c02FS。在该dataguard环境之上还配置有全局数据服务。整套系统的listener.ora、sqlnet.ora和tnsnames.ora都进行了优化。
【博客文章2023】超远程MAA Oracle Dataguard主备库网络优化

Author: Bo Tang

1. 带有Far sync的MAA起始环境:

    实验的起始环境是:在主机station3.example.com和主机station4.example.com上运行着名为c01orcl.example.com的RAC数据库(版本12.2.0.1);在主机station5.example.com和主机station6.example.com上运行着名为c02orcl.example.com的RAC数据库(版本12.2.0.1)。c01orcl.example.com为主库,c02orcl.example.com为物理备库。
   主机station3.example.com和主机station4.example.com地理位置在一起;主机station5.example.com和主机station6.example.com地理位置在一起。主备库两处地理位置距离很远,网络有足够的带宽但是略有延迟。为了应对这种使用场景,主机station4.example.com上运行有Far sync实例c01FS;主机station6.example.com上运行有Far sync实例c02FS。在该dataguard环境之上还配置有全局数据服务:station3.example.com主机上运行有gsm(gsm名字为gsmc01orcl,其region为regc01orcl);station5.example.com主机上运行有gsm(gsm名字为gsmc02orcl,其region为regc02orcl)。GDS的pool为sales,管理着dataguard broker,并运行着两个全局服务:sales_r和sales_r2。
   dataguard状态正常

[oracle@station3 ~]$ dgmgrl
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Thu Apr 13 07:38:08 2023

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle_4U@c01orcl
Connected to "c01orcl"
Connected as SYSDBA.
DGMGRL> show configuration verbose;

Configuration - dgconfig

  Protection Mode: MaxAvailability
  Members:
  c01orcl - Primary database
    c01FS   - Far sync instance 
      c02orcl - Physical standby database 

  Members Not Receiving Redo:
  c02FS   - Far sync instance 

  Properties:
    FastStartFailoverThreshold      = '10'
    OperationTimeout                = '30'
    TraceLevel                      = 'USER'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    ObserverReconnect               = '0'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'
    ObserverOverride                = 'FALSE'
    ExternalDestination1            = ''
    ExternalDestination2            = ''
    PrimaryLostWriteAction          = 'CONTINUE'
    ConfigurationWideServiceName    = ''

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

2. 优化grid用户的listener.ora:

    在station3.example.com和station4.example.com这两台主机优化/u01/app/12.2.0/grid/network/admin/listener.ora:

ASMNET2LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET2LSNR_ASM))))              # line added by Agent
ASMNET1LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM))))              # line added by Agent
MGMTLSNR=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=MGMTLSNR))))            # line added by Agent
# listener.ora Network Configuration File: /u01/app/12.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3 = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2 = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF             # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=OFF             # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF             # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER = SUBNET

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_2)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01FS.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01FS)
    )
  )


SID_LIST_LISTENER_SCAN3 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_2)
    )
)

SID_LIST_LISTENER_SCAN2 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_2)
    )
)

SID_LIST_LISTENER_SCAN1 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c01orcl_2)
    )
)

LISTENER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON

LISTENER_SCAN3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

LISTENER_SCAN2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

LISTENER_SCAN1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_MGMTLSNR=ON              # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_MGMTLSNR=SUBNET                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET1LSNR_ASM=ON               # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET1LSNR_ASM=SUBNET         # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET2LSNR_ASM=ON               # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET2LSNR_ASM=SUBNET         # line added by Agent
REGISTRATION_INVITED_NODES_ASMNET1LSNR_ASM=()           # line added by Agent
REGISTRATION_INVITED_NODES_ASMNET2LSNR_ASM=()           # line added by Agent

    重新启动监听器和scan监听器:

[grid@station3 admin]$ srvctl stop listener
[grid@station3 admin]$ srvctl stop scan_listener
[grid@station3 admin]$ srvctl start listener
[grid@station3 admin]$ srvctl start scan_listener

    在station5.example.com和station6.example.com这两台主机优化/u01/app/12.2.0/grid/network/admin/listener.ora:

ASMNET2LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET2LSNR_ASM))))              # line added by Agent
ASMNET1LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM))))              # line added by Agent
MGMTLSNR=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=MGMTLSNR))))            # line added by Agent
# listener.ora Network Configuration File: /u01/app/12.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3 = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2 = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF             # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=OFF             # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF             # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER = SUBNET

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_2)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01FS.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02FS)
    )
  )


SID_LIST_LISTENER_SCAN3 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_2)
    )
)

SID_LIST_LISTENER_SCAN2 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_2)
    )
)

SID_LIST_LISTENER_SCAN1 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
      (SID_NAME = c02orcl_2)
    )
)

LISTENER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON

LISTENER_SCAN3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

LISTENER_SCAN2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

LISTENER_SCAN1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
  )

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_MGMTLSNR=ON              # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_MGMTLSNR=SUBNET                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET1LSNR_ASM=ON               # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET1LSNR_ASM=SUBNET         # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET2LSNR_ASM=ON               # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET2LSNR_ASM=SUBNET         # line added by Agent
REGISTRATION_INVITED_NODES_ASMNET1LSNR_ASM=()           # line added by Agent
REGISTRATION_INVITED_NODES_ASMNET2LSNR_ASM=()           # line added by Agent

    重新启动监听器和scan监听器:

[grid@station5 admin]$ srvctl stop listener
[grid@station5 admin]$ srvctl stop scan_listener
[grid@station5 admin]$ srvctl start listener
[grid@station5 admin]$ srvctl start scan_listener

3. 优化oracle用户和grid用户的sqlnet.ora:

    为了处理TCP协议栈里的缓冲区刷新延迟,需要禁用TCP Nagle算法。在主机station3.example.com、主机station4.example.com、主机station5.example.com和主机station6.example.com这四台主机上的grid用户的目录下的/u01/app/12.2.0/grid/network/admin/sqlnet.ora里添加一行,成为这样:

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
TCP.NODELAY=YES

   在主机station3.example.com、主机station4.example.com、主机station5.example.com和主机station6.example.com这四台主机上的Oracle用户的目录下创建/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/sqlnet.ora:

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
TCP.NODELAY=YES

4. 优化oracle用户和tnsnames.ora:

    主机station3.example.com、主机station4.example.com、主机station5.example.com和主机station6.example.com这四台主机上的Oracle用户的目录下/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora改成如下这样:

SALES_R2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = station3.example.com)(PORT = 1571)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
      (ADDRESS = (PROTOCOL = TCP)(HOST = station5.example.com)(PORT = 1572)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
    (SDU = 2097152)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = sales_r2.sales.oradbcloud)
    )
  )

C01FS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = station4.example.com)(PORT = 1521)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
    (SDU = 2097152)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = c01FS.example.com)
    )
  )


SALES_R =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = station3.example.com)(PORT = 1571)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
      (ADDRESS = (PROTOCOL = TCP)(HOST = station5.example.com)(PORT = 1572)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
    (SDU = 2097152)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = sales_r.sales.oradbcloud)
    )
  )

C02FS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = station6.example.com)(PORT = 1521)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
    (SDU = 2097152)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = c02FS.example.com)
    )
  )

C02ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = scan.cluster5.example.com)(PORT = 1521)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
    (SDU = 2097152)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = c02orcl.example.com)
    )
  )

C01ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = scan.cluster3.example.com)(PORT = 1521)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))
    )
    (SDU = 2097152)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = c01orcl.example.com)
    )
  )

5. 验证配置:

    验证tnsnames.ora

[oracle@station3 ~]$ tnsping  c01orcl 

TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 14-APR-2023 13:47:10

Copyright (c) 1997, 2016, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = scan.cluster3.example.com)(PORT = 1521)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))) (SDU = 2097152) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = c01orcl.example.com)))
OK (80 msec)

[oracle@station3 ~]$ tnsping  c02orcl

TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 14-APR-2023 13:48:06

Copyright (c) 1997, 2016, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = scan.cluster5.example.com)(PORT = 1521)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))) (SDU = 2097152) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = c02orcl.example.com)))
OK (70 msec)

[oracle@station3 ~]$ tnsping  sales_r

TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 14-APR-2023 13:48:44

Copyright (c) 1997, 2016, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = station3.example.com)(PORT = 1571)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760)) (ADDRESS = (PROTOCOL = TCP)(HOST = station5.example.com)(PORT = 1572)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))) (SDU = 2097152) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sales_r.sales.oradbcloud)))
OK (30 msec)

[oracle@station3 ~]$ tnsping  sales_r2

TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 14-APR-2023 13:49:08

Copyright (c) 1997, 2016, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = station3.example.com)(PORT = 1571)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760)) (ADDRESS = (PROTOCOL = TCP)(HOST = station5.example.com)(PORT = 1572)(SEND_BUF_SIZE = 10485760)(RECV_BUF_SIZE = 10485760))) (SDU = 2097152) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sales_r2.sales.oradbcloud)))
OK (10 msec)


   验证dataguard broker

[oracle@station3 ~]$ dgmgrl
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Fri Apr 14 13:50:49 2023

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle_4U@c01orcl
Connected to "c01orcl"
Connected as SYSDBA.
DGMGRL> VALIDATE DATABASE  VERBOSE  c01orcl

  Database Role:    Primary database

  Ready for Switchover:  Yes

  Flashback Database Status:
    c01orcl:  On
    c02orcl:  On

  Capacity Information:
    Database  Instances        Threads        
    c01orcl   2                2              

  Managed by Clusterware:
    c01orcl:  YES            

  Temporary Tablespace File Information:
    c01orcl TEMP Files:  1

  Data file Online Move in Progress:
    c01orcl:  No

  Transport-Related Information:
    Transport On:  Yes

  Log Files Cleared:
    c01orcl Standby Redo Log Files:  Cleared

  Automatic Diagnostic Repository Errors:
    Error                       c01orcl
    No logging operation        NO     
    Control file corruptions    NO     
    System data file missing    NO     
    System data file corrupted  NO     
    System data file offline    NO     
    User data file missing      NO     
    User data file corrupted    NO     
    User data file offline      NO     
    Block Corruptions found     NO     

DGMGRL> VALIDATE DATABASE  VERBOSE c02orcl

  Database Role:     Physical standby database
  Primary Database:  c01orcl

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Flashback Database Status:
    c01orcl:  On
    c02orcl:  On

  Capacity Information:
    Database  Instances        Threads        
    c01orcl   2                2              
    c02orcl   2                2              

  Managed by Clusterware:
    c01orcl:  YES            
    c02orcl:  YES            

  Temporary Tablespace File Information:
    c01orcl TEMP Files:  1
    c02orcl TEMP Files:  1

  Data file Online Move in Progress:
    c01orcl:  No
    c02orcl:  No

  Standby Apply-Related Information:
    Apply State:      Running
    Apply Lag:        0 seconds (computed 1 second ago)
    Apply Delay:      0 minutes

  Transport-Related Information:
    Transport On:      Yes
    Gap Status:        No Gap
    Transport Lag:     0 seconds (computed 1 second ago)
    Transport Status:  Success

  Log Files Cleared:
    c01orcl Standby Redo Log Files:  Cleared
    c02orcl Online Redo Log Files:   Cleared
    c02orcl Standby Redo Log Files:  Available

  Current Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status       
              (c01orcl)               (c02orcl)                            
    1         2                       3                       Sufficient SRLs
    2         2                       3                       Sufficient SRLs

  Future Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status       
              (c02orcl)               (c01orcl)                            
    1         2                       3                       Sufficient SRLs
    2         2                       3                       Sufficient SRLs

  Current Configuration Log File Sizes:
    Thread #   Smallest Online Redo      Smallest Standby Redo    
               Log File Size             Log File Size            
               (c01orcl)                 (c02orcl)                
    1          50 MBytes                 50 MBytes                
    2          50 MBytes                 50 MBytes                

  Future Configuration Log File Sizes:
    Thread #   Smallest Online Redo      Smallest Standby Redo    
               Log File Size             Log File Size            
               (c02orcl)                 (c01orcl)                
    1          50 MBytes                 50 MBytes                
    2          50 MBytes                 50 MBytes                

  Apply-Related Property Settings:
    Property                        c01orcl Value            c02orcl Value
    DelayMins                       0                        0
    ApplyParallel                   AUTO                     AUTO
    ApplyInstances                  0                        0

  Transport-Related Property Settings:
    Property                        c01orcl Value            c02orcl Value
    LogXptMode                      SYNC                     SYNC
    Dependency                                       
    DelayMins                       0                        0
    Binding                         optional                 optional
    MaxFailure                      0                        0
    MaxConnections                  1                        1
    ReopenSecs                      300                      300
    NetTimeout                      30                       30
    RedoCompression                 DISABLE                  DISABLE
    LogShipping                     ON                       ON

  Automatic Diagnostic Repository Errors:
    Error                       c01orcl  c02orcl
    No logging operation        NO       NO     
    Control file corruptions    NO       NO     
    SRL Group Unavailable       NO       NO     
    System data file missing    NO       NO     
    System data file corrupted  NO       NO     
    System data file offline    NO       NO     
    User data file missing      NO       NO     
    User data file corrupted    NO       NO     
    User data file offline      NO       NO     
    Block Corruptions found     NO       NO    

DGMGRL> VALIDATE FAR_SYNC VERBOSE  'c01FS'
    Member Role:        Far Sync Instance   
    When Primary Is:    c01orcl             

    Active Redo Source: c01orcl             
    Redo Destinations:                      
                        c02orcl             

    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status       
              c01orcl                 c01FS                                
    1         2                       3                       Sufficient SRLs
    2         2                       3                       Sufficient SRLs

  Transport-Related Information:
    Transport On:      Yes
    Gap Status:        No Gap
    Transport Lag:     0 seconds (computed 0 seconds ago)
    Transport Status:  Success

DGMGRL> VALIDATE FAR_SYNC VERBOSE  'c02FS' WHEN PRIMARY IS c02orcl;
    Member Role:        Far Sync Instance   
    When Primary Is:    c02orcl             
    Redo Destinations:                      
                        c01orcl             

    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status       
              c02orcl                 c02FS                                
    1         2                       3                       Sufficient SRLs
    2         2                       3                       Sufficient SRLs

DGMGRL> show configuration verbose;

Configuration - dgconfig

  Protection Mode: MaxAvailability
  Members:
  c01orcl - Primary database
    c01FS   - Far sync instance 
      c02orcl - Physical standby database 

  Members Not Receiving Redo:
  c02FS   - Far sync instance 

  Properties:
    FastStartFailoverThreshold      = '10'
    OperationTimeout                = '30'
    TraceLevel                      = 'USER'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    ObserverReconnect               = '0'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'
    ObserverOverride                = 'FALSE'
    ExternalDestination1            = ''
    ExternalDestination2            = ''
    PrimaryLostWriteAction          = 'CONTINUE'
    ConfigurationWideServiceName    = ''

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

   验证GDS

[oracle@station3 ~]$ gdsctl
GDSCTL: Version 12.2.0.1.0 - Production on Thu Apr 13 16:46:41 CST 2023

Copyright (c) 2011, 2016, Oracle.  All rights reserved.

Welcome to GDSCTL, type "help" for information.

Current GSM is set to GSMC01ORCL
GDSCTL>connect mygdsadmin/oracle_4U@gdscat
Catalog connection is established
GDSCTL>stop gsm -gsm  gsmc01orcl
GSM is stopped successfully
GDSCTL>start gsm -gsm gsmc01orcl
GSM is started successfully

[oracle@station5 ~]$ gdsctl
GDSCTL: Version 12.2.0.1.0 - Production on Thu Apr 13 17:17:24 CST 2023

Copyright (c) 2011, 2016, Oracle.  All rights reserved.

Welcome to GDSCTL, type "help" for information.

Current GSM is set to GSMC02ORCL
GDSCTL>connect mygdsadmin/oracle_4U@gdscat
Catalog connection is established
GDSCTL>stop gsm -gsm gsmc02orcl
GSM is stopped successfully
GDSCTL>start gsm -gsm gsmc02orcl
GSM is started successfully
GDSCTL>databases
Database: "c01orcl" Registered: Y State: Ok ONS: Y. Role: PRIMARY Instances: 2 Region: regc01orcl
   Service: "sales_r" Globally started: Y Started: N
            Scan: Y Enabled: Y Preferred: Y
   Service: "sales_r2" Globally started: Y Started: N
            Scan: Y Enabled: Y Preferred: Y
   Registered instances:
     sales%1
     sales%2
Database: "c02orcl" Registered: Y State: Warnings ONS: Y. Role: PH_STNDBY Instances: 2 Region: regc02orcl
   Service: "sales_r" Globally started: Y Started: Y
            Scan: Y Enabled: Y Preferred: Y
   Service: "sales_r2" Globally started: Y Started: Y
            Scan: Y Enabled: Y Preferred: Y
   Registered instances:
     sales%11
     sales%12



GDSCTL>services
Service "sales_r.sales.oradbcloud" has 2 instance(s). Affinity: ANYWHERE
   Instance "sales%11", name: "c02orcl_1", db: "c02orcl", region: "regc02orcl", status: ready.
   Instance "sales%12", name: "c02orcl_2", db: "c02orcl", region: "regc02orcl", status: ready.
Service "sales_r2.sales.oradbcloud" has 2 instance(s). Affinity: ANYWHERE
   Instance "sales%11", name: "c02orcl_1", db: "c02orcl", region: "regc02orcl", status: ready.
   Instance "sales%12", name: "c02orcl_2", db: "c02orcl", region: "regc02orcl", status: ready.


路过

雷人

握手

鲜花

鸡蛋

QQ|手机版|Bo's Oracle Station   

GMT+8, 2023-4-16 18:28 , Processed in 0.035570 second(s), 21 queries .

返回顶部