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

逐步部署程序

貢獻者

AWX/Tower部署Oracle 19c資料庫

1.為您的環境建立詳細目錄、群組、主機和認證資料

本節說明在AWX/Ansible Tower中設定庫存、群組、主機和存取認證資料、為使用NetApp自動化解決方案的環境做好準備。

  1. 設定庫存。

    1. 瀏覽至「資源」→「庫存」→「新增」、然後按一下「新增庫存」。

    2. 提供名稱和組織詳細資料、然後按一下「Save(儲存)」。

    3. 在「庫存」頁面上、按一下建立的庫存。

    4. 如果有任何庫存變數、請將其貼到變數欄位中。

    5. 瀏覽至「群組」子功能表、然後按一下「新增」。

    6. 提供ONTAP 群組名稱以供使用、貼上群組變數(若有)、然後按一下「Save(儲存)」。

    7. 為Oracle的另一個群組重複此程序。

    8. 選取ONTAP 建立的「更新群組」、移至「主機」子功能表、然後按一下「新增主機」。

    9. 提供ONTAP 叢集管理IP的IP位址、貼上主機變數(如果有)、然後按一下「Save(儲存)」。

    10. Oracle群組和Oracle主機管理IP/主機名稱必須重複此程序。

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

    1. 瀏覽至「管理」→「認證類型」、然後按一下「新增」。

    2. 提供名稱和說明。

    3. 在輸入組態中貼上下列內容:

fields:
  - id: username
    type: string
    label: Username
  - id: password
    type: string
    label: Password
    secret: true
  - id: vsadmin_password
    type: string
    label: vsadmin_password
    secret: true
  1. 將下列內容貼到Injector Configuration:

extra_vars:
  password: '{{ password }}'
  username: '{{ username }}'
  vsadmin_password: '{{ vsadmin_password }}'
  1. 設定認證資料。

    1. 瀏覽至「資源」→「認證」、然後按一下「新增」。

    2. 輸入ONTAP 名稱和組織詳細資料以供參考。

    3. 選取您為ONTAP 其建立的自訂認證類型。

    4. 在類型詳細資料下、輸入使用者名稱、密碼和vsadmin_password。

    5. 按一下「Back to Credential(返回認證)」、然後按

    6. 輸入Oracle的名稱和組織詳細資料。

    7. 選取機器認證類型。

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

    9. 選取正確的權限提高方法、然後輸入使用者名稱和密碼。

2.建立專案

  1. 前往「資源」→「專案」、然後按一下「新增」。

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

    2. 在來源控制認證類型欄位中選取Git。

    3. 輸入 <https://github.com/NetApp-Automation/na_oracle19c_deploy.git> 做為來源控制URL。

    4. 按一下儲存。

    5. 當來源程式碼變更時、專案可能需要偶爾同步。

3.設定Oracle host_vars

本節中定義的變數會套用至每個個別的Oracle伺服器和資料庫。

  1. 在下列內嵌的Oracle主機變數或host_vars表單中輸入您的環境特定參數。

註 必須變更藍色項目、以符合您的環境。

主機VARS組態

######################################################################
##############      Host Variables Configuration        ##############
######################################################################

# Add your Oracle Host
ansible_host: "10.61.180.15"

# Oracle db log archive mode: true - ARCHIVELOG or false - NOARCHIVELOG
log_archive_mode: "true"

# Number of pluggable databases per container instance identified by sid. Pdb_name specifies the prefix for container database naming in this case cdb2_pdb1, cdb2_pdb2, cdb2_pdb3
oracle_sid: "cdb2"
pdb_num: "3"
pdb_name: "{{ oracle_sid }}_pdb"

# CDB listener port, use different listener port for additional CDB on same host
listener_port: "1523"

# CDB is created with SGA at 75% of memory_limit, MB. Consider how many databases to be hosted on the node and how much ram to be allocated to each DB. The grand total SGA should not exceed 75% available RAM on node.
memory_limit: "5464"

# Set "em_configuration: DBEXPRESS" to install enterprise manager express and choose a unique port from 5500 to 5599 for each sid on the host.
# Leave them black if em express is not installed.
em_configuration: "DBEXPRESS"
em_express_port: "5501"

# {{groups.oracle[0]}} represents first Oracle DB server as defined in Oracle hosts group [oracle]. For concurrent multiple Oracle DB servers deployment, [0] will be incremented for each additional DB server. For example,  {{groups.oracle[1]}}" represents DB server 2, "{{groups.oracle[2]}}" represents DB server 3 ... As a good practice and the default, minimum three volumes is allocated to a DB server with corresponding /u01, /u02, /u03 mount points, which store oracle binary, oracle data, and oracle recovery files respectively. Additional volumes can be added by click on "More NFS volumes" but the number of volumes allocated to a DB server must match with what is defined in global vars file by volumes_nfs parameter, which dictates how many volumes are to be created for each DB server.
host_datastores_nfs:
  - {vol_name: "{{groups.oracle[0]}}_u01", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
  - {vol_name: "{{groups.oracle[0]}}_u02", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
  - {vol_name: "{{groups.oracle[0]}}_u03", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
  1. 填寫藍色欄位中的所有變數。

  2. 完成變數輸入後、按一下表單上的「複製」按鈕、將所有變數複製到AWX或Tower。

  3. 瀏覽至AWX或Tower、前往「Resources(資源)」→「hosts(主機)」、然後選取並開啟Oracle伺服器組態頁面。

  4. 在「詳細資料」索引標籤下、按一下「編輯」、然後將步驟1中的複製變數貼到「Yaml」索引標籤下的「變數」欄位。

  5. 按一下儲存。

  6. 對系統中的任何其他Oracle伺服器重複此程序。

4.設定全域變數

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

  1. 在下列內嵌的整體變數或vars表單中輸入您的環境特定參數。

註 必須變更藍色項目、以符合您的環境。
#######################################################################
###### Oracle 19c deployment global user configuration variables ######
######  Consolidate all variables from ontap, linux and oracle   ######
#######################################################################

###########################################
### 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 ONTAP Cluster
nodes:
 - "AFF-01"
 - "AFF-02"

#Storage VLANs
#Add additional rows for vlans as necessary
storage_vlans:
   - {vlan_id: "203", name: "infra_NFS", protocol: "NFS"}
More Storage VLANsEnter Storage VLANs details

#Details of the Data Aggregates that need to be created
#If Aggregate creation takes longer, subsequent tasks of creating volumes may fail.
#There should be enough disks already zeroed in the cluster, otherwise aggregate create will zero the disks and will take long time
data_aggregates:
  - {aggr_name: "aggr01_node01"}
  - {aggr_name: "aggr01_node02"}

#SVM name
svm_name: "ora_svm"

# SVM Management LIF Details
svm_mgmt_details:
  - {address: "172.21.91.100", netmask: "255.255.255.0", home_port: "e0M"}

# NFS storage parameters when data_protocol set to NFS. Volume named after Oracle hosts name identified by mount point as follow for oracle DB server 1. Each mount point dedicates to a particular Oracle files: u01 - Oracle binary, u02 - Oracle data, u03 - Oracle redo. Add additional volumes by click on "More NFS volumes" and also add the volumes list to corresponding host_vars as host_datastores_nfs variable. For multiple DB server deployment, additional volumes sets needs to be added for additional DB server. Input variable "{{groups.oracle[1]}}_u01", "{{groups.oracle[1]}}_u02", and "{{groups.oracle[1]}}_u03" as vol_name for second DB server. Place volumes for multiple DB servers alternatingly between controllers for balanced IO performance, e.g. DB server 1 on controller node1, DB server 2 on controller node2 etc. Make sure match lif address with controller node.

volumes_nfs:
  - {vol_name: "{{groups.oracle[0]}}_u01", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
  - {vol_name: "{{groups.oracle[0]}}_u02", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}
  - {vol_name: "{{groups.oracle[0]}}_u03", aggr_name: "aggr01_node01", lif: "172.21.94.200", size: "25"}

#NFS LIFs IP address and netmask

nfs_lifs_details:
  - address: "172.21.94.200" #for node-1
    netmask: "255.255.255.0"
  - address: "172.21.94.201" #for node-2
    netmask: "255.255.255.0"

#NFS client match

client_match: "172.21.94.0/24"

###########################################
### 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 ###
####################################################

db_domain: "your.domain.com"

# Set initial password for all required Oracle passwords. Change them after installation.

initial_pwd_all: "netapp123"
  1. 在藍色欄位中填入所有變數。

  2. 完成變數輸入後、按一下表單上的「複製」按鈕、將所有要傳輸到AWX或Tower的變數複製到下列工作範本。

5.設定及啟動工作範本。

  1. 建立工作範本。

    1. 瀏覽至「資源」→「範本」→「新增」、然後按一下「新增工作範本」

    2. 輸入名稱和說明

    3. 選取工作類型;執行會根據方針來設定系統、而檢查會執行方針檔的乾式執行、而不會實際設定系統。

    4. 選取相應的資源清冊、專案、方針及方針認證、以供教戰手冊使用。

    5. 選取all_playbook。yml作為要執行的預設教戰手冊。

    6. 將從步驟4複製的全域變數貼到Yaml索引標籤下的「範本變數」欄位。

    7. 核取「工作標籤」欄位中的「啟動時提示」方塊。

    8. 按一下儲存。

  2. 啟動工作範本。

    1. 瀏覽至資源→範本。

    2. 按一下所需的範本、然後按一下啟動。

    3. 當系統在啟動時提示您輸入「工作標籤」時、請輸入「Requirements _config」。您可能需要按一下「Requirements _config」下方的「Create Job Tag(建立工作標籤)」行、以輸入工作標籤。

註 Requirements _config可確保您擁有正確的程式庫來執行其他角色。
  1. 按一下「Next(下一步)」、然後按「Launch(啟動)」開始工作

  2. 按一下「檢視」→「工作」以監控工作輸出和進度。

  3. 當系統在啟動時提示您輸入「工作標籤」時、請輸入ONTAP_config。您可能需要按一下ONTAP_config下方的「Create "Job Tag"(建立「工作標籤」)行、以輸入工作標籤。

  4. 按一下「Next(下一步)」、然後按「Launch(啟動)」開始工作

  5. 按一下「檢視」→「工作」以監控工作輸出和進度

  6. 在ONTAP_config角色完成後、再次執行Linux組態的程序。

  7. 瀏覽至資源→範本。

  8. 選取所需的範本、然後按一下「啟動」。

  9. 在Linux組態中、當系統在啟動時提示您輸入「工作標籤」類型時、您可能需要選取Linux組態下方的「建立工作標籤」行、以輸入工作標籤。

  10. 按一下「Next(下一步)」、然後按「Launch(啟動)」開始工作

  11. 選取「檢視」→「工作」以監控工作輸出和進度。

  12. Linux組態角色完成後、請再次執行Oracle_config的程序。

  13. 前往資源→範本。

  14. 選取所需的範本、然後按一下「啟動」。

  15. 當系統在啟動時提示您輸入「工作標籤」時、請輸入oracle_config。您可能需要選取Oracle_config下方的「Create "Job Tag"(建立「工作標籤」)行、以輸入工作標籤。

  16. 按一下「Next(下一步)」、然後按「Launch(啟動)」開始工作

  17. 選取「檢視」→「工作」以監控工作輸出和進度。

6.在相同的Oracle主機上部署額外的資料庫

每次執行時、實戰手冊的Oracle部分會在Oracle伺服器上建立單一Oracle Container資料庫。若要在同一部伺服器上建立其他容器資料庫、請完成下列步驟。

  1. 修改host_var變數。

    1. 返回步驟2:設定Oracle host_vars。

    2. 將Oracle SID變更為不同的命名字串。

    3. 將接聽程式連接埠變更為不同的號碼。

    4. 如果您要安裝EM Express、請將EM Express連接埠變更為不同的編號。

    5. 將修訂的主機變數複製並貼到「主機組態詳細資料」索引標籤的「Oracle主機變數」欄位。

  2. 僅使用oracle_config標記啟動部署工作範本。

  3. 以 Oracle 使用者身分登入 Oracle 伺服器、然後執行下列命令:

    ps -ef | grep ora
    註 如果安裝已如預期完成、且Oracle資料庫已啟動、則會列出Oracle程序
  4. 登入資料庫、檢查使用下列命令集建立的資料庫組態設定和 PDB 。

    [oracle@localhost ~]$ sqlplus / as sysdba
    
    SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 6 12:52:51 2021
    Version 19.8.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.8.0.0.0
    
    SQL>
    
    SQL> select name, log_mode from v$database;
    NAME      LOG_MODE
    --------- ------------
    CDB2      ARCHIVELOG
    
    SQL> show pdbs
    
        CON_ID CON_NAME                       OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
             2 PDB$SEED                       READ ONLY  NO
             3 CDB2_PDB1                      READ WRITE NO
             4 CDB2_PDB2                      READ WRITE NO
             5 CDB2_PDB3                      READ WRITE NO
    
    col svrname form a30
    col dirname form a30
    select svrname, dirname, nfsversion from v$dnfs_servers;
    
    SQL> col svrname form a30
    SQL> col dirname form a30
    SQL> select svrname, dirname, nfsversion from v$dnfs_servers;
    
    SVRNAME                        DIRNAME                        NFSVERSION
    ------------------------------ ------------------------------ ----------------
    172.21.126.200                 /rhelora03_u02                 NFSv3.0
    172.21.126.200                 /rhelora03_u03                 NFSv3.0
    172.21.126.200                 /rhelora03_u01                 NFSv3.0

    這證實 DNFS 運作正常。

  5. 透過接聽程式連線至資料庫、使用下列命令檢查 hte Oracle 接聽程式組態。變更為適當的接聽程式連接埠和資料庫服務名稱。

    [oracle@localhost ~]$ sqlplus system@//localhost:1523/cdb2_pdb1.cie.netapp.com
    
    SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 6 13:19:57 2021
    Version 19.8.0.0.0
    
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    
    Enter password:
    Last Successful login time: Wed May 05 2021 17:11:11 -04:00
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.8.0.0.0
    
    SQL> show user
    USER is "SYSTEM"
    SQL> show con_name
    CON_NAME
    CDB2_PDB1

    這證實 Oracle 接聽程式正常運作。

哪裡可以取得協助?

如果您需要工具組的協助、請加入 "NetApp解決方案自動化社群支援閒散通道" 並尋找解決方案自動化通路、以張貼您的問題或詢問。