Skip to main content
NetApp Solutions
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

自動化 Oracle 移轉

貢獻者

NetApp 解決方案工程團隊

目的

此工具套件可將 Oracle 資料庫從內部部署移轉至 AWS 雲端、並將 FSX ONTAP 儲存設備和 EC2 運算執行個體作為目標基礎架構。假設客戶已在 CDB/PDB 模型中部署內部部署 Oracle 資料庫。此工具組可讓客戶使用 Oracle PDB 重新定位程序、並提供最大可用度選項、從 Oracle 主機上的容器資料庫重新定位命名的 PDB 。這表示任何內部部署儲存陣列上的來源 PDB 都會重新定位至新的容器資料庫、而且服務中斷最少。Oracle 重新定位程序會在資料庫連線時移動 Oracle 資料檔案。當所有資料檔案移轉至 AWS 雲端時、它隨後會將使用者工作階段從內部部署重新路由至重新部署的資料庫服務。加底線的技術已獲證實是 Oracle PDB 熱複製方法。

註 雖然移轉工具組是在 AWS 雲端基礎架構上開發和驗證、但它是以 Oracle 應用程式層級解決方案為基礎。因此、此工具組適用於其他公有雲平台、例如 Azure 、 GCP 等

本解決方案可解決下列使用案例:

  • 在內部部署來源 DB 伺服器上建立移轉使用者並授予必要權限。

  • 將 PDB 從內部部署 CDB 重新放置到雲端中的目標 CDB 、而來源 PDB 則保持在線上狀態、直到切換為止。

目標對象

本解決方案適用於下列人員:

  • 將 Oracle 資料庫從內部預置移轉至 AWS 雲端的 DBA 。

  • 資料庫解決方案架構設計師、對 Oracle 資料庫從內部部署移轉至 AWS 雲端感興趣。

  • 管理支援 Oracle 資料庫的 AWS FSX ONTAP 儲存設備的儲存管理員。

  • 喜歡將 Oracle 資料庫從內部預置移轉至 AWS 雲端的應用程式擁有者。

授權

存取、下載、安裝或使用此 GitHub 儲存庫中的內容、即表示您同意中所列的授權條款 "授權檔案"

註 對於與此 GitHub 儲存庫中的內容產生及 / 或共用任何衍生作品、有特定限制。使用內容前、請務必先閱讀授權條款。如果您不同意所有條款、請勿存取、下載或使用此儲存庫中的內容。

解決方案部署

部署的先決條件

Details

部署需要下列先決條件。

Ansible v.2.10 and higher
ONTAP collection 21.19.1
Python 3
Python libraries:
  netapp-lib
  xmltodict
  jmespath
Source Oracle CDB with PDBs on-premises
Target Oracle CDB in AWS hosted on FSx and EC2 instance
Source and target CDB on same version and with same options installed
Network connectivity
  Ansible controller to source CDB
  Ansible controller to target CDB
  Source CDB to target CDB on Oracle listener port (typical 1521)

下載工具組

Details
git clone https://github.com/NetApp/na_ora_aws_migration.git

主機變數組態

Details

主機變數是在主機 _vars 目錄中定義、名稱為 { { host_name } } 。 yml 。其中包含主機變數檔 host_name.yml 範例、以示範典型組態。以下是主要考量事項:

Source Oracle CDB - define host specific variables for the on-prem CDB
  ansible_host: IP address of source database server host
  source_oracle_sid: source Oracle CDB instance ID
  source_pdb_name: source PDB name to migrate to cloud
  source_file_directory: file directory of source PDB data files
  target_file_directory: file directory of migrated PDB data files
Target Oracle CDB - define host specific variables for the target CDB including some variables for on-prem CDB
  ansible_host: IP address of target database server host
  target_oracle_sid: target Oracle CDB instance ID
  target_pdb_name: target PDB name to be migrated to cloud (for max availability option, the source and target PDB name must be the same)
  source_oracle_sid: source Oracle CDB instance ID
  source_pdb_name: source PDB name to be migrated to cloud
  source_port: source Oracle CDB listener port
  source_oracle_domain: source Oracle database domain name
  source_file_directory: file directory of source PDB data files
  target_file_directory: file directory of migrated PDB data files

DB 伺服器主機檔案組態

Details

AWS EC2 執行個體預設會使用 IP 位址來命名主機。如果您在主機檔案中使用不同的名稱來進行 Ansible 、請在 /etc/hosts 檔案中為來源伺服器和目標伺服器設定主機命名解析。以下是範例。

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.30.15.96 source_db_server
172.30.15.107 target_db_server

教戰手冊執行 - 依序執行

Details
  1. 安裝 Ansible 控制器先決條件。

    ansible-playbook -i hosts requirements.yml
    ansible-galaxy collection install -r collections/requirements.yml --force
  2. 在內部伺服器上執行移轉前工作 - 假設 admin 是 ssh 使用者、以使用 Sudo 權限連線至內部部署的 Oracle 主機。

    ansible-playbook -i hosts ora_pdb_relocate.yml -u admin -k -K -t ora_pdb_relo_onprem
  3. 在 AWS EC2 執行個體中、執行 Oracle PDB 從內部部署 CDB 移轉至目標 CDB - 假設 EC2 DB 執行個體連線使用 EC2 使用者、以及使用 EC2 使用者 ssh 金鑰配對的 db1.pem 。

    ansible-playbook -i hosts ora_pdb_relocate.yml -u ec2-user --private-key db1.pem -t ora_pdb_relo_primary

何處可找到其他資訊

若要深入瞭解 NetApp 解決方案自動化、請參閱下列網站 "NetApp解決方案自動化"