Thứ Năm, 4 tháng 9, 2025

Cấu hình Oracle Data Guard Broker DGMGRL Oracle Data Guard 19c

Data Guard broker là một tiện ích giúp quản lý và cấu hình thông số Data Guard thông qua kết nối client.

  1. Tự động hoá triển khai và quản lý cấu hình:
    • Data Guard Broker cung cấp khả năng tự động hóa việc triển khai cấu hình Data Guard, bao gồm tạo và cấu hình bản sao dữ liệu (standby databases).
    • Nó giúp đơn giản hóa quá trình cấu hình và giảm thiểu nguy cơ phạm lỗi.
  2. Giám sát và quản lý trạng thái:
    • Data Guard Broker cung cấp khả năng giám sát và quản lý trạng thái của các bản sao dữ liệu (standby databases) và bản gốc (primary database) trong môi trường Data Guard.
    • Nó có thể tự động xác định và phản ứng với các sự cố, như mất kết nối hoặc sự cố phần cứng.
  3. Failover tự động:
    • Data Guard Broker cho phép thiết lập và thực hiện failover tự động từ bản gốc (primary) sang một bản sao dữ liệu (standby) trong trường hợp xảy ra sự cố.
  4. Switchover tự động:
    • Nó cũng hỗ trợ switchover tự động, cho phép việc chuyển đổi giữa bản sao dữ liệu (standby) và bản gốc (primary) được thực hiện một cách tự động và an toàn.
  5. Quản lý báo cáo và log:
    • Data Guard Broker cung cấp các báo cáo về trạng thái và hiệu suất của hệ thống Data Guard.
    • Nó cũng giúp quản lý log của Data Guard, bao gồm log về quá trình sao chép và log của Data Guard Broker.
  6. Tích hợp với Oracle Enterprise Manager (OEM):
    • Data Guard Broker có thể được tích hợp với Oracle Enterprise Manager (OEM) để cung cấp giao diện đồ họa và quản lý toàn diện cho môi trường Data Guard.

Các bạn có thể xem các bước dựng CSDL Data Guard tại đâyhttps://www.vietdba.vn/2025/09/huong-dan-cai-at-oracle-data-guard_4.html

THÔNG TIN CHI TIẾT 2 NODE:

word image 1070 1

SRV1 – server tôi đặt là Primary

SRV2 – server tôi đặt là Standby

Kiểm tra thông tin database:

Primary + Standby: kiểm tra thông tin DG broker và active nó nếu chưa active

show parameter dg_broker_start;

ALTER SYSTEM SET dg_broker_start=true scope=both;

show parameter dg_broker_start;

SQL> show parameter dg_broker_start;

NAME TYPE VALUE

———————————— ———– ——————————

dg_broker_start boolean FALSE

SQL> ALTER SYSTEM SET dg_broker_start=true scope=both;

System altered.

SQL> show parameter dg_broker_start;

NAME TYPE VALUE

———————————— ———– ——————————

dg_broker_start boolean TRUE

Primary: login vào database thông qua DGMGRL

exit

dgmgrl

connect sys/oracle@duodb

show configuration;

[oracle@srv2 ~]$ dgmgrl

DGMGRL for Linux: Release 19.0.0.0.0 – Production on Tue May 7 19:07:22 2024

Version 19.3.0.0.0

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

Welcome to DGMGRL, type “help” for information.

DGMGRL> connect sys/oracle@duodb

Connected to “duodb”

Connected as SYSDBA.

DGMGRL> show configuration;

ORA-16532: Oracle Data Guard broker configuration does not exist

Configuration details cannot be determined by DGMGRL

Ở đây chúng ta chưa thực hiện config Oracle Data Guard broker nên hệ thống báo lỗi ORA-16532

Primary: tiến hành config Oracle Data Guard broker:

create configuration 'duong_primary' as primary database is 'duodb' connect identifier is duodb;

show configuration;

DGMGRL> create configuration ‘duong_primary’ as primary database is ‘duodb’ connect identifier is duodb;

Configuration “duong_primary” created with primary database “duodb”

DGMGRL> show configuration;

Configuration – duong_primary

Protection Mode: MaxAvailability

Members:

duodb – Primary database

Fast-Start Failover: Disabled

Configuration Status:

DISABLED

Primary + Standby: thực hiện lệnh bên dưới cấu hình các điều kiện cần thiết:

exit

sqlplus / as sysdba

alter system set LOG_ARCHIVE_DEST_2= '';

Primary:

ALTER SYSTEM SET local_listener='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = duodb.localdomain)))';

Standby:

ALTER SYSTEM SET local_listener='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.12)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = stand.localdomain)))';

SQL> alter system set LOG_ARCHIVE_DEST_2= ”;

System altered.

Primary: tiến hành config Oracle Data Guard broker:

exit

dgmgrl

connect sys/oracle@duodb

show configuration;

add database 'stand' as connect identifier is stand maintained as physical;

enable configuration;

show configuration;

show configuration verbose;

enable database 'stand';

show database 'stand';

show database verbose 'stand';

show database verbose 'duodb';

show database 'duodb';

DGMGRL> connect sys/oracle@duodb

Connected to “duodb”

Connected as SYSDBA.

DGMGRL show configuration;

Configuration – duong_primary

Protection Mode: MaxPerformance

Members:

duodb – Primary database

Fast-Start Failover: Disabled

Configuration Status:

DISABLED

DGMGRL> add database ‘stand’ as connect identifier is stand maintained as physical;

Database “stand” added

DGMGRL> enable configuration;

Enabled.

DGMGRL> show configuration;

Configuration – duong_primary

Protection Mode: MaxPerformance

Members:

duodb – Primary database

stand – Physical standby database

Fast-Start Failover: Disabled

Configuration Status:

SUCCESS (status updated 12 seconds ago)

DGMGRL> show configuration verbose;

Configuration – duong_primary

Protection Mode: MaxPerformance

Members:

duodb – Primary database

stand – 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 = ‘duodb_CFG’

Fast-Start Failover: Disabled

Configuration Status:

SUCCESS

DGMGRL> enable database ‘stand’;

Enabled.

DGMGRL> show database ‘stand’;

Database – stand

Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 0 seconds ago)

Apply Lag: 0 seconds (computed 0 seconds ago)

Average Apply Rate: 116.00 KByte/s

Real Time Query: ON

Instance(s):

stand

Database Status:

SUCCESS

DGMGRL> show database verbose ‘stand’;

Database – stand

Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 0 seconds ago)

Apply Lag: 0 seconds (computed 0 seconds ago)

Average Apply Rate: 124.00 KByte/s

Active Apply Rate: 909.00 KByte/s

Maximum Apply Rate: 911.00 KByte/s

Real Time Query: ON

Instance(s):

stand

Properties:

DGConnectIdentifier = ‘stand’

ObserverConnectIdentifier = ”

FastStartFailoverTarget = ”

PreferredObserverHosts = ”

LogShipping = ‘ON’

RedoRoutes = ”

LogXptMode = ‘ASYNC’

DelayMins = ‘0’

Binding = ‘optional’

MaxFailure = ‘0’

ReopenSecs = ‘300’

NetTimeout = ’30’

RedoCompression = ‘DISABLE’

PreferredApplyInstance = ”

ApplyInstanceTimeout = ‘0’

ApplyLagThreshold = ’30’

TransportLagThreshold = ’30’

TransportDisconnectedThreshold = ’30’

ApplyParallel = ‘AUTO’

ApplyInstances = ‘0’

StandbyFileManagement = ”

ArchiveLagTarget = ‘0’

LogArchiveMaxProcesses = ‘0’

LogArchiveMinSucceedDest = ‘0’

DataGuardSyncLatency = ‘0’

LogArchiveTrace = ‘0’

LogArchiveFormat = ”

DbFileNameConvert = ”

LogFileNameConvert = ”

ArchiveLocation = ”

AlternateLocation = ”

StandbyArchiveLocation = ”

StandbyAlternateLocation = ”

InconsistentProperties = ‘(monitor)’

InconsistentLogXptProps = ‘(monitor)’

LogXptStatus = ‘(monitor)’

SendQEntries = ‘(monitor)’

RecvQEntries = ‘(monitor)’

HostName = ‘srv2.localdomain’

StaticConnectIdentifier = ‘(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.12)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=STAND_DGMGRL.localdomain)(INSTANCE_NAME=stand)(SERVER=DEDICATED)))’

TopWaitEvents = ‘(monitor)’

SidName = ‘(monitor)’

Log file locations:

Alert log : /u01/app/oracle/diag/rdbms/stand/stand/trace/alert_stand.log

Data Guard Broker log : /u01/app/oracle/diag/rdbms/stand/stand/trace/drcstand.log

Database Status:

SUCCESS

DGMGRL> show database verbose ‘duodb’;

Database – duodb

Role: PRIMARY

Intended State: TRANSPORT-ON

Instance(s):

duodb

Properties:

DGConnectIdentifier = ‘duodb’

ObserverConnectIdentifier = ”

FastStartFailoverTarget = ”

PreferredObserverHosts = ”

LogShipping = ‘ON’

RedoRoutes = ”

LogXptMode = ‘ASYNC’

DelayMins = ‘0’

Binding = ‘optional’

MaxFailure = ‘0’

ReopenSecs = ‘300’

NetTimeout = ’30’

RedoCompression = ‘DISABLE’

PreferredApplyInstance = ”

ApplyInstanceTimeout = ‘0’

ApplyLagThreshold = ’30’

TransportLagThreshold = ’30’

TransportDisconnectedThreshold = ’30’

ApplyParallel = ‘AUTO’

ApplyInstances = ‘0’

StandbyFileManagement = ”

ArchiveLagTarget = ‘0’

LogArchiveMaxProcesses = ‘0’

LogArchiveMinSucceedDest = ‘0’

DataGuardSyncLatency = ‘0’

LogArchiveTrace = ‘0’

LogArchiveFormat = ”

DbFileNameConvert = ”

LogFileNameConvert = ”

ArchiveLocation = ”

AlternateLocation = ”

StandbyArchiveLocation = ”

StandbyAlternateLocation = ”

InconsistentProperties = ‘(monitor)’

InconsistentLogXptProps = ‘(monitor)’

LogXptStatus = ‘(monitor)’

SendQEntries = ‘(monitor)’

RecvQEntries = ‘(monitor)’

HostName = ‘srv1.localdomain’

StaticConnectIdentifier = ‘(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.11)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=duodb_DGMGRL.localdomain)(INSTANCE_NAME=duodb)(SERVER=DEDICATED)))’

TopWaitEvents = ‘(monitor)’

SidName = ‘(monitor)’

Log file locations:

Alert log : /u01/app/oracle/diag/rdbms/duodb/duodb/trace/alert_duodb.log

Data Guard Broker log : /u01/app/oracle/diag/rdbms/duodb/duodb/trace/drcduodb.log

Database Status:

SUCCESS

Chúc các bạn thành công.

=============================
Website không chứa bất kỳ quảng cáo nào, mọi đóng góp để duy trì phát triển cho website (donation) xin vui lòng gửi về STK 90.2142.8888 - Ngân hàng Vietcombank Thăng Long - TRAN VAN BINH
=============================
Nếu bạn không muốn bị AI thay thế và tiết kiệm 3-5 NĂM trên con đường trở thành DBA chuyên nghiệp hay làm chủ Database thì hãy đăng ký ngay KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE, được Coaching trực tiếp từ tôi với toàn bộ bí kíp thực chiến, thủ tục, quy trình của gần 20 năm kinh nghiệm (mà bạn sẽ KHÔNG THỂ tìm kiếm trên Internet/Google) từ đó giúp bạn dễ dàng quản trị mọi hệ thống Core tại Việt Nam và trên thế giới, đỗ OCP.
- CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
- Chi tiết tham khảo:
https://bit.ly/oaz_w
=============================
2 khóa học online qua video giúp bạn nhanh chóng có những kiến thức nền tảng về Linux, Oracle, học mọi nơi, chỉ cần có Internet/4G:
- Oracle cơ bản: https://bit.ly/admin_1200
- Linux: https://bit.ly/linux_1200
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile/Zalo: 0902912888
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: https://www.youtube.com/@binhguru
👨 Tiktok: https://www.tiktok.com/@binhguru
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhguru
👨 Podcast: https://www.podbean.com/pu/pbblog-eskre-5f82d6
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội

=============================
cở sở dữ liệu, cơ sở dữ liệu quốc gia, database, AI, trí tuệ nhân tạo, artificial intelligence, machine learning, deep learning, LLM, ChatGPT, DeepSeek, Grok, oracle tutorial, học oracle database, Tự học Oracle, Tài liệu Oracle 12c tiếng Việt, Hướng dẫn sử dụng Oracle Database, Oracle SQL cơ bản, Oracle SQL là gì, Khóa học Oracle Hà Nội, Học chứng chỉ Oracle ở đầu, Khóa học Oracle online,sql tutorial, khóa học pl/sql tutorial, học dba, học dba ở việt nam, khóa học dba, khóa học dba sql, tài liệu học dba oracle, Khóa học Oracle online, học oracle sql, học oracle ở đâu tphcm, học oracle bắt đầu từ đâu, học oracle ở hà nội, oracle database tutorial, oracle database 12c, oracle database là gì, oracle database 11g, oracle download, oracle database 19c/21c/23c/23ai, oracle dba tutorial, oracle tunning, sql tunning , oracle 12c, oracle multitenant, Container Databases (CDB), Pluggable Databases (PDB), oracle cloud, oracle security, oracle fga, audit_trail,oracle RAC, ASM, oracle dataguard, oracle goldengate, mview, oracle exadata, oracle oca, oracle ocp, oracle ocm , oracle weblogic, postgresql tutorial, mysql tutorial, mariadb tutorial, ms sql server tutorial, nosql, mongodb tutorial, oci, cloud, middleware tutorial, docker, k8s, micro service, hoc solaris tutorial, hoc linux tutorial, hoc aix tutorial, unix tutorial, securecrt, xshell, mobaxterm, putty
Sửa bài viết

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master