DEMO Fast-Start Failover Oracle Data Guard Oracle Data Guard 19c

DEMO Fast-Start Failover Oracle Data Guard

  1. Primary Database Unavailable: Khi primary database trở nên không khả dụng vì một lý do nào đó, chẳng hạn như mất kết nối mạng hoặc hỏng hóc phần cứng, và không thể khôi phục nhanh chóng.
  2. Fast-Start Failover Threshold Exceeded: Khi các tiêu chí đánh giá tình trạng của primary database (như log transport lag, communication lag, và apply lag) vượt quá ngưỡng được cấu hình.
  3. Manual Initiation: Người quản trị có thể khởi động FSFO thủ công nếu họ phát hiện rằng primary database không thể khôi phục được.

Dưới đây là hướng dẫn thực hiện thủ tục FAILOVER tự động: Fast-Start Failover

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/

Cấu hình Fast-Start Failover ở đây: https://datalinks.vn/fast-start-failover-oracle-data-guard-su-dung-dgmgrl-utility-oracle-data-guard-19c/

Cấu hình Oracle data guard broker ở đây: https://datalinks.vn/cau-hinh-oracle-data-guard-broker-dgmgrl-oracle-data-guard-19c/

THÔNG TIN CHI TIẾT 2 NODE:

word image 1095 1

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

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

Mục tiêu của demo này là khi Primary SRV1 bị sự cố thì SRV2 Standby sẽ thành Primary, thực hiện tự động.

Kiểm tra thông tin database: (yêu cầu phải cấu hình Oracle data guard broker trước khi thực hiện theo hướng dẫn này, trên cả 2 node phải bật Flashback)

Primary: check thông tin cần thiết

select name,FS_FAILOVER_STATUS,FS_FAILOVER_OBSERVER_PRESENT from v$database;

dgmgrl

connect sys/oracle@duodb

show configuration

DGMGRL> show configuration

Configuration – duong_primary

Protection Mode: MaxAvailability

Members:

duodb – Primary database

stand – (*) Physical standby database

Fast-Start Failover: Enabled in Zero Data Loss Mode

Configuration Status:

SUCCESS (status updated 7 seconds ago)

DGMGRL> exit

[oracle@srv1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 – Production on Wed May 8 12:04:40 2024

Version 19.3.0.0.0

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

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production

Version 19.3.0.0.0

SQL> select name,FS_FAILOVER_STATUS,FS_FAILOVER_OBSERVER_PRESENT from v$database;

NAME FS_FAILOVER_STATUS FS_FAIL

——— ———————- ——-

DUODB SYNCHRONIZED YES

Primary: Mô phỏng Fast-Start Failover

Chúng ta thiết lập mô phỏng sự cố trên Primary. Kill Smon trên primary => ngay lập tức Standby sẽ tự động failover thành Primary

ps -ef|grep smon

kill -9 9902

[oracle@srv1 ~]$ ps -ef|grep smon

oracle 9902 1 0 11:56 ? 00:00:00 ora_smon_duodb

oracle 15304 4127 0 12:08 pts/1 00:00:00 grep –color=auto smon

SRV2: check thông tin

dgmgrl

connect sys/oracle@stand

show configuration

DGMGRL> show configuration

Configuration – duong_primary

Protection Mode: MaxAvailability

Members:

stand – Primary database

Warning: ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database

duodb – (*) Physical standby database (disabled)

ORA-16661: the standby database needs to be reinstated

Fast-Start Failover: Enabled in Zero Data Loss Mode

Configuration Status:

WARNING (status updated 44 seconds ago)

Như vậy là hệ thống đã tự động Failover từ Standby thành Primary.

Primary: Khôi phục lại SRV1 primary sau khi Fast-Start Failover tự động, chúng ta tiến hành startup lại DB thì hệ thống sẽ tự động recover lại

sqlplus / as sysdba

startup

dgmgrl

connect sys/oracle@duodb

show configuration

SQL> startup

ORACLE instance started.

Total System Global Area 1828713632 bytes

Fixed Size 8897696 bytes

Variable Size 436207616 bytes

Database Buffers 1375731712 bytes

Redo Buffers 7876608 bytes

Database mounted.

ORA-16649: possible failover to another database prevents this database from

being opened

SQL> exit

Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production

Version 19.3.0.0.0

[oracle@srv1 ~]$ dgmgrl

DGMGRL for Linux: Release 19.0.0.0.0 – Production on Wed May 8 12:44:00 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

Configuration – duong_primary

Protection Mode: MaxAvailability

Members:

stand – Primary database

Warning: ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database

duodb – (*) Physical standby database

Warning: ORA-16657: reinstatement of database in progress

Fast-Start Failover: Enabled in Zero Data Loss Mode

Configuration Status:

WARNING (status updated 47 seconds ago)

DGMGRL> show configuration

Configuration – duong_primary

Protection Mode: MaxAvailability

Members:

stand – Primary database

duodb – (*) Physical standby database

Fast-Start Failover: Enabled in Zero Data Loss Mode

Configuration Status:

SUCCESS (status updated 55 seconds ago)

SQL> select flashback_on,instance_name,database_role from v$database,V$instance;

FLASHBACK_ON INSTANCE_NAME DATABASE_ROLE

—————— —————- —————-

YES stand PRIMARY

SQL> select flashback_on,instance_name,database_role from v$database,V$instance;

FLASHBACK_ON INSTANCE_NAME DATABASE_ROLE

—————— —————- —————-

YES duodb PHYSICAL STANDBY

Check lại thông tin thì Stand (SRV2) thành Primary, còn duodb (SRV1) thành Standby.

Quá trình Fast-Start Failover đã hoàn tất thành công.

Khôi phục Primary cũ 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