Skip to main content
NetApp Solutions
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

分步部署操作步骤

贡献者

本文档详细介绍了如何使用自动化命令行界面(CLI)部署Oracle 19c。

CLI 部署 Oracle 19c 数据库

本节介绍使用 CLI 准备和部署 Oracle19c 数据库所需的步骤。确保您已查看 "入门和要求部分" 并相应地准备好您的环境。

下载 Oracle19c repo

  1. 从您的Ans负责人 控制器中、运行以下命令:

    git clone https://github.com/NetApp-Automation/na_oracle19c_deploy.git
  2. 下载存储库后、将目录更改为na_oracle19c_Deploy <cd na_oracle19c_deploy>。

编辑 hosts 文件

在部署之前完成以下操作:

  1. 编辑 hosts 文件 na_oracle19c_deploy 目录。

  2. 在 ONTAP 下,将 IP 地址更改为集群管理 IP 。

  3. 在 Oracle 组下,添加 Oracle 主机名称。主机名必须通过 DNS 或 hosts 文件解析为其 IP 地址,或者必须在主机中指定。

  4. 完成这些步骤后,请保存所做的任何更改。

以下示例说明了一个主机文件:

#ONTAP Host

[ontap]

"10.61.184.183"

#Oracle hosts

[oracle]

"rtpora01"

"rtpora02"

此示例将执行该攻略手册,并在两个 Oracle DB 服务器上同时部署 Oracle 19c 。您也可以仅使用一个数据库服务器进行测试。在这种情况下,您只需要配置一个主机变量文件。

备注 无论您部署多少 Oracle 主机和数据库,本攻略手册的执行方式都是相同的。

编辑 host_vars 下的 host_name.yml 文件

每个 Oracle 主机都有其主机变量文件,该文件由包含主机专用变量的主机名标识。您可以为主机指定任何名称。从 Host VARS Config 部分编辑并复制 host_vars ,然后将其粘贴到所需的 host_name.yml 文件中。

备注 必须根据您的环境更改蓝色项。

主机 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"}

编辑 vars.yml 文件

vars.yml 文件整合了所有环境特定的变量( ONTAP , Linux 或 Oracle ),用于 Oracle 部署。

  1. 编辑并复制 VARS 部分中的变量,然后将这些变量粘贴到 vars.yml 文件中。

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

运行攻略手册

完成所需的环境前提条件并将变量复制到 vars.ymlyor_host.yml 中后,您便可部署攻略手册了。

备注 必须根据您的环境更改 < 用户名 > 。
  1. 通过传递正确的标记和ONTAP集群用户名来运行ONTAP操作手册。根据提示填写ONTAP集群的密码、然后填写vsadmin。

    ansible-playbook -i hosts all_playbook.yml -u username -k -K -t ontap_config -e @vars/vars.yml
  2. 运行Linux操作手册以执行Linux部署部分。输入admin ssh密码和sudo密码。

    ansible-playbook -i hosts all_playbook.yml -u username -k -K -t linux_config -e @vars/vars.yml
  3. 运行Oracle操作手册以执行Oracle部署部分。输入admin ssh密码和sudo密码。

    ansible-playbook -i hosts all_playbook.yml -u username -k -K -t oracle_config -e @vars/vars.yml

在同一 Oracle 主机上部署其他数据库

此攻略手册的 Oracle 部分会每次在 Oracle 服务器上创建一个 Oracle 容器数据库。要在同一服务器上创建其他容器数据库,请完成以下步骤:

  1. 修改 host_vars 变量。

    1. 返回到步骤 3 - 编辑 host_vars 下的 host_name.yml 文件。

    2. 将 Oracle SID 更改为其他命名字符串。

    3. 将侦听器端口更改为其他编号。

    4. 如果已安装 EM Express ,请将 EM Express 端口更改为其他编号。

    5. 将修订后的主机变量复制并粘贴到 host_vars 下的 Oracle 主机变量文件中。

  2. 使用 ORACLE_CONFIG 标记执行攻略手册,如中所示 运行攻略手册

验证 Oracle 安装

  1. 以Oracle用户身份登录到Oracle服务器并执行以下命令:

    ps -ef | grep ora
    备注 如果安装按预期完成且 Oracle 数据库已启动,则此列表将列出 Oracle 进程
  2. 登录到数据库以检查数据库配置设置以及使用以下命令集创建的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运行正常。

  3. 使用以下命令通过侦听器连接到数据库以检查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 解决方案自动化社区支持 Slack 通道" 并寻找解决方案自动化渠道来发布您的问题或询问。