選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

使用僅供讀取複本將 HA 新增至 Amazon RDS Custom 上的 Oracle PeopleSoft - AWS 方案指引

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用僅供讀取複本將 HA 新增至 Amazon RDS Custom 上的 Oracle PeopleSoft

由 sampath kathirvel (AWS) 建立

Summary

若要在 Amazon Web Services (AWS) 上執行 Oracle PeopleSoft 企業資源規劃 (ERP) 解決方案,您可以使用 Amazon Relational Database Service (Amazon RDS)Amazon RDS Custom for Oracle,以支援需要存取基礎作業系統和資料庫環境的舊版、自訂和封裝應用程式。如需規劃遷移時要考慮的關鍵因素,請參閱 AWS 規範指南中的 Oracle 資料庫遷移策略

截至本文撰寫為止,RDS Custom for Oracle 不支援多可用區選項,此選項可供 Amazon RDS for Oracle 使用儲存複寫做為 HA 解決方案使用。反之,此模式會使用建立和維護主要資料庫實體複本的待命資料庫來達成 HA。此模式著重於使用 Oracle Data Guard 設定僅供讀取複本,在具有 HA 的 Amazon RDS Custom 上執行 PeopleSoft 應用程式資料庫的步驟。

此模式也會將僅供讀取複本變更為唯讀模式。讓僅供讀取複本處於唯讀模式,可提供額外的優點:

  • 從主要資料庫卸載唯讀工作負載

  • 使用 Oracle Active Data Guard 功能從待命資料庫擷取運作狀態良好的區塊,以啟用損毀區塊的自動修復

  • 使用 Far Sync 功能讓遠端待命資料庫保持同步,而不會產生與長途重做日誌傳輸相關聯的效能額外負荷。

在唯讀模式下使用複本需要 Oracle Active Data Guard 選項,因為這是 Oracle Database Enterprise Edition 的單獨授權功能,因此需要支付額外費用。

先決條件和限制

先決條件

  • Amazon RDS Custom 上的現有 PeopleSoft 應用程式。如果您沒有應用程式,請參閱將 Oracle PeopleSoft 遷移至 Amazon RDS Custom 的模式。

  • 單一 PeopleSoft 應用程式層。不過,您可以調整此模式以使用多個應用程式層。

  • Amazon RDS Custom 已設定至少 8 GB 的交換空間。

  • Oracle Active Data Guard 資料庫授權,用於將僅供讀取複本轉換為唯讀模式,並使用它將報告任務卸載至待命。如需詳細資訊,請參閱 Oracle Technology 商業價目表

限制

產品版本

架構

目標技術堆疊

  • Amazon RDS Custom for Oracle

  • AWS Secrets Manager

  • Oracle Active Data Guard

  • Oracle PeopleSoft 應用程式

目標架構

下圖顯示 Amazon RDS Custom 資料庫執行個體和 Amazon RDS Custom 僅供讀取複本。僅供讀取複本使用 Oracle Active Data Guard 複寫到另一個可用區域。您也可以使用僅供讀取複本卸載主要資料庫上的讀取流量,以及用於報告目的。

VPC 包含 AWS Secrets Manager、Amazon EFS、應用程式層和資料庫層。

如需在 AWS 上使用 Oracle PeopleSoft 的代表性架構,請參閱在 AWS 上設定高可用性的 PeopleSoft 架構

工具

AWS 服務

  • Amazon RDS Custom for Oracle 是一項受管資料庫服務,適用於需要存取基礎作業系統和資料庫環境的舊版、自訂和封裝應用程式。

  • AWS Secrets Manager 可協助您以 API 呼叫 Secrets Manager,以程式設計方式擷取秘密,取代程式碼中的硬式編碼登入資料,包括密碼。在此模式中,您會從 Secrets Manager 擷取資料庫使用者密碼RDS_DATAGUARD,其名稱為 的 do-not-delete-rds-custom-+<<RDS Resource ID>>+-dg

其他工具

最佳實務

若要實現零資料遺失 (RPO=0) 目標,請使用 MaxAvailability Data Guard 保護模式,並搭配重做傳輸SYNC+NOAFFIRM設定,以獲得更好的效能。如需選取資料庫保護模式的詳細資訊,請參閱其他資訊一節。

史詩

任務描述所需的技能

建立僅供讀取複本。

若要建立 Amazon RDS Custom 資料庫執行個體的僅供讀取複本,請遵循 Amazon RDS 文件中的指示,並使用您建立的 Amazon RDS Custom 資料庫執行個體 (請參閱先決條件一節) 做為來源資料庫。

根據預設,Amazon RDS Custom 僅供讀取複本會建立為實體待命,且處於掛載狀態。這是為了確保符合 Oracle Active Data Guard 授權。

此模式包含用於設定多租戶容器資料庫 (CDB) 或非 CDB 執行個體的程式碼。

DBA

建立僅供讀取複本

任務描述所需的技能

建立僅供讀取複本。

若要建立 Amazon RDS Custom 資料庫執行個體的僅供讀取複本,請遵循 Amazon RDS 文件中的指示,並使用您建立的 Amazon RDS Custom 資料庫執行個體 (請參閱先決條件一節) 做為來源資料庫。

根據預設,Amazon RDS Custom 僅供讀取複本會建立為實體待命,且處於掛載狀態。這是為了確保符合 Oracle Active Data Guard 授權。

此模式包含用於設定多租戶容器資料庫 (CDB) 或非 CDB 執行個體的程式碼。

DBA
任務描述所需的技能

存取主要資料庫上的 Data Guard 代理程式組態。

在此範例中,Amazon RDS Custom 僅供讀取複本RDS_CUSTOM_ORCL_D適用於非 CDB 執行個體和 CDB RDS_CUSTOM_RDSCDB_B 執行個體。非 CDB 的資料庫為 orcl_a(主要) 和 orcl_d(待命)。CDB 的資料庫名稱為 rdscdb_a(主要) 和 rdscdb_b(待命)。

您可以直接或透過主要資料庫連線到 RDS Custom 僅供讀取複本。您可以在 $ORACLE_HOME/network/admin目錄中的 tnsnames.ora 檔案中找到資料庫的淨服務名稱。RDS Custom for Oracle 會自動為您的主要資料庫和僅供讀取複本填入這些項目。

RDS_DATAGUARD 使用者的密碼存放在 AWS Secrets Manager 中,秘密名稱為 do-not-delete-rds-custom-+<<RDS Resource ID>>+-dg。如需如何使用從 Secrets Manager 擷取的 SSH (安全殼層) 金鑰連線至 RDS Custom 執行個體的詳細資訊,請參閱使用 SSH 連線至 RDS Custom 資料庫執行個體

若要透過 Data Guard 命令列 (dgmgrl) 存取 Oracle Data Guard 代理程式組態,請使用下列程式碼。

非 CDB

$ dgmgrl RDS_DATAGUARD@RDS_CUSTOM_ORCL_D DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Sep 30 22:44:49 2022 Version 19.10.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "ORCL_D" Connected as SYSDG. DGMGRL> DGMGRL> show database orcl_d Database - orcl_d 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: 11.00 KByte/s Instance(s): ORCL SUCCESS DGMGRL>

CDB

-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Jan 11 20:24:11 2023 Version 19.16.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "RDSCDB_B" Connected as SYSDG. DGMGRL> DGMGRL> show database rdscdb_b Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 2.00 KByte/s Real Time Query: OFF Instance(s): RDSCDB Database Status: SUCCESS DGMGRL>
DBA

從主要節點連線至 DGMGRL 以變更日誌傳輸設定。

將日誌傳輸模式變更為 FastSync,對應於重做傳輸設定 SYNC+NOAFFIRM。為了確保您在角色切換後擁有有效的設定,請同時變更主要資料庫和待命資料庫。

非 CDB

DGMGRL> DGMGRL> edit database orcl_d set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database orcl_d LogXptMode; LogXptMode = 'fastsync' DGMGRL> edit database orcl_a set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database orcl_a logxptmode; LogXptMode = 'fastsync' DGMGRL>

CDB

DGMGRL> edit database rdscdb_b set property logxptmode=fastsync;DGMGRL> edit database rdscdb_b set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database rdscdb_b LogXptMode; LogXptMode = 'fastsync' DGMGRL> edit database rdscdb_a set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database rdscdb_a logxptmode; LogXptMode = 'fastsync' DGMGRL>
DBA

將保護模式變更為 MaxAvailability。

DGMGRL 從主節點MaxAvailability連線至 ,將保護模式變更為 。

非 CDB

DGMGRL> edit configuration set protection mode as maxavailability; Succeeded. DGMGRL> show configuration; Configuration - rds_dg Protection Mode: MaxAvailability Members: orcl_a - Primary database orcl_d - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 38 seconds ago) DGMGRL>

CDB

DGMGRL> show configuration Configuration - rds_dg Protection Mode: MaxAvailability Members: rdscdb_a - Primary database rdscdb_b - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 57 seconds ago) DGMGRL>
DBA

將 Oracle Data Guard 保護模式變更為 MaxAvailability

任務描述所需的技能

存取主要資料庫上的 Data Guard 代理程式組態。

在此範例中,Amazon RDS Custom 僅供讀取複本RDS_CUSTOM_ORCL_D適用於非 CDB 執行個體和 CDB RDS_CUSTOM_RDSCDB_B 執行個體。非 CDB 的資料庫為 orcl_a(主要) 和 orcl_d(待命)。CDB 的資料庫名稱為 rdscdb_a(主要) 和 rdscdb_b(待命)。

您可以直接或透過主要資料庫連線到 RDS Custom 僅供讀取複本。您可以在 $ORACLE_HOME/network/admin目錄中的 tnsnames.ora 檔案中找到資料庫的淨服務名稱。RDS Custom for Oracle 會自動為您的主要資料庫和僅供讀取複本填入這些項目。

RDS_DATAGUARD 使用者的密碼存放在 AWS Secrets Manager 中,秘密名稱為 do-not-delete-rds-custom-+<<RDS Resource ID>>+-dg。如需如何使用從 Secrets Manager 擷取的 SSH (安全殼層) 金鑰連線至 RDS Custom 執行個體的詳細資訊,請參閱使用 SSH 連線至 RDS Custom 資料庫執行個體

若要透過 Data Guard 命令列 (dgmgrl) 存取 Oracle Data Guard 代理程式組態,請使用下列程式碼。

非 CDB

$ dgmgrl RDS_DATAGUARD@RDS_CUSTOM_ORCL_D DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Sep 30 22:44:49 2022 Version 19.10.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "ORCL_D" Connected as SYSDG. DGMGRL> DGMGRL> show database orcl_d Database - orcl_d 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: 11.00 KByte/s Instance(s): ORCL SUCCESS DGMGRL>

CDB

-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Jan 11 20:24:11 2023 Version 19.16.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "RDSCDB_B" Connected as SYSDG. DGMGRL> DGMGRL> show database rdscdb_b Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 2.00 KByte/s Real Time Query: OFF Instance(s): RDSCDB Database Status: SUCCESS DGMGRL>
DBA

從主要節點連線至 DGMGRL 以變更日誌傳輸設定。

將日誌傳輸模式變更為 FastSync,對應於重做傳輸設定 SYNC+NOAFFIRM。為了確保您在角色切換後擁有有效的設定,請同時變更主要資料庫和待命資料庫。

非 CDB

DGMGRL> DGMGRL> edit database orcl_d set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database orcl_d LogXptMode; LogXptMode = 'fastsync' DGMGRL> edit database orcl_a set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database orcl_a logxptmode; LogXptMode = 'fastsync' DGMGRL>

CDB

DGMGRL> edit database rdscdb_b set property logxptmode=fastsync;DGMGRL> edit database rdscdb_b set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database rdscdb_b LogXptMode; LogXptMode = 'fastsync' DGMGRL> edit database rdscdb_a set property logxptmode=fastsync; Property "logxptmode" updated DGMGRL> show database rdscdb_a logxptmode; LogXptMode = 'fastsync' DGMGRL>
DBA

將保護模式變更為 MaxAvailability。

DGMGRL 從主節點MaxAvailability連線至 ,將保護模式變更為 。

非 CDB

DGMGRL> edit configuration set protection mode as maxavailability; Succeeded. DGMGRL> show configuration; Configuration - rds_dg Protection Mode: MaxAvailability Members: orcl_a - Primary database orcl_d - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 38 seconds ago) DGMGRL>

CDB

DGMGRL> show configuration Configuration - rds_dg Protection Mode: MaxAvailability Members: rdscdb_a - Primary database rdscdb_b - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 57 seconds ago) DGMGRL>
DBA
任務描述所需的技能

停止重做會套用至待命資料庫。

依預設,僅供讀取複本會在 MOUNT 模式中建立。若要以唯讀模式開啟它,您首先需要DGMGRL從主要節點或待命節點連線至 來關閉重做套用。

非 CDB

DGMGRL> show database orcl_dDGMGRL> show database orcl_d Database - orcl_d Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 11.00 KByte/s Real Time Query: OFF Instance(s): ORCL Database Status: SUCCESS DGMGRL> edit database orcl_d set state=apply-off; Succeeded. DGMGRL> show database orcl_d Database - orcl_d Role: PHYSICAL STANDBY Intended State: APPLY-OFF Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 42 seconds (computed 1 second ago) Average Apply Rate: (unknown) Real Time Query: OFF Instance(s): ORCL Database Status: SUCCESS DGMGRL>

CDB

DGMGRL> show configurationDGMGRL> show configuration Configuration - rds_dg Protection Mode: MaxAvailability Members: rdscdb_a - Primary database rdscdb_b - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 57 seconds ago) DGMGRL> show database rdscdb_b; Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 2.00 KByte/s Real Time Query: OFF Instance(s): RDSCDB Database Status: SUCCESS DGMGRL> edit database rdscdb_b set state=apply-off; Succeeded. DGMGRL> show database rdscdb_b; Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-OFF Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: (unknown) Real Time Query: OFF Instance(s): RDSCDB Database Status: SUCCESS
DBA

以唯讀模式開啟僅供讀取複本執行個體。

使用 TNS 項目連接至待命資料庫,並從主要節點或待命節點連接至待命資料庫,以唯讀模式開啟。

非 CDB

$ sqlplus RDS_DATAGUARD@RDS_CUSTOM_ORCL_D as sysdg -bash-4.2$ sqlplus RDS_DATAGUARD@RDS_CUSTOM_ORCL_D as sysdg SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 30 23:00:14 2022 Version 19.10.0.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Enter password: Last Successful login time: Fri Sep 30 2022 22:48:27 +00:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.10.0.0.0 SQL> select open_mode from v$database; OPEN_MODE -------------------- MOUNTED SQL> alter database open read only; Database altered. SQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLY SQL>

CDB

-bash-4.2$ sqlplus C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B as sysdg SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 11 21:14:07 2023 Version 19.16.0.0.0 Copyright (c) 1982, 2022, Oracle. All rights reserved. Enter password: Last Successful login time: Wed Jan 11 2023 21:12:05 +00:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.16.0.0.0 SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- RDSCDB MOUNTED SQL> alter database open read only; Database altered. SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- RDSCDB READ ONLY SQL>
DBA

啟用重做會套用至僅供讀取複本執行個體。

使用主要節點或待命節點中的 DGMGRL,在僅供讀取複本執行個體上啟用重做。

非 CDB

$ dgmgrl RDS_DATAGUARD@RDS_CUSTOM_ORCL_D DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Sep 30 23:02:16 2022 Version 19.10.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "ORCL_D" Connected as SYSDG. DGMGRL> edit database orcl_d set state=apply-on; DGMGRL> edit database orcl_d set state=apply-on; Succeeded. DGMGRL> show database orcl_d Database - orcl_d 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: 496.00 KByte/s Real Time Query: ON Instance(s): ORCL Database Status: SUCCESS DGMGRL>

CDB

-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Jan 11 21:21:11 2023 Version 19.16.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "RDSCDB_B" Connected as SYSDG. DGMGRL> edit database rdscdb_b set state=apply-on; Succeeded. DGMGRL> show database rdscdb_b Database - rdscdb_b 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: 35.00 KByte/s Real Time Query: ON Instance(s): RDSCDB Database Status: SUCCESS DGMGRL> show database rdscdb_b Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 16.00 KByte/s Real Time Query: ON Instance(s): RDSCDB Database Status: SUCCESS DGMGRL>
DBA

將複本狀態從掛載變更為唯讀,並啟用重做

任務描述所需的技能

停止重做會套用至待命資料庫。

依預設,僅供讀取複本會在 MOUNT 模式中建立。若要以唯讀模式開啟它,您首先需要DGMGRL從主要節點或待命節點連線至 來關閉重做套用。

非 CDB

DGMGRL> show database orcl_dDGMGRL> show database orcl_d Database - orcl_d Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 11.00 KByte/s Real Time Query: OFF Instance(s): ORCL Database Status: SUCCESS DGMGRL> edit database orcl_d set state=apply-off; Succeeded. DGMGRL> show database orcl_d Database - orcl_d Role: PHYSICAL STANDBY Intended State: APPLY-OFF Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 42 seconds (computed 1 second ago) Average Apply Rate: (unknown) Real Time Query: OFF Instance(s): ORCL Database Status: SUCCESS DGMGRL>

CDB

DGMGRL> show configurationDGMGRL> show configuration Configuration - rds_dg Protection Mode: MaxAvailability Members: rdscdb_a - Primary database rdscdb_b - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 57 seconds ago) DGMGRL> show database rdscdb_b; Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 2.00 KByte/s Real Time Query: OFF Instance(s): RDSCDB Database Status: SUCCESS DGMGRL> edit database rdscdb_b set state=apply-off; Succeeded. DGMGRL> show database rdscdb_b; Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-OFF Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: (unknown) Real Time Query: OFF Instance(s): RDSCDB Database Status: SUCCESS
DBA

以唯讀模式開啟僅供讀取複本執行個體。

使用 TNS 項目連接至待命資料庫,並從主要節點或待命節點連接至待命資料庫,以唯讀模式開啟。

非 CDB

$ sqlplus RDS_DATAGUARD@RDS_CUSTOM_ORCL_D as sysdg -bash-4.2$ sqlplus RDS_DATAGUARD@RDS_CUSTOM_ORCL_D as sysdg SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 30 23:00:14 2022 Version 19.10.0.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Enter password: Last Successful login time: Fri Sep 30 2022 22:48:27 +00:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.10.0.0.0 SQL> select open_mode from v$database; OPEN_MODE -------------------- MOUNTED SQL> alter database open read only; Database altered. SQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLY SQL>

CDB

-bash-4.2$ sqlplus C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B as sysdg SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 11 21:14:07 2023 Version 19.16.0.0.0 Copyright (c) 1982, 2022, Oracle. All rights reserved. Enter password: Last Successful login time: Wed Jan 11 2023 21:12:05 +00:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.16.0.0.0 SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- RDSCDB MOUNTED SQL> alter database open read only; Database altered. SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- RDSCDB READ ONLY SQL>
DBA

啟用重做會套用至僅供讀取複本執行個體。

使用主要節點或待命節點中的 DGMGRL,在僅供讀取複本執行個體上啟用重做。

非 CDB

$ dgmgrl RDS_DATAGUARD@RDS_CUSTOM_ORCL_D DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Sep 30 23:02:16 2022 Version 19.10.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "ORCL_D" Connected as SYSDG. DGMGRL> edit database orcl_d set state=apply-on; DGMGRL> edit database orcl_d set state=apply-on; Succeeded. DGMGRL> show database orcl_d Database - orcl_d 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: 496.00 KByte/s Real Time Query: ON Instance(s): ORCL Database Status: SUCCESS DGMGRL>

CDB

-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_B DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Jan 11 21:21:11 2023 Version 19.16.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Password: Connected to "RDSCDB_B" Connected as SYSDG. DGMGRL> edit database rdscdb_b set state=apply-on; Succeeded. DGMGRL> show database rdscdb_b Database - rdscdb_b 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: 35.00 KByte/s Real Time Query: ON Instance(s): RDSCDB Database Status: SUCCESS DGMGRL> show database rdscdb_b Database - rdscdb_b Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 16.00 KByte/s Real Time Query: ON Instance(s): RDSCDB Database Status: SUCCESS DGMGRL>
DBA

相關資源

其他資訊

選取您的資料庫保護模式

Oracle Data Guard 提供三種保護模式,可根據您的可用性、保護和效能需求來設定 Data Guard 環境。下表摘要說明這三種模式。

保護模式

重做傳輸設定

Description

最大效能

ASYNC

對於主要資料庫上發生的交易,重做資料會以非同步方式傳輸並寫入待命資料庫重做日誌。因此,效能影響很小。

MaxPerformance 由於非同步日誌運送,無法提供 RPO=0。

最大保護

SYNC+AFFIRM

對於主資料庫上的交易,在確認交易之前,重做資料會同步傳輸並寫入待命資料庫重做日誌磁碟。如果待命資料庫無法使用,主要資料庫會自行關閉,以確保交易受到保護。

最大可用性

SYNC+AFFIRM

這與 MaxProtection 模式類似,除非未從待命資料庫收到任何確認。在這種情況下,它會像處於 MaxPerformance 模式一樣運作,以保留主要資料庫的可用性,直到它能夠再次將其重做串流寫入同步待命資料庫為止。

SYNC+NOAFFIRM

對於主資料庫上的交易,重做會同步傳輸到待命資料庫,而主要只會等待確認已在待命上收到重做,而不是寫入待命磁碟。此模式也稱為 FastSync,可在發生多個同時故障的特殊情況下,以潛在的資料遺失暴露為代價,提供效能優勢。

RDS Custom for Oracle 中的僅供讀取複本是以最大效能保護模式建立,這也是 Oracle Data Guard 的預設保護模式。最大效能模式對主要資料庫提供最低的效能影響,這可協助您符合以秒為單位測量的復原點目標 (RPO) 需求。

若要實現零資料遺失 (RPO=0) 目標,您可以使用重新進行傳輸SYNC+NOAFFIRM的設定MaxAvailability,將 Oracle Data Guard 保護模式自訂為 ,以獲得更佳的效能。由於只有在對應的重做向量成功傳輸到待命資料庫之後,才會確認主要資料庫上的遞交,因此主要執行個體和複本之間的網路延遲對於遞交敏感工作負載至關重要。我們建議您為工作負載執行負載測試,以評估在 僅供讀取複本自訂為在 MaxAvailability 模式下執行時的效能影響。

與在不同可用區域中部署僅供讀取複本相比,在與主要資料庫相同的可用區域中部署僅供讀取複本可提供較低的網路延遲。不過,在相同可用區域中部署主要複本和僅供讀取複本可能不符合您的 HA 需求,因為在極少數的可用區域無法使用的情況下,主要執行個體和僅供讀取複本執行個體都會受到影響。

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。