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

逐步部署流程

貢獻者 kevin-hoke

本頁介紹了NetApp ONTAP儲存上的 Oracle19c 的自動資料保護。

AWX/Tower Oracle 資料保護

為您的環境建立清單、群組、主機和憑證

本節介紹 AWX/Ansible Tower 中的庫存、群組、主機和存取憑證的設置,為使用NetApp自動化解決方案準備環境。

  1. 配置庫存。

    1. 導覽至資源 → 庫存 → 新增,然後按一下新增庫存。

    2. 提供姓名和組織詳細信息,然後按一下「儲存」。

    3. 在庫存頁面上,按一下建立的庫存。

    4. 導航至“群組”子選單並點擊“新增”。

    5. 為您的第一個群組提供名稱 oracle 並點擊儲存。

    6. 對第二個名為 dr_oracle 的群組重複此程序。

    7. 選擇已建立的oracle群組,進入Hosts子選單,點選Add New Host。

    8. 提供來源 Oracle 主機的管理 IP 的 IP 位址,然後按一下「儲存」。

    9. 必須對 dr_oracle 群組重複此程序並新增 DR/目標 Oracle 主機的管理 IP/主機名稱。

註 以下是使用ONTAP的 On-Prem 或 AWS 上的 CVO 建立憑證類型和憑證的說明。
本地部署
  1. 配置憑證。

  2. 建立憑證類型。對於涉及ONTAP的解決方案,您必須設定憑證類型以符合使用者名稱和密碼項目。

    1. 導覽至管理 → 憑證類型,然後按一下新增。

    2. 提供名稱和描述。

    3. 在輸入配置中貼上以下內容:

      fields:
        - id: dst_cluster_username
          type: string
          label: Destination Cluster Username
        - id: dst_cluster_password
          type: string
          label: Destination Cluster Password
          secret: true
        - id: src_cluster_username
          type: string
          label: Source Cluster Username
        - id: src_cluster_password
          type: string
          label: Source Cluster Password
          secret: true
    4. 將以下內容貼到 Injector Configuration 中,然後按一下 Save:

      extra_vars:
        dst_cluster_username: '{{ dst_cluster_username }}'
        dst_cluster_password: '{{ dst_cluster_password }}'
        src_cluster_username: '{{ src_cluster_username }}'
        src_cluster_password: '{{ src_cluster_password }}'
  3. 為ONTAP建立憑證

    1. 導覽至資源 → 憑證,然後按一下新增。

    2. 輸入ONTAP憑證的名稱和組織詳細信息

    3. 選擇上一個步驟中建立的憑證類型。

    4. 在類型詳細資料下,輸入來源叢集和目標叢集的使用者名稱和密碼。

    5. 點選“儲存”

  4. 為 Oracle 建立憑證

    1. 導覽至資源 → 憑證,然後按一下新增。

    2. 輸入 Oracle 的名稱和組織詳細信息

    3. 選擇機器憑證類型。

    4. 在類型詳細資料下,輸入 Oracle 主機的使用者名稱和密碼。

    5. 選擇正確的權限提升方法,並輸入使用者名稱和密碼。

    6. 點選“儲存”

    7. 如果需要 dr_oracle 主機的不同憑證,請重複此程序。

冠狀動脈造影
  1. 配置憑證。

  2. 建立憑證類型。對於涉及ONTAP的解決方案,您必須配置憑證類型以符合使用者名稱和密碼項目,我們也會為 Cloud Central 和 AWS 新增項目。

    1. 導覽至管理 → 憑證類型,然後按一下新增。

    2. 提供名稱和描述。

    3. 在輸入配置中貼上以下內容:

      fields:
        - id: dst_cluster_username
          type: string
          label: CVO Username
        - id: dst_cluster_password
          type: string
          label: CVO Password
          secret: true
        - id: cvo_svm_password
          type: string
          label: CVO SVM Password
          secret: true
        - id: src_cluster_username
          type: string
          label: Source Cluster Username
        - id: src_cluster_password
          type: string
          label: Source Cluster Password
          secret: true
        - id: regular_id
          type: string
          label: Cloud Central ID
          secret: true
        - id: email_id
          type: string
          label: Cloud Manager Email
          secret: true
        - id: cm_password
          type: string
          label: Cloud Manager Password
          secret: true
        - id: access_key
          type: string
          label: AWS Access Key
          secret: true
        - id: secret_key
          type: string
          label: AWS Secret Key
          secret: true
        - id: token
          type: string
          label: Cloud Central Refresh Token
          secret: true
    4. 將以下內容貼到 Injector Configuration 中,然後按一下「儲存」:

      extra_vars:
        dst_cluster_username: '{{ dst_cluster_username }}'
        dst_cluster_password: '{{ dst_cluster_password }}'
        cvo_svm_password: '{{ cvo_svm_password }}'
        src_cluster_username: '{{ src_cluster_username }}'
        src_cluster_password: '{{ src_cluster_password }}'
        regular_id: '{{ regular_id }}'
        email_id: '{{ email_id }}'
        cm_password: '{{ cm_password }}'
        access_key: '{{ access_key }}'
        secret_key: '{{ secret_key }}'
        token: '{{ token }}'
  3. 為ONTAP/CVO/AWS 建立憑證

    1. 導覽至資源 → 憑證,然後按一下新增。

    2. 輸入ONTAP憑證的名稱和組織詳細信息

    3. 選擇上一個步驟中建立的憑證類型。

    4. 在類型詳細資料下,輸入來源和 CVO 叢集、Cloud Central/Manager、AWS 存取/金鑰和 Cloud Central 刷新令牌的使用者名稱和密碼。

    5. 點選“儲存”

  4. 為 Oracle 建立憑證(來源)

    1. 導覽至資源 → 憑證,然後按一下新增。

    2. 輸入 Oracle 主機的名稱和組織詳細信息

    3. 選擇機器憑證類型。

    4. 在類型詳細資料下,輸入 Oracle 主機的使用者名稱和密碼。

    5. 選擇正確的權限提升方法,並輸入使用者名稱和密碼。

    6. 點選“儲存”

  5. 為 Oracle 目標建立憑證

    1. 導覽至資源 → 憑證,然後按一下新增。

    2. 輸入 DR Oracle 主機的名稱和組織詳細信息

    3. 選擇機器憑證類型。

    4. 在類型詳細資料下,輸入使用者名稱(ec2-user,或如果您已將其從預設設定更改,請輸入該使用者名稱)和 SSH 私鑰

    5. 選擇正確的權限提升方法(sudo),並根據需要輸入使用者名稱和密碼。

    6. 點選“儲存”

創建專案

  1. 前往資源 → 項目,然後按一下新增。

    1. 輸入姓名和組織詳細資料。

    2. 在原始碼控制憑證類型欄位中選擇 Git。

    3. 進入 `\https://github.com/NetApp-Automation/na_oracle19c_data_protection.git`作為原始碼控制 URL。

    4. 按一下「Save(儲存)」。

    5. 當原始程式碼發生變化時,專案可能需要偶爾同步。

配置全域變數

本節定義的變數適用於所有 Oracle 主機、資料庫和ONTAP叢集。

  1. 在以下嵌入式全域變數或 vars 形式中輸入特定於環境的參數。

註 必須更改藍色項目以符合您的環境。
本地部署
# Oracle Data Protection global user configuration variables
# Ontap env specific config variables
hosts_group: "ontap"
ca_signed_certs: "false"

# Inter-cluster LIF details
src_nodes:
  - "AFF-01"
  - "AFF-02"

dst_nodes:
  - "DR-AFF-01"
  - "DR-AFF-02"

create_source_intercluster_lifs: "yes"

source_intercluster_network_port_details:
  using_dedicated_ports: "yes"
  using_ifgrp: "yes"
  using_vlans: "yes"
  failover_for_shared_individual_ports: "yes"
  ifgrp_name: "a0a"
  vlan_id: "10"
  ports:
    - "e0b"
    - "e0g"
  broadcast_domain: "NFS"
  ipspace: "Default"
  failover_group_name: "iclifs"

source_intercluster_lif_details:
  - name: "icl_1"
    address: "10.0.0.1"
    netmask: "255.255.255.0"
    home_port: "a0a-10"
    node: "AFF-01"
  - name: "icl_2"
    address: "10.0.0.2"
    netmask: "255.255.255.0"
    home_port: "a0a-10"
    node: "AFF-02"

create_destination_intercluster_lifs: "yes"

destination_intercluster_network_port_details:
  using_dedicated_ports: "yes"
  using_ifgrp: "yes"
  using_vlans: "yes"
  failover_for_shared_individual_ports: "yes"
  ifgrp_name: "a0a"
  vlan_id: "10"
  ports:
    - "e0b"
    - "e0g"
  broadcast_domain: "NFS"
  ipspace: "Default"
  failover_group_name: "iclifs"

destination_intercluster_lif_details:
  - name: "icl_1"
    address: "10.0.0.3"
    netmask: "255.255.255.0"
    home_port: "a0a-10"
    node: "DR-AFF-01"
  - name: "icl_2"
    address: "10.0.0.4"
    netmask: "255.255.255.0"
    home_port: "a0a-10"
    node: "DR-AFF-02"

# Variables for SnapMirror Peering
passphrase: "your-passphrase"

# Source & Destination List
dst_cluster_name: "dst-cluster-name"
dst_cluster_ip: "dst-cluster-ip"
dst_vserver: "dst-vserver"
dst_nfs_lif: "dst-nfs-lif"
src_cluster_name: "src-cluster-name"
src_cluster_ip: "src-cluster-ip"
src_vserver: "src-vserver"

# Variable for Oracle Volumes and SnapMirror Details
cg_snapshot_name_prefix: "oracle"
src_orabinary_vols:
  - "binary_vol"
src_db_vols:
  - "db_vol"
src_archivelog_vols:
  - "log_vol"
snapmirror_policy: "async_policy_oracle"

# Export Policy Details
export_policy_details:
  name: "nfs_export_policy"
  client_match: "0.0.0.0/0"
  ro_rule: "sys"
  rw_rule: "sys"

# Linux env specific config variables
mount_points:
  - "/u01"
  - "/u02"
  - "/u03"
hugepages_nr: "1234"
redhat_sub_username: "xxx"
redhat_sub_password: "xxx"

# DB env specific install and config variables
recovery_type: "scn"
control_files:
  - "/u02/oradata/CDB2/control01.ctl"
  - "/u03/orareco/CDB2/control02.ctl"
冠狀動脈造影
###########################################
### Ontap env specific config variables ###
###########################################

#Inventory group name
#Default inventory group name - "ontap"
#Change only if you are changing the group name either in inventory/hosts file or in inventory groups in case of AWX/Tower
hosts_group: "ontap"

#CA_signed_certificates (ONLY CHANGE to "true" IF YOU ARE USING CA SIGNED CERTIFICATES)
ca_signed_certs: "false"

#Names of the Nodes in the Source ONTAP Cluster
src_nodes:
  - "AFF-01"
  - "AFF-02"

#Names of the Nodes in the Destination CVO Cluster
dst_nodes:
  - "DR-AFF-01"
  - "DR-AFF-02"

#Define whether or not to create intercluster lifs on source cluster (ONLY CHANGE to "No" IF YOU HAVE ALREADY CREATED THE INTERCLUSTER LIFS)
create_source_intercluster_lifs: "yes"

source_intercluster_network_port_details:
  using_dedicated_ports: "yes"
  using_ifgrp: "yes"
  using_vlans: "yes"
  failover_for_shared_individual_ports: "yes"
  ifgrp_name: "a0a"
  vlan_id: "10"
  ports:
    - "e0b"
    - "e0g"
  broadcast_domain: "NFS"
  ipspace: "Default"
  failover_group_name: "iclifs"

source_intercluster_lif_details:
  - name: "icl_1"
    address: "10.0.0.1"
    netmask: "255.255.255.0"
    home_port: "a0a-10"
    node: "AFF-01"
  - name: "icl_2"
    address: "10.0.0.2"
    netmask: "255.255.255.0"
    home_port: "a0a-10"
    node: "AFF-02"

###########################################
### CVO Deployment Variables ###
###########################################

####### Access Keys Variables ######

# Region where your CVO will be deployed.
region_deploy: "us-east-1"

########### CVO and Connector Vars ########

# AWS Managed Policy required to give permission for IAM role creation.
aws_policy: "arn:aws:iam::1234567:policy/OCCM"

# Specify your aws role name, a new role is created if one already does not exist.
aws_role_name: "arn:aws:iam::1234567:policy/OCCM"

# Name your connector.
connector_name: "awx_connector"

# Name of the key pair generated in AWS.
key_pair: "key_pair"

# Name of the Subnet that has the range of IP addresses in your VPC.
subnet: "subnet-12345"

# ID of your AWS secuirty group that allows access to on-prem resources.
security_group: "sg-123123123"

# You Cloud Manager Account ID.
account: "account-A23123A"

# Name of the your CVO instance
cvo_name: "test_cvo"

# ID of the VPC in AWS.
vpc: "vpc-123123123"

###################################################################################################
# Variables for - Add on-prem ONTAP to Connector in Cloud Manager
###################################################################################################

# For Federated users, Client ID from API Authentication Section of Cloud Central to generate access token.
sso_id: "123123123123123123123"

# For regular access with username and password, please specify "pass" as the connector_access. For SSO users, use "refresh_token" as the variable.
connector_access: "pass"

####################################################################################################
# Variables for SnapMirror Peering
####################################################################################################
passphrase: "your-passphrase"

#####################################################################################################
# Source & Destination List
#####################################################################################################
#Please Enter Destination Cluster Name
dst_cluster_name: "dst-cluster-name"

#Please Enter Destination Cluster (Once CVO is Created Add this Variable to all templates)
dst_cluster_ip: "dst-cluster-ip"

#Please Enter Destination SVM to create mirror relationship
dst_vserver: "dst-vserver"

#Please Enter NFS Lif for dst vserver (Once CVO is Created Add this Variable to all templates)
dst_nfs_lif: "dst-nfs-lif"

#Please Enter Source Cluster Name
src_cluster_name: "src-cluster-name"

#Please Enter Source Cluster
src_cluster_ip: "src-cluster-ip"

#Please Enter Source SVM
src_vserver: "src-vserver"

#####################################################################################################
# Variable for Oracle Volumes and SnapMirror Details
#####################################################################################################
#Please Enter Source Snapshot Prefix Name
cg_snapshot_name_prefix: "oracle"

#Please Enter Source Oracle Binary Volume(s)
src_orabinary_vols:
  - "binary_vol"
#Please Enter Source Database Volume(s)
src_db_vols:
  - "db_vol"
#Please Enter Source Archive Volume(s)
src_archivelog_vols:
  - "log_vol"
#Please Enter Destination Snapmirror Policy
snapmirror_policy: "async_policy_oracle"

#####################################################################################################
# Export Policy Details
#####################################################################################################
#Enter the destination export policy details (Once CVO is Created Add this Variable to all templates)
export_policy_details:
  name: "nfs_export_policy"
  client_match: "0.0.0.0/0"
  ro_rule: "sys"
  rw_rule: "sys"

#####################################################################################################
### Linux env specific config variables ###
#####################################################################################################

#NFS Mount points for Oracle DB volumes
mount_points:
  - "/u01"
  - "/u02"
  - "/u03"

# Up to 75% of node memory size divided by 2mb. Consider how many databases to be hosted on the node and how much ram to be allocated to each DB.
# Leave it blank if hugepage is not configured on the host.
hugepages_nr: "1234"

# RedHat subscription username and password
redhat_sub_username: "xxx"
redhat_sub_password: "xxx"

####################################################
### DB env specific install and config variables ###
####################################################
#Recovery Type (leave as scn)
recovery_type: "scn"

#Oracle Control Files
control_files:
  - "/u02/oradata/CDB2/control01.ctl"
  - "/u03/orareco/CDB2/control02.ctl"

自動化劇本

有四個單獨的劇本需要運行。

  1. 用於設定您的環境(On-Prem 或 CVO)的劇本。

  2. 按計劃複製 Oracle 二進位檔案和資料庫的劇本

  3. 按計劃複製 Oracle 日誌的劇本

  4. 在目標主機上恢復資料庫的劇本

ONTAP/CVO 設定

[.underline]* ONTAP和 CVO 設定*

*配置並啟動作業範本。 *

  1. 建立作業模板。

    1. 導覽至資源 → 範本 → 新增,然後按一下新增作業範本。

    2. 輸入名稱ONTAP/CVO 設定

    3. 選擇作業類型;運行根據劇本配置系統。

    4. 為劇本選擇相應的庫存、項目、劇本和憑證。

    5. 為 On-Prem 環境選擇 ontap_setup.yml 劇本,或選擇 cvo_setup.yml 複製到 CVO 實例。

    6. 將從步驟 4 複製的全域變數貼上到 YAML 標籤下的範本變數欄位中。

    7. 按一下「Save(儲存)」。

  2. 啟動作業模板。

    1. 導航至資源 → 範本。

    2. 按一下所需的模板,然後按一下啟動。

      註 我們將使用此模板並將其複製出來用於其他劇本。
二進制和資料庫卷的複製

安排二進位和資料庫複製劇本

*配置並啟動作業範本。 *

  1. 複製先前建立的作業範本。

    1. 導航至資源 → 範本。

    2. 找到ONTAP/CVO 設定模板,然後在最右側點擊“複製模板”

    3. 在複製的模板上按一下編輯模板,並將名稱變更為二進位和資料庫複製劇本。

    4. 為範本保留相同的庫存、項目和憑證。

    5. 選擇 ora_replication_cg.yml 作為要執行的劇本。

    6. 變數將保持不變,但需要在變數 dst_cluster_ip 中設定 CVO 叢集 IP。

    7. 按一下「Save(儲存)」。

  2. 安排工作範本。

    1. 導航至資源 → 範本。

    2. 按一下二進位和資料庫複製劇本模板,然後按一下頂部選項集中的計劃。

    3. 按一下新增,新增二進位和資料庫複製的名稱計劃,選擇小時開始時的開始日期/時間,選擇本地時區和運行頻率。運行頻率將經常更新SnapMirror複製。

      註 將為日誌卷複製建立單獨的計劃,以便可以更頻繁地進行複製。
日誌卷的複製

排程日誌複製劇本

配置並啟動作業範本

  1. 複製先前建立的作業範本。

    1. 導航至資源 → 範本。

    2. 找到ONTAP/CVO 設定模板,然後在最右側點擊“複製模板”

    3. 在複製的模板上按一下編輯模板,並將名稱變更為日誌複製劇本。

    4. 為範本保留相同的庫存、項目和憑證。

    5. 選擇 ora_replication_logs.yml 作為要執行的劇本。

    6. 變數將保持不變,但需要在變數 dst_cluster_ip 中設定 CVO 叢集 IP。

    7. 按一下「Save(儲存)」。

  2. 安排工作範本。

    1. 導航至資源 → 範本。

    2. 按一下「日誌複製手冊」模板,然後按一下頂部選項集中的「計畫」。

    3. 按一下新增,新增日誌複製的名稱計劃,選擇小時開始時的開始日期/時間,選擇本地時區和運行頻率。運行頻率將經常更新SnapMirror複製。

    註 建議將日誌計畫設定為每小時更新一次,以確保恢復到上次每小時更新。
還原和復原資料庫

排程日誌複製劇本

*配置並啟動作業範本。 *

  1. 複製先前建立的作業範本。

    1. 導航至資源 → 範本。

    2. 找到ONTAP/CVO 設定模板,然後在最右側點擊“複製模板”

    3. 在複製的範本上按一下“編輯範本”,並將名稱變更為“還原和復原手冊”。

    4. 為範本保留相同的庫存、項目和憑證。

    5. 選擇 ora_recovery.yml 作為要執行的劇本。

    6. 變數將保持不變,但需要在變數 dst_cluster_ip 中設定 CVO 叢集 IP。

    7. 按一下「Save(儲存)」。

    註 直到您準備好在遠端站點恢復資料庫時,才會執行此劇本。

復原 Oracle 資料庫

  1. 本機生產 Oracle 資料庫資料磁碟區透過NetApp SnapMirror複製到二級資料中心的冗餘ONTAP叢集或公有雲中的 Cloud Volume ONTAP進行保護。在完全配置的災難復原環境中,輔助資料中心或公有雲中的復原運算執行個體處於待命狀態,並準備在發生災難時復原生產資料庫。透過對作業系統核心修補程式進行平行更新或同步升級,備用運算實例與本機實例保持同步。

  2. 在此示範的解決方案中,Oracle 二進位磁碟區會複製到目標並安裝在目標實例上以啟動 Oracle 軟體堆疊。這種恢復 Oracle 的方法比災難發生時最後一刻全新安裝 Oracle 更有優勢。它保證 Oracle 安裝與目前的內部生產軟體安裝和修補程式等級等完全同步。但是,這可能會或可能不會對復原網站上複製的 Oracle 二進位磁碟區產生額外的軟體授權影響,具體取決於 Oracle 的軟體授權結構。建議使用者在決定使用相同方法之前,先諮詢其軟體授權人員,以評估潛在的 Oracle 授權要求。

  3. 目標位置的備用 Oracle 主機已配置 Oracle 先決條件配置。

  4. SnapMirror 已損壞,磁碟區變為可寫入並安裝到備用 Oracle 主機。

  5. 在備用運算執行個體上安裝所有資料庫磁碟區後,Oracle 復原模組執行下列任務以在復原網站復原並啟動 Oracle。

    1. 同步控製文件:我們在不同的資料庫磁碟區上部署了重複的 Oracle 控製文件,以保護關鍵的資料庫控製文件。一個位於資料磁碟區上,另一個位於日誌磁碟區上。由於資料和日誌卷以不同的頻率複製,因此在復原時它們將不同步。

    2. 重新連結 Oracle 二進位檔案:由於 Oracle 二進位檔案已重新定位到新主機,因此需要重新連結。

    3. 復原 Oracle 資料庫:復原機制從控製檔案擷取 Oracle 日誌磁碟區中最後一個可用存檔日誌中的最後一個系統變更編號,並還原 Oracle 資料庫以收回故障時能夠複製到 DR 網站的所有業務交易。然後,資料庫以新形式啟動,以在復原網站進行使用者連線和業務交易。

註 在執行復原劇本之前,請確保您具有以下內容:確保它將 /etc/oratab 和 /etc/oraInst.loc 從來源 Oracle 主機複製到目標主機