ITPub博客

首页 > 数据库 > Oracle > Oracle 12c新特性---Rapid Home Provisioning (RHP)

Oracle 12c新特性---Rapid Home Provisioning (RHP)

原创 Oracle 作者:lhrbest 时间:2020-07-08 14:45:17 0 删除 编辑


Oracle 12c新特性---Rapid Home Provisioning (RHP)



RHP: Rapid Home Provisioning Server - Minimum Requirement ( 文档 ID 2126710.1)

How To Setup a Rapid Home Provisioning (RHP) Server and Client ( 文档 ID 2097026.1)

http://www.oracle.com/technetwork/database/database-cloud/private/rapid-home-provisioning-2405191.pdf

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sprhp/what-can-i-do-rapid-home-provisioning.html


RHP(Rapid Home Provisioning)是什么
随着IT信息化的发展。现在数据中心的规模越来越大,对管理员的要求也越来越高。同时,用户希望快速访问始终在线的服务,因此对于企业来说,部署和维护必须高效且对业务运行无干扰。为了跟上步伐,必须减少运维复杂性和手动参与的步骤。Oracle RHP (Rapid Home Provisioning) 的解决方案标准化、简化了软件分发和管理。自动化和高效率是她的特点,她最小化了对大规模部署的影响。

Rapid Home Provisioning (RHP) 代表了一种标准的方法,以统一的方式,在软件基础设施的所有体系结构层 (Oracle Database和其他第三方定制软件) 上进行部署、补丁、升级、迁移等工作,尤其是Oracle集群、数据库的部署、升级、补丁、迁移,以及集群节点的伸缩等操作非常便捷。
 

RHP可以理解成一个独立的集群(仅安装GI即可)。RHP服务是Grid Infrastructure的一部分。Oracle Clusterware会管理RHP的相关组件。这些组件包括RHP Server自身、GNS、一个用于支持HA-NFS的VIP(不论是否使用NFS来存储workingcopy,都是必须的)和用于存储workingcopy快照的ASM集群文件系统(ACFS)。在日常操作中,通过RHP部署的客户端或目标端不依赖于RHP服务。因此,即使RHP服务不可用,已经部署的home不会受到影响。


Rapid Home Provisioning (RHP) 是一种部署软件HOME的方法。我们可以从已安装的HOME中创建Image,并存储和管理,Oracle称之为“Gold Image”。DBA可以在这个“Gold Image”上制作副本(workingcopy),然后把这些副本供应到数据中心的所有目标端。


“Gold Image”代表一个Home,无论是Oracle数据库软件Home,还是第三方的或自定义软件Home。“Gold Image”存储在Oracle自动软件管理集群文件系统 (Oracle ACFS) 中。

RHP的相关元数据存储在Grid Infrastructure Management Repository。Management Database MGMTDB在安装Grid infrastructure时会被创建。

RHP的特点和功能

RHP提供集中的软件部署和维护。软件只需要安装一次,然后存储在RHP服务器上,并且从那里可以随时向数据中心的任何节点或集群供应。主要特征包括:管理现有部署,不需要任何更改、不需要重新配置、也不需要代理或守护程序。 


主要优势有

流程自动化,减少人工参与的步骤
简化了数据库相关的安装部署、修补和升级
最大限度地减少维护的影响和风险
支持大规模部署

RHP的基本功能

Gold Images集中存储,包括GI、DB、应用、中间件等
支持安装和配置新的集群和数据库
最小化维护窗口
一条命令就能搞定安装、补丁或升级
内置了还原和从失败点继续的能力执行
支持 自定义工作流
提供审计日志
支持所有部署模型——物理机器、虚拟化、容器、Oracle多租户

RHP架构图
RHP (Rapid Home Provisioning) 服务依赖于Grid Infrastructure。她存储和管理了很多ORACLE_HOME的模板,我们称之为“Gold Images”。 您可以向数据中心中的任何节点部署基于“Gold Images”的副本(working copy实际上就是基于Gold Image部署的ORACLE HOME)。RHP支持Oracle Home、Oracle Database、Grid Infrastructure、和新集群(前提是需要操作系统和网络已配置好)的部署,以及GI、DB的升级和迁移等,还支持第三方的软件。

RHP可以管理其集群自身,12.2.0.1或更高版本的Rapid Home Provisioning Clients,还可以管理通过RHP Service部署的Oracle Grid Infrastructure 11gR2 (11.2.0.4) 和12cR1 (12.1.0.2) ,称为Clientless Targets部署。RHP还可以管理在Oracle Restart上运行的单实例数据库以及没有集群软件的服务器。总之一句话,只要是11.2.0.4及以上的无论是集群还是单实例都可以管理,前提是必须通过RHP部署部署。

下面的架构图描述的是通过RHP Server部署11.2、12.1、12.2、18c target,这些称为Managed target。还有一些未连接的18c target,这些不是通过RHP Server部署的,称之为Unmanaged target,不能通过RHP管理。由于这些不是通过RHP Server部署的,所以RHP也无法直接管理。下面会介绍目标端、RHP客户端,注意这些都不是必须的。

目标端(no RHP Client)
没有运行Oracle Grid Infrastructure RHP Client的目标称为Clientless Targets。这些目标不能发起与RHP Service的通信,只能从RHP Service端进行管理。这些目标可以运行网格基础设施11.2.0.4/12.1.0.2/12.2.0.1,或者没有安装GI,只运行了单实例的Oracle实例数据库,或者是安装Oracle Restart等。SSH协议用于RHPS和目标之间的通信。

RHP客户端(RHP Client)

RHP Client进程是一个集群中的HA资源,运行在集群的一个节点中,并处理来自RHP Service的请求。能够与客户端交互,并在没有凭据的情况下执行预期的任务。此外,客户端可以在本地启动许多任务。在启动时,客户机-服务器进程之间建立一个经过身份验证的通信通道并保持连接,称为JMX通信通道。这需要在RHP Service和RHP Client上都打开端口来建立这个通道。


如何配置RHP Server

从18c开始,在安装GI的时候,RHP Server是默认被安装的,使用的是本地模式。也就是下面的输出,只有move命令。如果只想在本地模式下使用,也可以不配置RHP Server。
本地模式下的输出

orgrid@ohs1 ~]$ rhpctl
Usage: rhpctl <command> <object> [<options>]
    commands: move
    objects: database|gihome
For detailed help on each command and object and its options use:
  rhpctl <command> <object> -help
[orgrid@ohs1 ~]$

服务器模式下的输出(如果是这种模式,请忽略下面的步骤)

[orgrid@ohs1 ~]$ rhpctl
Usage: rhpctl <command> <object> [<options>]
    commands: add|addnode|allow|delete|deleteimage|deletenode|disallow|discover|export|grant|import|insertimage|instantiate|modify|move|promote|query|register|revoke|subscribe|uninstantiate|unregister|unsubscribe|upgrade|verify|enable|disable|collect|deploy
    objects: audit|client|credentials|database|gihome|image|imagetype|job|node|osconfig|peerserver|role|series|server|user|useraction|workingcopy
For detailed help on each command and object and its options use:
  rhpctl <command> <object> -help
[orgrid@ohs1 ~]$

下图记录了在已安装18c(18.3)集群上建立 RHP Server 的详细步骤。

ohs1和ohs2是已安装18c的集群,其中RHP Client不是可选的。

停止RHP Server
[orgrid@ohs1 ~]$ srvctl stop rhpserver
[orgrid@ohs1 ~]$ srvctl remove rhpserver
PRCN-2018 : Current user orgrid is not a privileged user
[orgrid@ohs1 ~]$ which srvctl
/pgold/orgrid/oracle/product/183/bin/srvctl
[orgrid@ohs1 ~]$ su -
Password:
移除RHP Server
[root@ohs1 ~]# /pgold/orgrid/oracle/product/183/bin/srvctl remove rhpserver
[root@ohs1 ~]#
增加RHP Server
[root@ohs1 ~]# /pgold/orgrid/oracle/product/183/bin/srvctl add rhpserver -storage /rhpstorage -diskgroup DATA -verbose
ohs1.ohsdba.cn: Creating a new volume...
ohs1.ohsdba.cn: Checking for the existence of file system...
ohs1.ohsdba.cn: Creating a new ACFS file system...
ohs1.ohsdba.cn: Starting the ACFS file system...
ohs1.ohsdba.cn: Creating authentication keys...
[root@ohs1 ~]# su – orgrid
Note:/rhpstorage会被自动创建
启动RHP Server
[root@ohs1 ~]# /pgold/orgrid/oracle/product/183/bin/srvctl start rhpserver
[root@ohs1 ~]# /pgold/orgrid/oracle/product/183/bin/srvctl status rhpserver
Rapid Home Provisioning Server is enabled
Rapid Home Provisioning Server is running on node ohs1
查看RHP Server配置
[root@ohs1 ~]# /pgold/orgrid/oracle/product/183/bin/srvctl config rhpserver
Storage base path: /rhpstorage
Disk Groups: DATA
Port number: 23795
Transfer port range:
Rapid Home Provisioning Server is enabled
Rapid Home Provisioning Server is individually enabled on nodes:
Rapid Home Provisioning Server is individually disabled on nodes:
Email address:
Mail server address:
Mail server port:
Transport Level Security disabled
HTTP Secure is enabled
[orgrid@ohs1 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ohs-lv_root
                       50G  5.1G   42G  11% /
tmpfs                 2.4G  1.1G  1.3G  46% /dev/shm
/dev/sda1             477M   84M  368M  19% /boot
/dev/mapper/vg_ohs-lv_pgold
                      537G   23G  487G   5% /pgold
/dev/asm/ghchkpt-33   5.5G  784M  4.8G  14% /rhpstorage/chkbase
/dev/asm/ghvol464715-33
                       12G  5.7G  6.4G  47% /rhpstorage/images/iDB112957258
/dev/asm/ghvol895499-33
                       22G   12G   11G  51% /rhpstorage/images/iDB183271079
[orgrid@ohs1 ~]$
增加HAVIP
[root@ohs1 ~]# /pgold/orgrid/oracle/product/183/bin/srvctl add havip -id havip -address 192.168.56.6



rhpctl命令行

RHP是从12.1开始引入的,也只有在GI下面才有,文件名是rhpctl。在这个版本,如果要通过rhpctl部署软件HOME,必须是配置了RHP Client才可以。到了12.2,在没有RHP Client客户下,也可以部署。从18c开始,没有安装GI也可以使用(也可以说在单实例下面也可以使用),从数据库的HOME下我们能找到rhpctl这命令。

版本

GI_HOME(rhpctl)

DB_HOME(rhpctl)

RHP是否

默认安装

是否需要配置

RHP Client才部署

DB是否支持

本地 move

12.1

12.2

18c

[root@ohs1 ~]# rhpctl -h

Performs Rapid Home Provisioning operations and manages Rapid Home Provisioning Servers and Clients.
Usage:
         rhpctl add                   Adds a resource, type or other entity.
         rhpctl addnode               Adds nodes or instances of specific resources.
         rhpctl addpdb                Adds a pluggable database to the specified multitenant container database.
         rhpctl allow                 Allows access to the image, series or image type.
         rhpctl collect               Collects backup of operating system configuration for the cluster.
         rhpctl compare               Compares operating system configurations for the specified cluster.
         rhpctl delete                Deletes a resource, type or other entity.
         rhpctl deleteimage           Deletes an image from a series.
         rhpctl deletenode            Deletes nodes or instances of specific resources.
         rhpctl deletepdb             Removes a pluggable database from the specified multitenant container database.
         rhpctl deploy                Deploys OS image for the cluster.
         rhpctl disable               Disables the scheduled daily backup of operating system configuration for the cluster.
         rhpctl disallow              Disallows access to the image, series or image type.
         rhpctl discover              Validates and discovers parameters to generate a response file.
         rhpctl enable                Enables the scheduled daily backup of operating system configuration for the cluster.
         rhpctl export                Exports data from the repository to a client or server data file.
         rhpctl grant                 Grants a role to a client user.
         rhpctl import                Creates a new image from the specified path.
         rhpctl insertimage           Inserts a new image into a series.
         rhpctl instantiate           Requests images from another server.
         rhpctl modify                Modifies a resource, type or other entity.
         rhpctl move                  Moves a resource from a source path to a destination path.
         rhpctl promote               Promotes an image.
         rhpctl query                 Gets information of a resource, type or other entity.
         rhpctl recover               Recovers a node after its failure.
         rhpctl register              Registers an image, user or server.
         rhpctl replicate             Replicate image from server to a specified client.
         rhpctl revoke                Revokes a role of a client user.
         rhpctl subscribe             Subscribes the specified user to an image series.
         rhpctl uninstantiate         Stops updates for previously requested images from another server.
         rhpctl unregister            Unregisters an image, user or server.
         rhpctl unsubscribe           Unsubscribes the specified user to an image series.
         rhpctl upgrade               Upgrades a resource.
         rhpctl verify                Validates and creates or completes a response file.
         rhpctl zdtupgrade            Performs zero downtime upgrade of a database.
For detailed help on each command use:
        rhpctl <command> -help
[root@ohs1 ~]#

RHP的“Gold Image ”和“workingcopy

RHP最基本的操作,一个是创建“Gold Image”,一个是创建“workingcopy”。

每个 “Gold Image”都代表一个HOME,可以是Oracle数据库HOME、Grid Infrastructure HOME或任何其他软件HOME。应用程序不会直接在“Gold Image”上运行。可以从“Gold Image”上创建副本(working copy),然后在这些workingcopy上运行。“Gold Image”可以从RHP服务上安装的HOME、RHP Client或数据中心中的任何节点导入。Gold Image还可以在RHP服务之间共享。默认的状态是PUBLISHED,在创建image的时候可以指定参数-state来设置状态,之后还可以通过“promote image”命令来改变状态。

有多种方式来创建“Gold Images”

一个是“import image”,

一个是“add image”,

一个是“register image”(这个在白皮书中暂时没找到说明)

“add image”用于从workingcopy中创建副本。并且这个workingcopy是在RHP服务端上,并且部署时的存储选项是RHP_MANAGED。通过这个还可以节省存储空间。这个在后面会有介绍。


“import image” 用于从安装的HOME中创建“Gold Image”。可以是在RHP服务端,也可以是RHP Client端,或者是一个没有客户端的目标端 (11.2, 12.1 or 12.2) ,这个是常用选项。

支持import image的Database 和 GI 版本为11.2.0.4, 12.1.0.2, and 12.2.0.1。请记住,数据中心中的任何家HOME都可以作为“gold images”导入,因此您可以选择哪些image作为标准化部署基础。

Image状态和访问
RHP允许您定义Image的状态PUBLISHED、RESTRICTED、TESTABLE(发布的、可测试的或受限的三种),来实现Image的生命周期管理。此外,还可以在角色和特定用户级别控制对给定映像的访问。

Workingcopy

只要是通过rhpctl部署的HOME(就是wokingcopy)都属于被托管(managed)的,不是通过rhpctl部署的HOME都统称为非托管(unmanaged)的。例如,在一个非托管的HOME下,在补丁或升级过程中,可以通过rhpctl部署新的HOME,然后通过rhpctl做升级或迁移,非托管(unmanaged)的HOME可以很容易的切换到被托管(managed),纳入RHP的管理框架。

打补丁方式的改变

之前打补丁的操作以及后续步骤,现在通过下面的两条命令就可以搞定了

1. rhpctl add workingcopy
2. rhpctl move database

部署新集群或数据库 就是这么简单

只要操作系统、相关安装包和网络配置好。在RHP服务端通过下面的三个命令就可以快速的部署一个新集群,包含数据库。

通过RHP部署和升级体验

下面是原始环境的信息。我们通过在RHP Server ohs1上导入ood 11204的ORACLE_HOME,在ohs1上导入183的ORACLE HOME。然后在ohs1上通过RHP为ohs部署11204的ORACLE_HOME,并创建数据库,然后再部署183的ORACLE_HOME,最后将11204的数据库升级都183。

OS Server

ohs1,ohs2

RHP Server

ood

ohs

GI HOME

/pgold/orgrid/oracle/product/183

N/A

N/A

Database HOME

/pgold/ordb/oracle/product/183

/u01/app/oracle/product/11204

N/A


18c在本地模式下通过rhpctl move切换ORACLE HOME
注意:move只适合于大版本相同,小版本不同的情况。比如这里是介绍从Oracle 18.2切换到18.3。
查看情况环境

[oracle@sdb09] /home/oracle> env |grep ORACLE
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/18.0.0/dbhome_1
ORACLE_HOSTNAME=sdb09
ORACLE_PATH=/home/oracle/scripts
ORACLE_SID=cdb2
ORACLE_UNQNAME=cdb2
[oracle@sdb09] /home/oracle> sqlplus "/as sysdba"
SQL*Plus: Release 18.0.0.0.0 - Production on Tue Jul 24 16:43:00 2018
Version 18.2.0.0.0
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0
CDB$ROOT@cdb2>show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  YES
         3 PDB2                           READ WRITE NO
CDB$ROOT@cdb2>exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0
[oracle@sdb09] /home/oracle>

安装18.3 ORACLE HOME
18.3 ORACLE_HOME的安装(略)

注意:这里是本地模式,就不能通过rhpctl add workingcopy来部署183的ORACLE HOME了
执行rhpctl move database
一条命令搞定,真的很简单。在18.2下执行rhpctl move database
[oracle@sdb09] /home/oracle> rhpctl move database -dbname cdb2              \
>                      -sourcehome /u01/app/oracle/product/18.0.0/dbhome_1  \
>                      -desthome /u01/app/oracle/product/18.0.0/dbhome_3    \
>                      -stopoption IMMEDIATE

Running RHPCTL for Stand Alone Home
SQL*Plus: Release 18.0.0.0.0 - Production on Tue Jul 24 16:46:23 2018
Version 18.2.0.0.0
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0
SQL> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0
SQL*Plus: Release 18.0.0.0.0 - Production on Tue Jul 24 16:46:55 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 1073741304 bytes
Fixed Size                  8904184 bytes
Variable Size             771751936 bytes
Database Buffers          289406976 bytes
Redo Buffers                3678208 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
/u01/app/oracle/product/18.0.0/dbhome_3
cdb2
SQL Patching tool version 18.0.0.0.0 Production on Tue Jul 24 16:47:19 2018
Copyright (c) 2012, 2018, Oracle.  All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_533_2018_07_24_16_47_19/sqlpatch_invocation.log
Connecting to database...OK
Gathering database info...done
Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
Interim patch 27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)):
  Binary registry: Installed
  PDB CDB$ROOT: Rolled back with errors on 24-JUL-18 04.30.06.505223 PM
  PDB PDB$SEED: Rolled back with errors on 24-JUL-18 04.30.06.873780 PM
  PDB PDB2: Rolled back with errors on 24-JUL-18 04.30.07.119076 PM
Current state of release update SQL patches:
  Binary registry:
    18.3.0.0.0 Release_Update 1806280943: Installed
  PDB CDB$ROOT:
    Rolled back to 18.2.0.0.0 Release_Update 1804041635 successfully on 24-JUL-18 04.30.06.555634 PM
  PDB PDB$SEED:
    Rolled back to 18.2.0.0.0 Release_Update 1804041635 successfully on 24-JUL-18 04.30.06.951502 PM
  PDB PDB2:
    Rolled back to 18.2.0.0.0 Release_Update 1804041635 successfully on 24-JUL-18 04.30.07.155698 PM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PDB2
    No interim patches need to be rolled back
    Patch 28090523 (Database Release Update : 18.3.0.0.180717 (28090523)):
      Apply from 18.2.0.0.0 Release_Update 1804041635 to 18.3.0.0.0 Release_Update 1806280943
    The following interim patches will be applied:
      27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415))
Installing patches...
Patch installation complete.  Total patches installed: 6
Validating logfiles...done
Patch 28090523 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28090523/22329768/28090523_apply_CDB2_CDBROOT_2018Jul24_16_49_17.log (no errors)
Patch 27923415 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_apply_CDB2_CDBROOT_2018Jul24_16_51_54.log (no errors)
Patch 28090523 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28090523/22329768/28090523_apply_CDB2_PDBSEED_2018Jul24_16_52_15.log (no errors)
Patch 27923415 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_apply_CDB2_PDBSEED_2018Jul24_16_55_08.log (no errors)
Patch 28090523 apply (pdb PDB2): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28090523/22329768/28090523_apply_CDB2_PDB2_2018Jul24_16_52_16.log (no errors)
Patch 27923415 apply (pdb PDB2): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_apply_CDB2_PDB2_2018Jul24_16_55_01.log (no errors)
SQL Patching tool complete on Tue Jul 24 16:55:24 2018
[oracle@sdb09] /home/oracle>


Reference

https://www.oracle.com/technetwork/database/database-cloud/private/index.html
https://www.oracle.com/assets/rapid-home-provisioning-2405191.pdf
https://blogs.oracle.com/db_maintenance/rapid-home-provisioning-simplifies-oracle-database-estate-management
https://blogs.oracle.com/db_maintenance/whats-new-in-122-for-rapid-home-provisioning-and-maintenance
https://blogs.oracle.com/db_maintenance/rapid-home-provisioning-and-maintenance-whats-new-in-18c
https://www.oracle.com/technetwork/database/database-cloud/private/rhp-datasheet-2529714.pdf
https://docs.oracle.com/en/database/oracle/oracle-database/18/sprhp/rapid-home-provisioning-use-cases.html
https://docs.oracle.com/en/database/oracle/oracle-database/18/sprhp/rhp_upgrading-oracle-database-12c-release-2.html

12.1 Reference
https://docs.oracle.com/database/121/CWADD/GUID-CCEC5960-EDA4-4A3F-9643-0CA308EA49AA.htm#CWADD92402
https://docs.oracle.com/database/121/CWADD/GUID-CDF55B0E-85FE-48A6-9329-EC3D78252F29.htm#CWADD-GUID-CDF55B0E-85FE-48A6-9329-EC3D78252F29

12.2 Reference
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwadd/rapid-home-provisioning.html#GUID-CCEC5960-EDA4-4A3F-9643-0CA308EA49AA
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwadd/rapid-home-provisioning-and-server-control-command-reference.html#GUID-CDF55B0E-85FE-48A6-9329-EC3D78252F29

18c Reference
https://docs.oracle.com/en/database/oracle/oracle-database/18/cwadd/rapid-home-provisioning.html#GUID-CCEC5960-EDA4-4A3F-9643-0CA308EA49AA
https://docs.oracle.com/en/database/oracle/oracle-database/18/cwadd/rapid-home-provisioning-and-server-control-command-reference.html#GUID-66345667-F035-4ADB-A25F-5530299E04B7

https://docs.oracle.com/en/database/oracle/oracle-database/18/sprhp/deploying-and-managing-oracle-software-using-rapid-home-provisioning.pdf

2126710.1 RHP: Rapid Home Provisioning Server - Minimum Requirement

2097026.1 How to Setup a Rapid Home Provisioning (RHP) Server and Client
2124960.1 Rapid Home Provisioning (RHP) setup in 1-Click

关键词: rhp  18c  oracle 

相关文章

低代码开发用Oracle Apex,看这篇就够了
Oracle Database 20c之SQL宏
Java beginner for Oracle DBA
Oracle Database 20c之区块链表
Oracle Database 20c的一些微妙变化
关于Oracle的Sequence,你需要知道的
Oracle数据库优化方面资料
Oracle Database 19c在优化方面有哪些新特性
Oracle Database 20c云端预览版发布了
Oracle 19c新特性之RAC Automatic Failback Service
Install Oracle RAC Database 19c Step by Step
保障业务连续性的神器





How To Setup a Rapid Home Provisioning (RHP) Server and Client (Doc ID 2097026.1)

In this Document


Goal

Solution

Introduction

Using Rapid Home Provisioning

GNS Setup

Creating a Rapid Home Provisioning Server

RHP Server:  Create the Rapid Home Provisioning Server resource

RHP Server:  Start the Rapid Home Provisioning Server resource

RHP Server: HA-VIP setup

RHP Server: Create client data file

RHP Client setup

Scenarios to Use Rapid Home Provisioning

Adding Gold Images to the Rapid Home Provisioning Server

Database Home provisioning

Database home provisioning (LOCAL)

Database home provisioning (NFS)

Database provisioning

Switch to Managed Homes

Database Patching

Standby Database Patching

Troubleshooting

References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
IBM AIX on POWER Systems (64-bit)
Linux x86-64
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on x86-64 (64-bit)

GOAL

To provide the steps to setup a Rapid Home Provisioning (RHP) Server & Client

SOLUTION

Introduction

Rapid Home Provisioning (RHP) represents a standard way for provisioning, patching and update at organizational level, in a unified manner, across all architectural layers of software infrastructure – Oracle databases and custom software.

  • Rapid Home Provisioning is a method of deploying software homes from single cluster where you create, store and manage templates of Oracle homes as images - called gold images - of Oracle software. The DBA can make a working copy of any gold image and then provision that working copy to any RHP Client in a data center.
  • RHP is installed as part of Grid Infrastructure. Oracle Clusterware manages the components that form the Rapid Home Provisioning Server. These components include the RHP server itself, Grid Naming Service (GNS) which is used to advertise the location of the RHP server, a VIP to support HA-NFS (required if there are any clients that you want to provision to - whether you use NFS storage for the workingcopies or not) and Oracle ASM Cluster File System (ACFS) which is used to store snapshots of the working copies.
  • The gold images represent an installed home, whether that is an Oracle Database software home or some custom software home. The gold image is stored in an Oracle Automatic Software Management Cluster File System (Oracle ACFS).
  • Metadata describing an installed home is stored as an image series in the Management Repository. The Management Repository (or Management Database MGMTDB) is created when installing Oracle Grid Infrastructure.
Note: in order to provide an Oracle Home (workingcopy) to an RHP Client will require about  60min if LOCAL,  30min if by NFS (storagetype NFS). Many operations are needed like DBHome cloning, relink, etc. 

Using the rhpctl utility, gold images can be imported from an installed home on any of the RHP clients or RHP Server.

An existing working copy can be promoted to a gold image.

  • A working copy is an instantiation of an Oracle database software home
  • Working copies are writable and independent of one another

Using RHP we can provision Oracle GI/DB software for the various versions

  • 11.2.0.* (Oracle Database 11g)
  • 12.1.0.* (Oracle Database 12c)
  • 12.2.0.* (Oracle Database 12c)

It's recommended on RHP Server to use the  latest GI (Grid Infrastructure) version (at the time of writing this article 12.2.0.1_180116).

Using Rapid Home Provisioning

Rapid Home Provisioning requires ASM, the Management DB and the Grid Naming Service (GNS). As part of the Grid Infrastructure deploy

  • ASM is configured
  • The Management Repository (Management DB) is available. The Management DB is installed by default with Oracle Grid Infrastructure 12.2.0.1
# $GRID_HOME/bin/srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node oda101

As the Management DB (MGMTDB) is doing a key role with the RHP, you should consider to setup a backup for it, in particular for the schema: ' GHSUSER' (for example using  expdp).
The size of it depends on the number of images, workingcopies, sites, users, etc. 
In general, the size requirement is very low since we only store the metadata: for 100 images, 2000 workingcopies and 25 RHP Clients, our internal test showed a size of about 200 Mb only.

You need to configure the GNS such that a GNS VIP is provided. A GNS with Zone Delegation is  not required by RHP.

Note:
you could skip the manual steps to setup RHP Server using "setrhp" the "1-Click" utility described on  Note:2124960.1 -  Rapid Home Provisioning (RHP) setup in "1-Click"

GNS Setup

Execute the following command as root, providing a valid IP address (domain is not needed on RHP):

# $GRID_HOME/bin/srvctl add gns -vip {<vip_name> | <ip>}
# $GRID_HOME/bin/srvctl start gns

example:
  # $GRID_HOME/bin/srvctl add gns -vip rhps-gns
  # $GRID_HOME/bin/srvctl start gns

  # $GRID_HOME/bin/srvctl status gns
  GNS is running on node rhps.
  GNS is enabled on node rhps.
  # $GRID_HOME/bin/srvctl config gns
  GNS is enabled.
  GNS VIP addresses: 10.xxx.51.63
  Domain served by GNS: No domain is being forwarded.

 

Note: currently the GNS setup is required on RHP Server only. We advertise to GNS the exact host and port where RHP Server is running which is used by RHP Clients to connect to RHP Server.

Once the GNS is configured the Rapid Home Provisioning server can be configured.

Creating a Rapid Home Provisioning Server

The Rapid Home Provisioning Server uses an Oracle ACFS file system for Oracle database software homes that will be published to clients.

To configure the Rapid Home Provisioning Server you will need to:

  • Provide an ASM diskgroup (DATA/RECO). It is recommended that this diskgroup is with at least 100Gb in free space. The diskgroup is used to store gold images and RHP managed NFS-provisioned workingcopies.
  • Provide a mount path that exists on all nodes of the RHP server. Oracle ACFS snapshots can be used to provision server-local workingcopies or NFS-mounted workingcopies on clients.
  • Configure an HA VIP. The NFS client, on the RHP client clusters will communicate with the NFS server on the RHP server over this IP address for NFS mounted homes. The VIP allows for the configuration of HANFS. Note that the HA VIP has to be configured in the same subnet as the default network configured on the RHP server. 

As  HANFS requires NFS in order to run. It is assumed that NFS (and its associated needs) will be started by init scripts at node boot time. NFS will need to be running on all RHP server nodes. We can check this on each node issuing:

# service  rpcbind status
rpcbind (pid 13256) is  running...

# service  nfs status
rpc.mountd (pid 13858) is running...
nfsd (pid 13855 13854 13853 13852 13851 13850 13849 13848 13847 13846 13845 13844 13843 13842 13841 13840 13839 13838 13837 13836 13835 13834 13833 13832 13831 13830 13829 13828 13827 13826 13825 13824 13823 13822 13821 13820 13819 13818 13817 13816 13815 13814 13813 13812 13811 13810 13809 13808 13807 13806 13805 13804 13803 13802 13801 13800 13799 13798 13797 13796 13795 13794 13793 13792 13791 13790 13789 13788 13787 13786 13785 13784 13783 13782 13781 13780 13779 13778 13777 13776 13775 13774 13773 13772 13771 13770 13769 13768 13767 13766 13765 13764 13763 13762 13761 13760 13759 13758 13757 13756 13755 13754 13753 13752 13751 13750 13749 13748 13747 13746 13745 13744 13743 13742 13741 13740 13739 13738 13737 13736 13735 13734 13733 13732 13731 13730 13729 13728) is running...
rpc.rquotad (pid 13713) is  running... 

# service  nfslock status
rpc.statd (pid  23372) is  running...

If one of these is not running, you could start it by using (as root):

/etc/init.d/<service> status

The 'chkconfig' command can be used to ensure that these services are started at boot time 

chkconfig nfs on
chkconfig rpcbind on
chkconfig nfslock on
Note: on OL5, the "rpcbind" service is called "portmap"
NFS operations such 'export' and 'mount' may fail due to misconfiguration or bugs.
You may verify the NFS functionalities with 'mnttest' tool, see  note:2167541.1 - RHP (Rapid Home Provisioning): mnttest tool to test NFS 'export' and 'mount' functionalities

 

NFS Usage: NFS is not required for 19c RHPS managing 19c RHPC or 18.4RHPC or later, however RHPS needs NFS for managing 122 RHPC.

 

Once the pre-requisites mentioned above have been met, the RHP server can be added to Grid Infrastructure and started.

RHP Server:  Create the Rapid Home Provisioning Server resource
Starting with Oracle Grid Infrastructure 18.1.0.0.0, when you install Oracle Grid Infrastructure, the Rapid Home Provisioning Server is configured, by default, in the local mode to support the local switch home capability. If you must configure the general Rapid Home Provisioning Server product, then you must remove the current local-mode Rapid Home Provisioning Server, using the following commands, as root:   

# srvctl stop rhpserver

Ignore a message similar to "Rapid Home Provisioning Server is not running".

# srvctl remove rhpserver

 

Assuming  DATA diskgroup usage, and ' /rhp_storage' as ACFS mount point, issue the following command (as 'root' user):

# $GRID_HOME/bin/ srvctl add rhpserver -storage <rhp_acfs-storage_path> -diskgroup <disk_group_name>

example:
$GRID_HOME/bin/srvctl add rhpserver -storage /rhp_storage -diskgroup DATA
Note: The storage path  "/rhp_storage"  is automatically created by  srvctl

If adding rhpserver with above command you are getting the warning message:

PRCT-1431 : The Oracle ASM Dynamic Volume Manager compatibility attribute is not set for disk group   

you can set it up with the command (attaching ASM instance with sqlplus)

ALTER DISKGROUP data SET ATTRIBUTE 'compatible. advm' = '12.2';

You can check the status for rhp server doing:

# $GRID_HOME/bin/ srvctl status rhpserver
Rapid Home Provisioning Server  is enabled
Rapid Home Provisioning Server  is not running

On all RHP Server nodes at this time, you have a new ACFS mount point:

[root@oda101 ~]# mount
(...)
/dev/asm/<MOUNT_PT> on /rhp_storage/chkbase type acfs (rw)

RHP Server:  Start the Rapid Home Provisioning Server resource

Issue the following command (as 'root' user):

# $GRID_HOME/bin/ srvctl start rhpserver

example:
[root@oda101 ~]# $GRID_HOME/bin/srvctl start rhpserver
[root@oda101 ~]# $GRID_HOME/bin/srvctl status rhpserver
Rapid Home Provisioning Server is enabled
Rapid Home Provisioning Server is running on node oda102

RHP Server: HA-VIP setup

On the RHP server as the Grid Infrastructure owner determine if an HA-VIP has been created (as 'grid' user):

$ $GRID_HOME/bin/ srvctl config havip
HAVIP exists: /rhphavip/10.xxx.51.64, network number 1
Description: 
Home Node: 
HAVIP is enabled.
HAVIP is individually enabled on nodes: 
HAVIP is individually disabled on nodes: 

If it's not configured, you need to issue the following command (as root): 

# $GRID_HOME/bin/srvctl add havip -id id -address {host_name | ip_address}

example
[root@oda101 ~]# $GRID_HOME/bin/ srvctl add havip -id rhphavip -address 10.xxx.51.64 

RHP Server: Create client data file

On RHP Server create the RHP client configuration file (as 'grid' user), RHPCTL creates the client data file in the directory path you specify after the -toclientdata flag. The name of the client data file is "client_cluster_name".xml: 

$GRID_HOME/bin/ rhpctl add client -client <client_cluster_name> -toclientdata <path>


example:
[grid@oda101 ~]$ $GRID_HOME/bin/rhpctl add client -client odaremote1-c -toclientdata /home/grid
oda101.<DOMAIN_NAME>: Creating client data ...
oda101.<DOMAIN_NAME>: Client data created for user "odaremote-c".

[grid@oda101 ~]$ ls –al /home/grid/stormcloud-cluster.xml
-rw-r—-r-- 1 grid oinstall 3158 Oct 31 21:59 /home/grid/odaremote-c.xml 

 

Note: to get the (RHP Client) cluster name (as grid user) issue the following command:
$GRID_HOME/bin/cemutlo -n 

move the RHP Client config file created above to the RHP Client:

example:
[grid@oda101 ~]$ scp odaremote-c.xml root@odaremote1:/home/grid
 

At this time you should configure the RHP Client.

RHP Client setup

12.1.0.2 target cluster cannot be an RHP client of an 12.2 RHP Server. For a 12.2 RHP server cluster, pre-12.2 targets can be accessed using one of the connectivity mechanisms - sudo or root or ssh. This situation applies only between 12.1 and 12.2

Perform the following actions on the RHP client cluster (as 'root' user):

  1. Create the RHP client using the XML wallet created for this cluster
  2. Start the RHP client.
$GRID_HOME/bin/ srvctl add rhpclient –clientdata <path/rhpclient_configfile.xml>
$GRID_HOME/bin/ srvctl start rhpclient

example:
[root@odaremote1 ~]# $GRID_HOME/bin/srvctl add rhpclient -clientdata /home/grid/odaremote-c.xml
[root@odaremote1 ~]# $GRID_HOME/bin/srvctl status rhpclient
Rapid Home Provisioning Client is enabled
Rapid Home Provisioning Client is not running
[root@odaremote1 ~]# $GRID_HOME/bin/ srvctl start rhpclient 

The command “ srvctl add rhpclient” has two optional arguments:

-diskgroup <dg_name> A disk group from which to create the ACFS file systems for image storage.
-storage <base_path> A location which is available on every cluster node and is not necessarily shared.

"-diskgroup" and "-storage" are defined as a pair (you cannot define one without the other). They can be provided in "srvctl add rhpclient", and they may be modified or added with "srvctl modify rhpclient". The specified diskgroup and storage location are used in two scenarios:

1. when provisioning working copies of Oracle Database Homes in to RHP_MANAGED_STORAGE. RHP_MANAGED_STORAGE is the recommended storage type for Oracle Database Homes because it leverages ACFS features to minimize storage footprint.
2. If the client is a multi-node cluster. When a working copy of a software home (Grid, DB or generic) is provisioned to the client, the client will create a local cached copy in ACFS, and then copy it to the other nodes of the cluster locally. (Otherwise, the RHP Server itself must provision the working copy to each node.)

Scenarios to Use Rapid Home Provisioning

Adding Gold Images to the Rapid Home Provisioning Server

Rapid Home Provisioning Server stores and serves gold images of software homes. These gold images must be instantiated on the Rapid Home Provisioning Server. Gold images are read-only, preventing a client from running programs from them. Gold images are not used as software homes directly. Rather, the gold image is used to create working copies. These working copies are usable as software homes on RHP Client.

The DBA can import software to the Rapid Home Provisioning Server using any one of the following methods:

- Import a gold image from an installed home on the Rapid Home Provisioning Server using the following command:

rhpctl import image -image <image name> -path <source oracle home path> -imagetype ORACLEDBSOFTWARE

- Import a gold image from an installed home on a Rapid Home Provisioning Client, using the following command run from the RHP Client:

rhpctl import image –image <image name> –path <source oracle home path>

- Promote an existing workingcopy to a gold image using the following command:

rhpctl add image –image <image name> -workingcopy <workingcopy name>

As example,  let's suppose you have created several Oracle homes (on RHP Server) 

Oracle Home Name Oracle Home version             Home Location 
---------------- -------------------             ------------ 
OraDb11203_home1 11.2.0.3.14(20299017,17592127)  <DB_HOME_1>
OraDb11204_home1 11.2.0.4.6(20299013)            <DB_HOME_2>
OraDb12102_home1 12.1.0.2..4(20831110,20831113)  <DB_HOME_3>

You could make them available as gold image issuing the following command (as 'grid' user):

example:
$ $GRID_HOME/bin/ rhpctl import image -image OraDb11203_home1 -path <DB_HOME_1> -imagetype ORACLEDBSOFTWARE
slcac464.<DOMAIN_NAME>: Creating a new ACFS file system for image "OraDb11203_home1" ...
slcac464.<DOMAIN_NAME>: Copying files...
slcac464.<DOMAIN_NAME>: Copying home contents...
slcac464.<DOMAIN_NAME>: Changing the home ownership to user oracle...
slcac464.<DOMAIN_NAME>: Transferring data to 1 nodes
slcac464.<DOMAIN_NAME>: 10% complete
slcac464.<DOMAIN_NAME>: 20% complete
slcac464.<DOMAIN_NAME>: 30% complete
slcac464.<DOMAIN_NAME>: 40% complete
slcac464.<DOMAIN_NAME>: 50% complete
slcac464.<DOMAIN_NAME>: 60% complete
slcac464.<DOMAIN_NAME>: 70% complete
slcac464.<DOMAIN_NAME>: 80% complete
slcac464.<DOMAIN_NAME>: 90% complete
slcac464.<DOMAIN_NAME>: 100% complete
slcac464.<DOMAIN_NAME>: Changing the home ownership to user grid...

$ $GRID_HOME/bin/ rhpctl import image -image OraDb11204_home1 -path <DB_HOME_2> -imagetype ORACLEDBSOFTWARE
slcac464.<DOMAIN_NAME>: Creating a new ACFS file system for image "OraDb11204_home1" ...
slcac464.<DOMAIN_NAME>: Copying files...
slcac464.<DOMAIN_NAME>: Copying home contents...
slcac464.<DOMAIN_NAME>: Changing the home ownership to user oracle...
slcac464.<DOMAIN_NAME>: Transferring data to 1 nodes
slcac464.<DOMAIN_NAME>: 10% complete
slcac464.<DOMAIN_NAME>: 20% complete
slcac464.<DOMAIN_NAME>: 30% complete
slcac464.<DOMAIN_NAME>: 40% complete
slcac464.<DOMAIN_NAME>: 50% complete
slcac464.<DOMAIN_NAME>: 60% complete
slcac464.<DOMAIN_NAME>: 70% complete
slcac464.<DOMAIN_NAME>: 80% complete
slcac464.<DOMAIN_NAME>: 90% complete
slcac464.<DOMAIN_NAME>: 100% complete
slcac464.<DOMAIN_NAME>: Changing the home ownership to user grid...

$ $GRID_HOME/bin/ rhpctl import image -image OraDb12102_home1 -path <DB_HOME_3> -imagetype ORACLEDBSOFTWARE
slcac464.<DOMAIN_NAME>: Creating a new ACFS file system for image "OraDb12102_home1" ...
slcac464.<DOMAIN_NAME>: Copying files...
slcac464.<DOMAIN_NAME>: Copying home contents...
slcac464.<DOMAIN_NAME>: Changing the home ownership to user oracle...
slcac464.<DOMAIN_NAME>: Transferring data to 1 nodes
slcac464.<DOMAIN_NAME>: 10% complete
slcac464.<DOMAIN_NAME>: 20% complete
slcac464.<DOMAIN_NAME>: 30% complete
slcac464.<DOMAIN_NAME>: 40% complete
slcac464.<DOMAIN_NAME>: 50% complete
slcac464.<DOMAIN_NAME>: 60% complete
slcac464.<DOMAIN_NAME>: 70% complete
slcac464.<DOMAIN_NAME>: 80% complete
slcac464.<DOMAIN_NAME>: 90% complete
slcac464.<DOMAIN_NAME>: 100% complete
slcac464.<DOMAIN_NAME>: Changing the home ownership to user grid...

Note as at this time you will have three new ACFS filesystems (for every single  rhpctl import command, a new ACFS mount point will be created):

$ df -h
Filesystem Size Used Avail Use% Mounted on
(...)
/dev/asm/<MOUNT_PT> 1.0G 141M 884M 14% /rhp_storage/images/chkbase
/dev/asm/ghvol960162-338
15G 5.2G 9.9G 35%  /rhp_storage/images/iOraDb11203_home1673418
/dev/asm/ghvol439750-338
15G 5.2G 9.9G 35%  /rhp_storage/images/iOraDb11204_home1977401
/dev/asm/ghvol937106-338
18G 5.9G 13G 33%  /rhp_storage/images/iOraDb12102_home1267449

Database Home provisioning

The command  rhpctl add workingcopy is used to provision an ORACLE_HOME for use by an Oracle database. This command can be run on the RHP Server or on the RHP Client. If run on the RHP Server, the command can provision an Oracle database either RHP-server-local or remotely on any RHP Client. When using the  rhpctl command on the RHP Server, use the  -client option to specify the remote cluster.

- Create the mount point for the working copy on all nodes of the RHP Client

example:
[root@odaremote1 /]# mkdir -p /u01/rhp_base
[root@odaremote1 /]# chown -R oracle:oinstall /u01/rhp_base
[root@odaremote2 /]# mkdir -p /u01/rhp_base
[root@odaremote2 /]# chown -R oracle:oinstall /u01/rhp_base

Database home provisioning (LOCAL)
Usage: rhpctl add workingcopy -workingcopy <workingcopy_name> -image <image_name> [-oraclebase <oraclebase_path>] [-path <where_path>] [-storagetype {NFS | LOCAL | RHP_MANAGED}] [-user <user_name>] [-dbname <unique_db_name> [-dbtype {RACONENODE | RAC | SINGLE}] [-datafileDestination <datafileDestination_path>] [-dbtemplate <file_path> | <image_name>:<relative_file_path>] {-node <node_list> | -serverpool <pool_name> [-pqpool <pool_name> | -newpqpool <pool_name> -pqcardinality <cardinality>] | -newpool <pool_name> -cardinality <cardinality> [-pqpool <pool_name> | -newpqpool <pool_name> -pqcardinality <cardinality>]} [-cdb] [-pdbName <pdb_prefix> [-numberOfPDBs <pdb_count>]]] [-client <cluster_name>] [-ignoreprereq | -fixup] [-responsefile <response_file_path>] [-clusternodes <nodelist>] [-groups <grouplist>] [-root | -sudouser <sudo_user_name> -sudopath <sudo_binary_path>] [-notify [-cc <user_list>]] [-asmclientdata <data_path>] [-gnsclientdata <data_path>] [-clustermanifest <data_path>] [-softwareonly] [-local] [-inventory <inventory_path>] [-targetnode <target_node_name>] [-agpath <read_write_path> -aupath <gold_image_path>] [-setupssh] [-useractiondata <user_action_data>] [-help <options>]

-help [REMOTEPROVISIONING|STORAGETYPE|ADMINDB|POLICYDB|DBWITHPQPOOLS|DBTEMPLATE|PDB|GRIDHOMEPROV|SWONLYGRIDHOMEPROV|STANDALONEPROVISIONING] Typical options (context sensitive) for various use cases

-workingcopy <workingcopy_name> Name of the working copy to be created
-image <image_name> Image name from the configured images

-oraclebase <oraclebase_path> ORACLE_BASE path for provisioning Oracle database home or Oracle Grid Infrastructure home
-inventory <inventory_path> Location of Oracle Inventory
-path <path> The absolute path for provisioning software home (For database images, this will be the ORACLE_HOME)
-storagetype {NFS | LOCAL | RHP_MANAGED} Type of storage for the home
-user <user_name> Name of the user for whom the software home is being provisioned

-dbname <unique_db_name> Name of database (DB_UNIQUE_NAME) to be provisioned
-dbtype {RACONENODE | RAC | SINGLE} Type of database: RAC One Node or RAC or Single Instance
-datafileDestination <datafileDestination_path> Data file destination location or ASM disk group name
-dbtemplate <filepath> | <image_name>:<relative_file_path> Absolute file path for the template file or relative path to the image home directory on Rapid Home Provisioning Server
-node <node_list> Comma-separated list of nodes on which database will be created
-serverpool <pool_name> Existing server pool name
-newpool <pool_name> Server pool name for pool to be created
-cardinality <cardinality> Cardinality for new server pool
-pqpool <pool_name> Existing PQ pool name
-newpqpool <pool_name> PQ pool name for pool to be created
-pqcardinality <cardinality> Cardinality for new PQ pool
-cdb To create database as container database
-pdbName <pdb_prefix> The pdbName prefix if one or more PDBs need to be created
-numberOfPDBs <pdb_count> Number of PDBs to be created
-client <cluster_name> Client cluster name
-ignoreprereq To ignore the CVU pre-requisite checks
-fixup Execute fixup script. Valid only for Grid Infrastructure provisioning.
-responsefile response file to be used to perform Oracle Grid Infrastructure provisioning
-clusternodes <node_name>:<node_vip>[:<node_role>][,<node_name>:<node_vip>[:<node_role>]...] Comma-separated list of node information on which Oracle Clusterware will be provisioned
-groups "OSDBA|OSOPER|OSASM|OSBACKUP|OSDG|OSKM|OSRAC=<group_name>[,...]" Comma-separated list of Oracle groups to be configured in the working copy.

-root Use root credentials to access the remote node
-sudouser <username> perform super user operations as sudo user name
-sudopath <sudo_binary_path> location of sudo binary
-notify Send email notification
-cc <users_list> List of users to whom email notifications will be sent, in addition to owner of working copy

-asmclientdata <data_path> File that contains the ASM client data
-gnsclientdata <data_path> File that contains the GNS client data
-clustermanifest <data_path> Location of Cluster Manifest File
-local Perform Grid Infrastructure software-only provisioning on the local node.
-softwareonly Perform Grid Infrastructure software-only provisioning.
-targetnode <node_name> Name of a node in a remote cluster with no Rapid Home Provisioning Client
-agpath <read_write_path> Read-write path for OLFS-based Oracle home.
-aupath <gold_image_path> Gold image path for OLFS-based Oracle home
-setupssh sets up passwordless SSH user equivalence on the remote nodes for the provisioning user
-useractiondata <user_action_data> Value to be passed to useractiondata parameter of useraction script

Provide an Oracle Home to RHP Client available as "oracle" user making it available " locally" (as 'grid' user from RHP Server)

example:
[grid@oda101 ~]$  rhpctl add workingcopy -workingcopy WC_OraDb11204_home1  -image OraDb11204_home1  -oraclebase /u01/rhp_base
Note: the path defined by "-oraclebase" must be writable by the user defined by "-user" option

Creating a workingcopy, a new ACFS snapshot of the DB Home gold image will be created, example:

[root@oda101 ~]# acfsutil snap info /rhp_storage/images/ iOraDb11204_home1977401
snapshot name:               wWC_OraDb11204_home1
snapshot location:           /rhp_storage/images/iOraDb11204_home1977401/.ACFS/snaps/ wWC_OraDb11204_home1
RO snapshot or RW snapshot:  RW
parent name:                 /rhp_storage/images/iOraDb11204_home1977401
snapshot creation time:      Tue Sep  8 00:58:57 2015

    number of snapshots:  1
    snapshot space usage: 1614921728  (   1.50 GB )

Database home provisioning (NFS)

Provide an Oracle Home to RHP Client available as " oracle" user making it available  by " NFS" (HA-NFS) (as 'grid' user from RHP Server):

example:
[grid@oda101 ~]$  rhpctl add workingcopy -workingcopy WC_OraDb11204_home1  -image OraDb11204_home1  -oraclebase /u01/rhp_base - client odaremote-c  -storagetype NFS -user oracle
  

Database provisioning

Using RHP 'rhpctl add workingcopy', you can provide also a (RAC, RacOne, Single Instance) database (non-CDB, CDB).

Note: In case your RHP Client is an ODA (Oracle Database Appliance), it is  not recommended to provision the database using " rhpctl add workingcopy -dbname"
- there is no flexibilty on having the redologs file on REDO diskgroup (SSD) and the recovery files on RECO dg.
- the db template used is a generic template and not specialized for ODA
- special enhancements are done on ODA to store the database on ACFS filesystem

Switch to Managed Homes

A DBA can switch databases from an Oracle home that was not provisioned using Rapid Home Provisioning (unmanaged Oracle home) to an Oracle home provisioned and managed by Rapid Home Provisioning Server.

Assume the following:

  • Oracle Home installed at /u01/app/product/12.1.0/dbhome (currently an unmanaged home) on an RHP client cluster named odaremote. This home has one or more databases created from it.
  • A gold image named ORACLEDB12 is managed by the RHP server.
  • (Optionally) the gold image ORACLEDB12 has a working copy named myDB12HOME1 created on the client cluster odaremote from it.

Example:

RHP Client

Name   Type   Storage  HomeName         HomeLocation                              Version
-----  ------ -------- --------------   ----------------                          ----------
odasdb SINGLE ACFS      OraDb12102_home2 <DB_HOME_4>                               12.1.0.2.4(20831110,20831113)

----------------------------------------------------------------------------
RHP Server
[grid@oda101 ~]$ rhpctl query image
Image name: OraDb11203_home1
Image name: OraDb11204_home1
Image name: OraDb12102_home1

[grid@oda101 ~]$ rhpctl query workingcopy
Working copy name: WC_OraDb11203_home1
Working copy name: WC_OraDb11204_home1
Working copy name: WC_OraDb12102_home1

[grid@oda101 ~]$ rhpctl move database -sourcehome <DB_HOME_4> -client odaremote-c -patchedwc WC_OraDb12102_home1 -dbname odasdb

----------------------------------------------------------------------------
RHP Client
Name   Type   Storage  HomeName            HomeLocation                                          Version
-----  ------ -------- --------------      ----------------                                      ----------
odasdb SINGLE ACFS      WC_OraDb12102_home1 <RHP_WC_HOME_for_home_4>                              12.1.0.2.4(20831110,20831113)

Note: Moving a RAC database from un-managed Oracle Home to an RHP managed Oracle Home by default will be done in rolling mode

Database Patching

Similar to the above scenario, patching involves moving a database from one workingcopy to a new patched workingcopy.

Workingcopies are independent and multiple workingcopies can be created from the same gold image.
A typical scenario would involve creating an initial workingcopy from a base release. As new patches, PSUs are a good example, get released create a new workingcopy from your current gold image and apply the PSU.
The latest workingcopy would be promoted as a new gold image from which new databases are created. Existing databases can then be moved to this latest gold image (which contains the current PSU).
This maintains a lineage of homes, allows for reverting to an older home if necessary, and keeps databases up to date, with regard to PSU application.

Assume you are moving all databases from a workingcopy named  wcDB12PSU1 to a workingcopy named  wcDB12PSU2, you would issue the command:

rhpctl move database -sourcewc wcDB12PSU1 -patchedwc wcDB12PSU2 –image DBIMGPSU2

This command creates a new ORACLE_HOME based on the patched image, if it does not exist, and then switches all Oracle databases from their current ORACLE_HOME location to the new ORACLE_HOME.

By default, patching is performed in a  rolling mode. Use the  -nonrolling option to perform patching in non-rolling mode. The database is then completely stopped on the old ORACLE_HOME, and is then restarted using the newly patched ORACLE_HOME.

For databases versions 12.1.0.1 or higher, the command rhpctl move database also executes any SQL commands required for database patching. For database versions earlier than Oracle Database 12c Release 1, a message is displayed asking the user to run the SQL commands for database patching manually. If only a specific database is to have its ORACLE_HOME moved, include the  -dbnameswitch:

rhpctl move database -sourcewc wcDB12PSU1 -patchedwc wcDB12PSU2 -dbname myDB

Standby Database Patching

Similar to the above scenario, standby database patching involves moving a database oracle home from one workingcopy to a new patched workingcopy without applying any dictionary patch.

On RHP Client a standby database is running under 12.1.0.2.0:

Name     Type       Storage   HomeName             HomeLocation                                          Version                            
-----    ------     --------  --------------       ----------------                                      ----------                         
STDBY    SINGLE     ACFS      OraDb12102_home1     <DB_HOME_3>                                           12.1.0.2.0   

From the RHP Server provide a new OH 12.1.0.2.3 (as 'grid' user):

rhpctl add workingcopy -workingcopy WC_OraDb121023_home1 -image OraDb121023_home1 -oraclebase /rhp_oracle_home -client odaremote-c -storagetype NFS -user oracle

Now, on RHP Client a new OH 12.1.0.2.3 is show:

Oracle Home Name      Oracle Home version                  Home Location                           
----------------      -------------------                  ------------                            
OraDb12102_home1      12.1.0.2.0                          <DB_HOME_3>
WC_OraDb121023_home1  12.1.0.2.3(20299023)                /rhp_oracle_home/product/12.1.0.2/WC_OraDb121023_home1

At this point we can move the remote standby from binaries 12.1.0.2.0 to 12.1.0.2.3 (patch the standby OH), as 'grid' user:

rhpctl move database -sourcehome <DB_HOME_3> -client odaremote-c -patchedwc WC_OraDb121023_home1 -dbname STDBY

The STDBY database is now attached to the new OH provided above:

Name     Type       Storage   HomeName             HomeLocation                                       Version                            
-----    ------     --------  --------------       ----------------                                   ----------                         
STDBY    SINGLE     ACFS      WC_OraDb121023_home1 /rhp_oracle_home/product/12.1.0.2/WC_OraDb121023_home1 12.1.0.2.3(20299023)       
Note: Rapid Home Provisioning is Standby Database aware. The standby database will be in mount state, no db dictionary patches are applied (as part of PSU) waiting them by redo shipping from the primary DB.

 

Troubleshooting

- The RHP Server logs are located at the following location:

<oracle_base>/crsdata/<node_name>/rhp

- The RHP Client logs are located at the following location:

<gihome>/oc4j/j2ee/home/log/gh*.log

- In order to investigate what an srvctl command is doing:

export SRVM_TRACE=TRUE ; SRVCTL_TRACEFILE=/tmp/srv.trc

Depending on the nature of the error, enable additional tracing by defining SRVM_NATIVE_TRACE=TRUE and SRVM_JNI_TRACE=TRUE. This will produce additional jni trace information and is helpful to isolate issue in the jni layer.

REFERENCES

https://docs.oracle.com/en/database/oracle/oracle-database/18/cwadd/rapid-home-provisioning.html#GUID-CCEC5960-EDA4-4A3F-9643-0CA308EA49AA  
NOTE:2124960.1  - Rapid Home Provisioning (RHP) setup in "1-Click"
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwadd/rapid-home-provisioning.html#GUID-CCEC5960-EDA4-4A3F-9643-0CA308EA49AA  
NOTE:2126710.1  - RHP: Rapid Home Provisioning Server - Minimum Requirement
NOTE:2167541.1  - RHP (Rapid Home Provisioning): mnttest tool to test NFS 'export' and 'mount' functionalities
NOTE:2054804.1  - ODA (Oracle Database Appliance): How To Setup a Rapid Home Provisioning (RHP) Server and Client





About Me

........................................................................................................................

● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除

● 本文在个人微 信公众号( DB宝)上有同步更新

● QQ群号: 230161599 、618766405,微信群私聊

● 个人QQ号(646634621),微 信号(db_bao),注明添加缘由

● 于 2020年7月 在西安完成

● 最新修改时间:2020年7月

● 版权所有,欢迎分享本文,转载请保留出处

........................................................................................................................

小麦苗的微店https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

● 小麦苗出版的数据库类丛书: http://blog.itpub.net/26736162/viewspace-2142121/

小麦苗OCP、OCM、高可用、DBA学习班http://blog.itpub.net/26736162/viewspace-2148098/

● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/

........................................................................................................................

请扫描下面的二维码来关注小麦苗的微 信公众号( DB宝)及QQ群(230161599、618766405)、添加小麦苗微 信(db_bao), 学习最实用的数据库技术。

........................................................................................................................

 

 



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26736162/viewspace-2703216/,如需转载,请注明出处,否则将追究法律责任。

全部评论
【QQ:646634621】【微信:db_bao】【微信公众号:DB宝】【11g、12c OCM】【QQ群:230161599、618766405】【《数据库笔试面试宝典》作者】【OCP、OCM、高可用(RAC+DG+OGG)、MySQL培训班已开讲,只讲实用内容】

注册时间:2012-09-23

  • 博文量
    1519
  • 访问量
    8833109