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 đây: https://datalinks.vn/huong-dan-cai-dat-oracle-data-guard-physical-standby-ver-19c-voi-rman/

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.

 

0 0 đánh giá
Đánh giá bài viết
Theo dõi
Thông báo của
guest

0 Góp ý
Phản hồi nội tuyến
Xem tất cả bình luận