Oracle ADG ,DGBroker管理,异常断电重启主备库的状态

Oracle ADG ,DGBroker管理,异常断电重启主备库的状态

在前面3期文章中,分别做了ORACLE 19C 的静默安装,ORACLE 19C ADG的搭建配置,DG BROKER的配置。

系统运行正常。

在这一期的文章中,我们将演示在主备机器都异常断电的情况下,数据库的状态,DGBROKER的状态,以及数据是否丢失等。

链接: oracle19c dgbroker配置全过程,附命令参数解析【实践分享不留坑】

链接: oracle 19c搭建dataguard(ADG)全过程

链接: Oracle19c 静默安装全过程

  1. 先启动主库

    [oracle@mgrser1 ~]$ lsnrctl start

    LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-NOV-2025 02:37:16

    Copyright (c) 1991, 2019, Oracle. All rights reserved.

    Starting /oradb/oracle/product/19.3/dbhome_1/bin/tnslsnr: please wait...

    TNSLSNR for Linux: Version 19.0.0.0.0 - Production
    System parameter file is /oradb/oracle/product/19.3/dbhome_1/network/admin/listener.ora
    Log messages written to /oradb/oracle/diag/tnslsnr/mgrser1/listener/alert/log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mgrser1)(PORT=1521)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mgrser1)(PORT=1521)))
    STATUS of the LISTENER

    Alias LISTENER
    Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
    Start Date 04-NOV-2025 02:37:18
    Uptime 0 days 0 hr. 0 min. 0 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /oradb/oracle/product/19.3/dbhome_1/network/admin/listener.ora
    Listener Log File /oradb/oracle/diag/tnslsnr/mgrser1/listener/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mgrser1)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    Services Summary...
    Service "woo" has 1 instance(s).
    Instance "woo", status UNKNOWN, has 1 handler(s) for this service...
    Service "woo_DGMGRL" has 1 instance(s).
    Instance "woo", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@mgrser1 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 4 02:37:23 2025
    Version 19.3.0.0.0

    Copyright (c) 1982, 2019, Oracle. All rights reserved.

    Connected to an idle instance.

    SQL> startup
    ORACLE instance started.

    Total System Global Area 2466249672 bytes
    Fixed Size 8899528 bytes
    Variable Size 536870912 bytes
    Database Buffers 1912602624 bytes
    Redo Buffers 7876608 bytes
    Database mounted.
    Database opened.
    SQL>

2、启动备库

复制代码
[root@mgrser2 ~]# su - oracle
Last login: Sun Nov  2 22:17:44 EST 2025 on pts/1
[oracle@mgrser2 ~]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-NOV-2025 02:37:17

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Starting /oradb/oracle/product/19.3/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /oradb/oracle/product/19.3/dbhome_1/network/admin/listener.ora
Log messages written to /oradb/oracle/diag/tnslsnr/mgrser2/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mgrser2)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mgrser2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                04-NOV-2025 02:37:19
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oradb/oracle/product/19.3/dbhome_1/network/admin/listener.ora
Listener Log File         /oradb/oracle/diag/tnslsnr/mgrser2/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mgrser2)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "woo" has 1 instance(s).
  Instance "woo", status UNKNOWN, has 1 handler(s) for this service...
Service "woostd_DGMGRL" has 1 instance(s).
  Instance "woo", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@mgrser2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 4 02:37:23 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2466249672 bytes
Fixed Size                  8899528 bytes
Variable Size             536870912 bytes
Database Buffers         1912602624 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> 

3、查看主备库状态以及DG同步状态

复制代码
SQL> select database_role,open_mode from v$database;

DATABASE_ROLE    OPEN_MODE
---------------- --------------------
PRIMARY          READ WRITE

SQL> 

SQL> select database_role,open_mode from v$database;

DATABASE_ROLE    OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY

SQL> 

--主库切换日志


SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     31
Next log sequence to archive   33
Current log sequence           33
SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     32
Next log sequence to archive   34
Current log sequence           34
SQL> 
SQL> 

SQL> 
SQL> select process,status,sequence# from v$managed_standby;

PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CONNECTED             0
DGRD      ALLOCATED             0
DGRD      ALLOCATED             0
ARCH      CONNECTED             0
ARCH      CONNECTED             0
ARCH      CLOSING              32
RFS       IDLE                 33
RFS       IDLE                  0
RFS       IDLE                  0
MRP0      APPLYING_LOG         33

10 rows selected.

SQL> /

PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CONNECTED             0
DGRD      ALLOCATED             0
DGRD      ALLOCATED             0
ARCH      CONNECTED             0
ARCH      CLOSING              33
ARCH      CLOSING              32
RFS       IDLE                 34
RFS       IDLE                  0
RFS       IDLE                  0
MRP0      APPLYING_LOG         34

10 rows selected.

SQL> 

4、查看DGBROKER 正常

复制代码
DGMGRL> show configuration;

Configuration - woo_broker_cfg

  Protection Mode: MaxPerformance
  Members:
  woo    - Primary database
    woostd - Physical standby database 

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 18 seconds ago)

DGMGRL> show configuration verbose;

Configuration - woo_broker_cfg

  Protection Mode: MaxPerformance
  Members:
  woo    - Primary database
    woostd - Physical standby database 

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

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS

DGMGRL> 
相关推荐
phltxy5 分钟前
Redis 常见面试题
数据库·redis·缓存
IpdataCloud5 分钟前
IP查询工具怎么选?在线API vs IP离线库:精度、速度、成本、隐私全对比
服务器·网络·数据库
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ6 分钟前
MySQL选择字符集和排序规则
数据库·mysql
旺仔Sec12 分钟前
HBase 分布式集群部署实战:从解压到启动的完整指南
数据库·分布式·hbase
Gauss松鼠会13 分钟前
GaussDB(DWS) 资源监控Topsql
java·网络·数据库·算法·oracle·性能优化·gaussdb
小碗羊肉14 分钟前
【Redis | 第二篇】Jedis&SpringDataRedis
数据库·redis·缓存
郝学胜-神的一滴18 分钟前
系统设计 012:从用户系统出发,吃透缓存、数据库与高并发设计
java·数据库·python·缓存·php·软件构建
米高梅狮子19 分钟前
01.ELK企业日志分析系统
运维·服务器·网络·数据库·elk·oracle
小杍随笔21 分钟前
【redb vs SQLite (rusqlite) 技术选型对比】
数据库·sqlite
暗夜猎手-大魔王22 分钟前
转载--AI Agent 架构设计:工具返回值设计(OpenClaw、Claude Code、Hermes Agent 对比)
数据库