本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
Amazon RDS Custom for Oracle 上 Oracle PeopleSoft 應用程式的轉換角色
由 sampath kathirvel 建立 (AWS)
環境:生產 | 技術:資料庫;基礎設施 | 工作負載:Oracle |
AWS 服務:Amazon RDS |
Summary
若要在 Amazon Web Services (ERP) 上執行 Oracle PeopleSoft 企業資源規劃 (AWS) 解決方案,您可以使用 Amazon Relational Database Service (Amazon RDS) 或 Amazon RDS Custom for Oracle ,其支援需要存取基礎作業系統 (OS) 和資料庫環境的舊版、自訂和封裝應用程式。如需規劃遷移時要考慮的關鍵因素,請參閱 AWS 規範指南中的 Oracle 資料庫遷移策略。
此模式著重於為在 Amazon RDS Custom 上執行 PeopleSoft 的應用程式資料庫執行 Oracle Data Guard 切換或角色轉換的步驟,作為具有僅供讀取複本資料庫的主要資料庫。此模式包含設定快速啟動容錯移轉 (FSFO) 的步驟。在此過程中,Oracle Data Guard 組態中的資料庫繼續在其新角色中運作。Oracle Data Guard 切換的典型使用案例是災難復原 (DR) 演練、資料庫上的排程維護活動,以及待命優先修補程式套用滾動修補程式。如需詳細資訊,請參閱 Amazon RDS Custom 中的部落格文章減少資料庫修補停機時間。
先決條件和限制
先決條件
限制
產品版本
架構
技術堆疊
目標架構
下圖顯示 Amazon RDS Custom 資料庫執行個體和 Amazon RDS Custom 僅供讀取複本。Oracle Data Guard 在 DR 容錯移轉期間提供角色轉換。
如需在 PeopleSoft 上使用 Oracle 的代表性架構AWS,請參閱在 上設定高可用性 PeopleSoft 架構AWS。
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
。
其他服務
最佳實務
對於您的生產部署,我們建議您在第三個可用區域中啟動觀察器執行個體,與主要和僅供讀取複本節點分開。
史詩
任務 | 描述 | 所需的技能 |
---|
暫停主要 和複本的資料庫自動化。 | 雖然RDS自訂自動化架構不會干擾角色轉換程序,但最好在 Oracle Data Guard 切換期間暫停自動化。 若要暫停和繼續RDS自訂資料庫自動化,請遵循暫停和繼續RDS自訂自動化 的指示。 | 雲端管理員、 DBA |
檢查 Oracle Data Guard 狀態。 | 若要檢查 Oracle Data Guard 狀態,請登入主要資料庫。此模式包含使用多租戶容器資料庫 (CDB) 或非CDB執行個體的程式碼。 非CDB -bash-4.2$ dgmgrl RDS_DATAGUARD@RDS_CUSTOM_ORCL_A
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Nov 28 20:55:50 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_A"
Connected as SYSDG.
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 59 seconds ago)
DGMGRL>
CDB CDB-bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_A
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Jan 18 06:13:07 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_A"
Connected as SYSDG.
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 52 seconds ago)
DGMGRL>
| DBA |
驗證執行個體角色。 | 開啟 AWS 管理主控台,然後導覽至 Amazon RDS主控台。在資料庫的複寫區段的連線與安全索引標籤上,驗證主要複本的執行個體角色。 主要角色應與 Oracle Data Guard 主要資料庫相符,複本角色應與 Oracle Data Guard 實體待命資料庫相符。 | 雲端管理員、 DBA |
執行切換。 | 若要執行切換,DGMGRL 請從主要節點連線至 。 非CDB DGMGRL> switchover to orcl_d;
Performing switchover NOW, please wait...
Operation requires a connection to database "orcl_d"
Connecting ...
Connected to "ORCL_D"
Connected as SYSDG.
New primary database "orcl_d" is opening...
Operation requires start up of instance "ORCL" on database "orcl_a"
Starting instance "ORCL"...
Connected to an idle instance.
ORACLE instance started.
Connected to "ORCL_A"
Database mounted.
Database opened.
Connected to "ORCL_A"
Switchover succeeded, new primary is "orcl_d"
DGMGRL>
CDB DGMGRL> switchover to rdscdb_b
Performing switchover NOW, please wait...
New primary database "rdscdb_b" is opening...
Operation requires start up of instance "RDSCDB" on database "rdscdb_a"
Starting instance "RDSCDB"...
Connected to an idle instance.
ORACLE instance started.
Connected to "RDSCDB_A"
Database mounted.
Database opened.
Connected to "RDSCDB_A"
Switchover succeeded, new primary is "rdscdb_b"
| DBA |
驗證 Oracle Data Guard 連線。 | 切換後,請確認 Oracle Data Guard 連線從主要節點連線至 DGMGRL 。 非CDB DGMGRL> show configuration;
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
orcl_d - Primary database
orcl_a - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 60 seconds ago)
DGMGRL>
DGMGRL> show configuration lag;
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
orcl_d - Primary database
orcl_a - Physical standby database
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 44 seconds ago)
DGMGRL>
CDB DGMGRL> show configuration
DGMGRL> show configuration
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
rdscdb_b - Primary database
rdscdb_a - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 52 seconds ago)
DGMGRL>
DGMGRL> show configuration lag
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
rdscdb_b - Primary database
rdscdb_a - Physical standby database
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 53 seconds ago)
DGMGRL>
| DBA |
在 Amazon RDS主控台上驗證執行個體角色。 | 執行角色開關後,Amazon RDS主控台會在資料庫 下的連線與安全索引標籤的複寫區段下顯示新角色。複寫狀態可能需要幾分鐘的時間才能從空白更新為複寫 。 | DBA |
任務 | 描述 | 所需的技能 |
---|
重設切換。 | 將切換設回主節點。 | DBA |
安裝並啟動觀察者。 | 觀察者程序是DGMGRL 用戶端元件,通常在與主要和待命資料庫不同的機器中執行。觀察者的ORACLEHOME安裝可以是 Oracle Client Administrator 安裝,也可以安裝 Oracle Database Enterprise Edition 或 Personal Edition。如需有關資料庫版本之觀察者安裝的詳細資訊,請參閱安裝和啟動觀察者。若要設定觀測器程序的高可用性,您可能想要執行下列動作: 對於 Oracle 12c 第 2 版及更新版本,您最多可以部署三個觀察者。一個觀察者是主要觀察者,其餘觀察者是備份觀察者。當主要觀察者失敗時,其中一個備份觀察者會擔任主要角色。 | DBA |
DGMGRL 從觀察者主機連線至 。 | 觀察者主機會設定為主要和待命資料庫連線tnsnames.ora 的項目。只要資料遺失在FastStartFailoverLagLimit組態內 (以秒為單位的值),您就可以FSFO使用最大效能保護模式啟用 ,但您必須使用最大可用性保護模式才能達到零資料遺失 (RPO=0)。 非CDB 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 58 seconds ago)
DGMGRL> show configuration lag
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
orcl_a - Primary database
orcl_d - Physical standby database
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 5 seconds ago)
DGMGRL>
CDB -bash-4.2$ dgmgrl C##RDS_DATAGUARD@RDS_CUSTOM_RDSCDB_A
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Jan 18 06:55:09 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_A"
Connected as SYSDG.
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 18 seconds ago)
DGMGRL>
| DBA |
將待命資料庫修改為容錯移轉目標。 | 從主要節點或觀察者節點連線到一個待命資料庫。(雖然您的初始化可能具有模量待命資料庫,但您現在只需要連線到一個。) 非CDB DGMGRL> edit database orcl_a set property FastStartFailoverTarget='orcl_d';
Property "faststartfailovertarget" updated
DGMGRL> edit database orcl_d set property FastStartFailoverTarget='orcl_a';
Property "faststartfailovertarget" updated
DGMGRL> show database orcl_a FastStartFailoverTarget;
FastStartFailoverTarget = 'orcl_d'
DGMGRL> show database orcl_d FastStartFailoverTarget;
FastStartFailoverTarget = 'orcl_a'
DGMGRL>
CDB DGMGRL> edit database orcl_a set property FastStartFailoverTarget='rdscdb_b';
Object "orcl_a" was not found
DGMGRL> edit database rdscdb_a set property FastStartFailoverTarget='rdscdb_b';
Property "faststartfailovertarget" updated
DGMGRL> edit database rdscdb_b set property FastStartFailoverTarget='rdscdb_a';
Property "faststartfailovertarget" updated
DGMGRL> show database rdscdb_a FastStartFailoverTarget;
FastStartFailoverTarget = 'rdscdb_b'
DGMGRL> show database rdscdb_b FastStartFailoverTarget;
FastStartFailoverTarget = 'rdscdb_a'
DGMGRL>
| DBA |
FastStartFailoverThreshold 設定 以連線至 DGMGRL。 | 預設值在 Oracle 19c 中為 30 秒,最小值為 6 秒。較低的值可能會縮短容錯移轉期間的復原時間目標 (RTO)。較高的值有助於降低主資料庫上不必要的容錯移轉暫時性錯誤的機會。 RDS Custom for Oracle 自動化架構會監控資料庫運作狀態,並每隔幾秒執行修正動作。因此,我們建議 FastStartFailoverThreshold 將 設定為高於 10 秒的值。下列範例會在 35 秒時設定閾值。 非 CBD或 CDB DGMGRL> edit configuration set property FastStartFailoverThreshold=35;
Property "faststartfailoverthreshold" updated
DGMGRL> show configuration FastStartFailoverThreshold;
FastStartFailoverThreshold = '35'
DGMGRL>
| DBA |
FSFO 透過DGMGRL從主要節點或觀測器節點連線至 來啟用 。 | 如果資料庫未啟用 Flashback Database,則ORA-16827 會顯示警告訊息。如果FastStartFailoverAutoReinstate組態屬性設定為 TRUE (這是預設值),則選用的 Flashback 資料庫有助於自動將失敗的主要資料庫恢復至容錯移轉之前的時間點。 非CDB DGMGRL> enable fast_start failover;
Warning: ORA-16827: Flashback Database is disabled
Enabled in Zero Data Loss Mode.
DGMGRL>
DGMGRL> show configuration
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
orcl_a - Primary database
Warning: ORA-16819: fast-start failover observer not started
orcl_d - (*) Physical standby database
Warning: ORA-16819: fast-start failover observer not started
Fast-Start Failover: Enabled in Zero Data Loss Mode
Configuration Status:
WARNING (status updated 29 seconds ago)
DGMGRL>
CDB DGMGRL> enable fast_start failover;
Warning: ORA-16827: Flashback Database is disabled
Enabled in Zero Data Loss Mode.
DGMGRL> show configuration;
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
rdscdb_a - Primary database
Warning: ORA-16819: fast-start failover observer not started
rdscdb_b - (*) Physical standby database
Fast-Start Failover: Enabled in Zero Data Loss Mode
Configuration Status:
WARNING (status updated 11 seconds ago)
DGMGRL>
| DBA |
啟動觀察者以進行FSFO監控,並確認狀態。 | 您可以在啟用 之前或之後啟動觀察者FSFO。如果 FSFO 已啟用,觀察者會立即開始監控主要和目標待命資料庫的狀態和連線。如果 FSFO 未啟用,則觀察者在FSFO啟用 之前不會開始監控。 當您啟動觀察者時,主要資料庫組態會顯示為沒有任何錯誤訊息,如上一個show configuration 命令所示。 非CDB DGMGRL> start observer;
[W000 2022-12-01T06:16:51.271+00:00] FSFO target standby is orcl_d
Observer 'ip-10-0-1-89' started
[W000 2022-12-01T06:16:51.352+00:00] Observer trace level is set to USER
DGMGRL> show configuration
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
orcl_a - Primary database
orcl_d - (*) Physical standby database
Fast-Start Failover: Enabled in Zero Data Loss Mode
Configuration Status:
SUCCESS (status updated 56 seconds ago)
DGMGRL>
DGMGRL> show observer
Configuration - rds_dg
Primary: orcl_a
Active Target: orcl_d
Observer "ip-10-0-1-89" - Master
Host Name: ip-10-0-1-89
Last Ping to Primary: 1 second ago
Last Ping to Target: 1 second ago
DGMGRL>
CDB DGMGRL> start observer;
Succeeded in opening the observer file "/home/oracle/fsfo_ip-10-0-1-56.dat".
[W000 2023-01-18T07:31:32.589+00:00] FSFO target standby is rdscdb_b
Observer 'ip-10-0-1-56' started
The observer log file is '/home/oracle/observer_ip-10-0-1-56.log'.
DGMGRL> show configuration
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
rdscdb_a - Primary database
rdscdb_b - (*) Physical standby database
Fast-Start Failover: Enabled in Zero Data Loss Mode
Configuration Status:
SUCCESS (status updated 12 seconds ago)
DGMGRL>
DGMGRL> show observer;
Configuration - rds_dg
Primary: rdscdb_a
Active Target: rdscdb_b
Observer "ip-10-0-1-56" - Master
Host Name: ip-10-0-1-56
Last Ping to Primary: 1 second ago
Last Ping to Target: 2 seconds ago
DGMGRL>
| DBA |
驗證容錯移轉。 | 在這種情況下,可以透過手動停止主要EC2執行個體來執行容錯移轉測試。停止EC2執行個體之前,請使用 tail 命令,根據您的組態監控觀察者日誌檔案。使用 DGMGRL 以orcl_d 使用者 登入待命資料庫RDS_DATAGUARD ,並檢查 Oracle Data Guard 狀態。它應該顯示 orcl_d 是新的主要資料庫。 注意:在此容錯移轉測試案例中, orcl_d 是非CDB資料庫。 在容錯移轉之前,已經在 上啟用快閃記憶體資料庫orcl_a 。先前的主資料庫恢復線上狀態並開始MOUNT 後,觀察者會將其復原至新的待命資料庫。復原的資料庫會作為新主要資料庫FSFO的目標。您可以在觀察者日誌中驗證詳細資訊。 DGMGRL> show configuration
Configuration - rds_dg
Protection Mode: MaxAvailability
Members:
orcl_d - Primary database
Warning: ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database
orcl_a - (*) 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 25 seconds ago)
DGMGRL>
下列顯示 中輸出的範例observer.log 。 $ tail -f /tmp/observer.log
Unable to connect to database using rds_custom_orcl_a
[W000 2023-01-18T07:50:32.589+00:00] Primary database cannot be reached.
[W000 2023-01-18T07:50:32.589+00:00] Fast-Start Failover threshold has expired.
[W000 2023-01-18T07:50:32.590+00:00] Try to connect to the standby.
[W000 2023-01-18T07:50:32.590+00:00] Making a last connection attempt to primary database before proceeding with Fast-Start Failover.
[W000 2023-01-18T07:50:32.591+00:00] Check if the standby is ready for failover.
[S002 2023-01-18T07:50:32.591+00:00] Fast-Start Failover started...
2023-01-18T07:50:32.591+00:00
Initiating Fast-Start Failover to database "orcl_d"...
[S002 2023-01-18T07:50:32.592+00:00] Initiating Fast-start Failover.
Performing failover NOW, please wait...
Failover succeeded, new primary is "orcl_d"
2023-01-18T07:55:32.101+00:00
[S002 2023-01-18T07:55:32.591+00:00] Fast-Start Failover finished...
[W000 2023-01-18T07:55:32.591+00:00] Failover succeeded. Restart pinging.
[W000 2023-01-18T07:55:32.603+00:00] Primary database has changed to orcl_d.
[W000 2023-01-18T07:55:33.618+00:00] Try to connect to the primary.
[W000 2023-01-18T07:55:33.622+00:00] Try to connect to the primary rds_custom_orcl_d.
[W000 2023-01-18T07:55:33.634+00:00] The standby orcl_a needs to be reinstated
[W000 2023-01-18T07:55:33.654+00:00] Try to connect to the new standby orcl_a.
[W000 2023-01-18T07:55:33.654+00:00] Connection to the primary restored!
[W000 2023-01-18T07:55:35.654+00:00] Disconnecting from database rds_custom_orcl_d.
[W000 2023-01-18T07:55:57.701+00:00] Try to connect to the new standby orcl_a.
ORA-12170: TNS:Connect timeout occurred
| DBA |
任務 | 描述 | 所需的技能 |
---|
在主要資料庫中建立和啟動 服務。 | 您可以使用包含組態中主要和待命資料庫端點TNS的項目,以避免角色轉換期間應用程式組態變更。您可以定義兩個角色型資料庫服務,以支援讀取/寫入和唯讀工作負載。在下列範例中, orcl_rw 是主要資料庫上作用中的讀取/寫入服務。 orcl_ro 是唯讀服務,在已以唯讀模式開啟的待命資料庫中是作用中。 SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
ORCL READ WRITE
SQL> exec dbms_service.create_service('orcl_rw','orcl_rw');
PL/SQL procedure successfully completed.
SQL> exec dbms_service.create_service('orcl_ro','orcl_ro');
PL/SQL procedure successfully completed.
SQL> exec dbms_service.start_service('orcl_rw');
PL/SQL procedure successfully completed.
SQL>
| DBA |
在待命資料庫中啟動 服務。 | 若要在唯讀待命資料庫中啟動服務,請使用下列程式碼。 SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
ORCL READ ONLY WITH APPLY
SQL> exec dbms_service.start_service('orcl_ro');
PL/SQL procedure successfully completed.
SQL>
| DBA |
重新啟動主要資料庫時,自動啟動服務。 | 若要在重新啟動主資料庫中自動啟動服務,請使用下列程式碼。 SQL> CREATE OR REPLACE TRIGGER TrgDgServices after startup on database
DECLARE
db_role VARCHAR(30);
db_open_mode VARCHAR(30);
BEGIN
SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
IF db_role = 'PRIMARY' THEN
DBMS_SERV 2 ICE.START_SERVICE('orcl_rw');
END IF;
IF db_role = 'PHYSICAL STANDBY' AND db_open_mode LIKE 'READ ONLY%' THEN
DBMS_SERVICE.START_SERVICE('orcl_ro');
END IF;
END;
/
Trigger created.
SQL>
| DBA |
設定讀取/寫入和唯讀資料庫之間的連線。 | 您可以針對讀取/寫入和唯讀連線使用下列應用程式組態範例。 ORCL_RW = (DESCRIPTION =
(CONNECT_TIMEOUT= 120)(RETRY_COUNT=20)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=3)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST=devpsftdb.******.us-west-2.rds.amazonaws.com)(PORT=1521))
(ADDRESS = (PROTOCOL = TCP)(HOST=psftread.******.us-west-2.rds.amazonaws.com)(PORT=1521))
)
(CONNECT_DATA=(SERVICE_NAME = orcl_rw))
)
ORCL_RO = (DESCRIPTION =
(CONNECT_TIMEOUT= 120)(RETRY_COUNT=20)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=3)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST=devpsftdb.******.us-west-2.rds.amazonaws.com)(PORT=1521))
(ADDRESS = (PROTOCOL = TCP)(HOST=psftread.******.us-west-2.rds.amazonaws.com)(PORT=1521))
)
(CONNECT_DATA=(SERVICE_NAME = orcl_ro))
)
| DBA |
相關資源