This chapter describes how to deploy Oracle Real Application Clusters (Oracle RAC) databases using Rapid Home Provisioning and contains the following sections:
Rapid Home Provisioning is a method of deploying software homes and databases to nodes in a cloud computing environment from a single cluster where you store templates of Oracle homes as images (called gold images) of Oracle software, such as databases, middleware, and applications. Using a working copy, which is a writeable Oracle Automatic Storage Management Cluster File System (Oracle ACFS) snapshot of the gold image, you can deploy an Oracle home, for example, to the Oracle Grid Infrastructure once and then use that home from any node in the cloud, without needing to provision the home each time you add a node to the cloud.
Gold images can be deployed in the same cluster as the Rapid Home Provisioning Server (RHPS) or a different cluster where a Rapid Home Provisioning Client (RHPC) is installed.
Table 4-1 indicates the various supported database releases and storage options for the database software for different releases:
Table 4-1 Supported Database Releases and Software Storage Options
Supported Release | Local Non-Shared | Local Shared | Network file system (NFS) | RHP_MANAGEDFoot 1 (Oracle ACFS) |
---|---|---|---|---|
12.1.0.x |
Yes |
Yes |
Yes |
Yes |
11.2.0.x |
Yes |
Yes |
Yes |
Yes |
10.2.0.5 |
Yes |
Yes |
No |
No |
Footnote 1 Storage provided by the Rapid Home Provisioning infrastructure
To provision Oracle RAC databases using Rapid Home Provisioning Server, the Rapid Home Provisioning Server must be configured and running in the Oracle Grid Infrastructure home, either on the cluster where the Oracle RAC database needs to be provisioned, or on a remote cluster. In the latter case, the cluster where the Oracle RAC database is to be provisioned, should be configured and running the Rapid Home Provisioning Client daemon.
See Also:
Oracle Clusterware Administration and Deployment Guide for information about how to configure Rapid Home Provisioning
Oracle Clusterware Administration and Deployment Guide for information about srvctl
commands and Rapid Home Provisioning
This section contains the following topics:
To provision an Oracle RAC database, the database software must be available as a gold image in the Rapid Home Provisioning Server cluster. To import the gold image, perform the following steps:
On any node in the Rapid Home Provisioning Server or Rapid Home Provisioning Client, run the Oracle Universal Installer and complete a software-only install of Oracle Database software. Download and install any required patches from My Oracle Support.
On the same node, create a gold image as follows:
$ rhpctl import image -image image_name -path path
where image_name
is the name of the gold image created by this command, and path
is the top-level directory path where the Oracle RAC database software was installed in step 1.
After the above steps are completed, the image is available for provisioning of Oracle RAC databases.
After creating a gold image on the Rapid Home Provisioning Server cluster, you can use the gold images to provision working copies on the server cluster or on remote clusters that are configured with the Rapid Home Provisioning Client daemon.
You can allow Rapid Home Provisioning Server to provide the storage space for the Oracle Home software or specify shared or non-shared storage path for the Oracle Database software.
This section contains the following topics:
You can use templates to create new databases and duplicate existing databases. The information in templates includes database options, initialization parameters, and storage attributes (for data files, tablespaces, control files, and online redo log files).
See Also:
Section 3.1, "Using DBCA with Oracle RAC or Oracle RAC One Node"
To specify a template for the database creation, use the '-dbtemplate
' option. You can specify the template location in any of the following ways:
An absolute path and filename: In this case, the template file should be available on all nodes in the target cluster.
-dbtemplate /u01/dbtemplates/db12/general_template.dbt
An image name and a relative path in the form of image-name:relative-path: This form is useful where the administrator might designate a single image as a holder of all database templates. In this case, the template is available on the Rapid Home Provisioning Server cluster, and is copied to the target cluster during the database creation.
-dbtemplate TEMPLATE_IMAGE:db12/general_template.dbt
This section explains how to use rhpctl
commands to provision database software and create databases. For information about rhpctl
command options, see Table 4-2.
This section contains the following topics:
Use the rhpctl add workingcopy
command to provision database software and Oracle Database. You can run this command on the Rapid Home Provisioning Server or on the Rapid Home Provisioning Client. If you run the command on the Rapid Home Provisioning Server, you can provision an Oracle RAC database either locally on the Rapid Home Provisioning Server, or remotely on any Rapid Home Provisioning Client. When you run the rhpctl
command on the Rapid Home Provisioning Server, use the -client
option to specify the remote cluster. Refer to Table 4-2 for default values for the add workingcopy
options.
Example 4-1 and Example 4-2 show local and remote provisioning of databases.
Example 4-1 Provision Oracle Database Software Home Locally
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase
Example 4-2 Provision Oracle Database Software Home Remotely
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -client payrollCluster -user payuser
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, it provisions Oracle Database software on the cluster for the user executing the command, with the default values for -storagetype
and -path
, if not specified, as explained in Table 4-2.
For more information about the options for this use case, see the context-sensitive help for rhpctl add workingcopy -help REMOTEPROVISIONING
on the command line.
To provision Oracle Database software and create a policy-managed database from a gold image on an existing server pool, specify the server pool name using the -serverpool
option. You can also provision Oracle Database software and create a policy-managed database on a new server pool using the -newpool
option. In this case, specify the -cardinality
option with a number to indicate the number of instances to be configured and started for this policy-managed database. The allocation of servers to this new pool depends on the current server and server pool configuration on the target cluster and CRS policies. Ensure that the Free server pool contains sufficient number of servers, otherwise other databases running on the nodes may be stopped to accommodate this database. The new pool is created for the Oracle Grid Infrastructure user (grid
) with the minimum and maximum size set to the specified cardinality, and uses the default values for all other parameters.
Example 4-3, Example 4-4, and Example 4-5 show how to create policy-managed databases.
Example 4-3 Create a Policy-Managed Database from a Gold Image on an Existing Server Pool
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbname proddb -datafileDestination PAYDG1 -serverpool proddbpool1
Example 4-4 Create Policy-Managed Database from a Gold Image on a New Server Pool
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbname proddb - datafileDestination PAYDG1 -newpool proddbpool1 -cardinality 4
Example 4-5 Create a Policy-Managed Database in LOCAL or User-Specified Location
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase
-storagetype LOCAL -path /u01/app/product/12.1.0/dbhome -dbname proddb -datafileDestination PAYDG1
-newpool proddbpool1 -cardinality 4
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, it provisions Oracle Database software on the cluster for the user executing the command with the default values for -storagetype
and -path
, if not specified, as explained in Table 4-2. It also creates a policy-managed Oracle RAC database on the specified server pool with database files located in the -datafileDestination
path.
For more information about the options for this use case, see the context-sensitive help for rhpctl add workingcopy -help POLICYDB
and rhpctl add workingcopy -help STORAGETYPE
on the command line.
To specify the type of database to provision, use the -dbtype
option. For example, to provision Oracle Database software and create a policy-managed Oracle RAC One Node database from a gold image:
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbtype RACONENODE -dbname proddb -datafileDestination PAYDG1 -serverpool proddbpool1
To provision Oracle Database software and create a policy-managed multitenant container database (CDB), specify the server pool name, the database files location, and the name and number of pluggable databases (PDBs):
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbname proddb -datafileDestination PAYDG1 -serverpool proddbpool1 -cdb -pdbName prodpdb -numberOfPDBs 10
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, it provisions Oracle Database software on the cluster for the user executing the command with the default values for -storagetype
and -path
, if not specified, as explained in Table 4-2. It also creates a policy-managed Oracle RAC multitenant container database (CDB) on the server pool and ten PDBs named prodpdb1
, prodpdb2
, and so on. The database files are located in the -datafileDestination
path.
For more information about the options for this use case, see the context-sensitive help for rhpctl add workingcopy -help PDB
on the command line.
To provision Oracle Database software and create an administrator-managed database from a gold image, specify the list of nodes where the Oracle RAC database instances need to be configured and started, using the -node
option. You must specify existing nodes on the target cluster in the list of nodes. Ensure that the nodes are in the Free or Generic server pool on the target cluster. If you specify nodes that are not in the Free or Generic pool, then policy-managed databases running on the nodes may be stopped to accommodate this database. Specify the type of database to provision using the -dbtype
option.
Example 4-6, Example 4-7, and Example 4-8 show how to create administrator-managed databases.
Example 4-6 Create a Administrator-Managed Oracle RAC Database from a Gold Image
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbname proddb -datafileDestination PAYDG1 -node prodsrvr1,prodsrvr2,prodsrvr3
Example 4-7 Create a Administrator-Managed Oracle RAC One Node Database from a Gold Image
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbtype RACONENODE -dbname proddb -datafileDestination PAYDG1 -node prodsrvr1,prodsrvr2,prodsrvr3
Example 4-8 Create a Single-Instance Oracle Database from a Gold Image
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbtype SINGLE -dbname proddb -datafileDestination PAYDG1 -node prodsrvr1
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, Oracle Database software is provisioned on the cluster for the user executing the command with the default values for -storagetype
and -path
, if not specified, as explained in Table 4-2. It also creates administrator-managed databases, single-instance, Oracle RAC, or Oracle RAC One Node, as per the -dbtype
option on the specified nodes, with database files located in the -datafileDestination
path.
For more information about the options for this use case, see the context-sensitive help for rhpctl add workingcopy -help ADMINDB
on the command line.
To provision Oracle Database software and create a database from a database template image, specify the template location using the -dbtemplate
option with the absolute file path of the template file or the relative path to the image home directory on the Rapid Home Provisioning Server. To specify an absolute file path for the template, the template must exist in the target cluster, on all nodes for a policy-managed database and on the nodes you specify in the command-line for administrator-managed database.
Example 4-9 and Example 4-10 show how to provision databases using templates.
Example 4-9 Create a Policy-Managed Database using Rapid Home Provisioning Server (RHPS) Image
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbname proddb -datafileDestination PAYDG1 -serverpool proddbpool1 -dbtemplate DBTMPLTIMG:templates/database/12.1.0/warehouse.dbt
Example 4-10 Create a Policy-Managed Database using Template Stored in a User-Defined Location
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase
-dbname proddb -datafileDestination PAYDG1 -serverpool proddbpool1
-dbtemplate /templates/database/12.1.0/warehouse.dbt
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, it provisions Oracle Database software on the cluster for the user executing the command with the default values for -storagetype
and -path
, if not specified, as explained in Table 4-2. It also creates a database on the specified server pool from the database template.
For more information about the options for this use case, see the context-sensitive help for rhpctl add workingcopy -help DBTEMPLATE
on the command line.
Use the rhpctl add database
command to provision a new database in an existing provisioned database software home and server pool. For example:
$ rhpctl add database -workingcopy mydbhome -dbname ORCL2 -datafileDestination PAYDG1 -serverpool pool2
The command creates a new database ORCL2 and starts it on all nodes that are active in the server pool pool2.
Provision Oracle Database software and create a database in an existing server pool and pqpool in Oracle Flex Cluster environment:
rhpctl add workingcopy -workingcopy myDBHome1 -image ORACLEDB12 -oraclebase /u01/app/product/12.1.0/obase -dbname proddb -dbtype RAC -datafileDestination PAYDG1 -serverpool proddbpool1 -pqpool proddbpool2
For more information about the options for this use case, see the context-sensitive help for rhpctl add workingcopy -help DBWITHPQPOOLS
on the command line.
Table 4-2 lists the parameters for the rhpctl
command.
Table 4-2 rhpctl Parameters for Provisioning Databases
Option | Description |
---|---|
|
Working copy to provision the database |
|
Image name |
|
Oracle base location for provisioning Oracle Database home |
|
Unique name for the database |
|
Path to store database data files or Oracle ASM disk group name. |
|
Server pool in which the policy-managed database is provisioned |
|
A node or comma-delimited list of several nodes on which to create the administrator-managed database |
|
The PDB name prefix if one or more PDBs need to be created. |
|
Number of PDBs |
|
Absolute file path for the template file or the relative path to the image home directory on Rapid Home Provisioning Server. If this option is not specified on the command line, then a new General Purpose Database is created. |
|
Type of storage used for the provisioned Oracle home. The possible values are:
If both |
|
Path where Oracle Database software is provisioned when using the LOCAL/NFS storage type. If the
Note: To determine whether the Rapid Home Provisioning Client is configured with a disk group, run the |
|
Name of the client cluster. If this option is not specified on the command line, then the provisioning operation is performed on the cluster from where the |
|
Owner of the provisioned Oracle Database software. If this option is not specified on the command line, then the provisioning operation is performed for the user executing the |
|
Type of database to provision on the local Rapid Home Provisioning Server or remote Rapid Home Provisioning Clients. This can be |
|
Name of an existing server pool. Note: This parameter is only applicable in an Oracle Flex Cluster environment and refers to server pools (either already defined as in this case, or to be created when you use the |
See Also:
rhpctl
commands for Rapid Home ProvisioningOracle Clusterware Administration and Deployment Guide for information about server allocation to server pools
There is no mechanism to specify passwords for the schemas of a provisioned database. If the password needs to be known, it is recommended that the DBA user connects to the database using OS authentication on the node where the database instance is running, and reset the password to the desired value for each schema.
Use the command rhpctl delete database
to remove an existing database from a provisioned database software home. To ensure successful deletion, the database should not be running.
You can patch databases in one of the following ways:
Patching the software
Patching either the data dictionary or schemas in the database, or both
See the following sections for more information:
Patching database software requires a one-time creation of a new image that includes the patched software. Follow these steps to create a database image:
Create a working copy of an existing database image that needs to be patched.
On the provisioned ORACLE_HOME
which is the working copy, apply the necessary set of patches using OPatch or other mechanism.
Run the command rhpctl add image
to create a new image from the updated working copy. This image is the patched version of the original image.
$ rhpctl add image -image image_name -workingcopy workingcopy_name
To include the image as part of an existing image series:
$ rhpctl add image -image image_name -workingcopy workingcopy_name -series series_name
To patch a database, run the command rhpctl move database
which creates a new ORACLE_HOME
based on a patched image, if it does not exist, and also makes the database run from this new location instead of its current ORACLE_HOME
location.
By default, patching is performed in 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 then restarted to make it run from the newly patched ORACLE_HOME
.
For databases versions 12.1.0.1 or higher, the command rhpctl move database
also executes SQL commands required for database patching. For database versions earlier than 12.1, a message is displayed asking the user to run the SQL commands for database patching manually.
This section contains the following use cases for patching:
Moving Databases from Source Working Copy to Target Working Copy
Moving Databases to an Oracle Home Managed by Rapid Home Provisioning Server
To move all databases running from a source working copy to a target working copy in rolling mode:
rhpctl move database -sourcewc myDBHome1 -patchedwc myDBHome2
To move a specific database running from a source working copy to a target working copy in rolling mode:
rhpctl move database -sourcewc myDBHome1 -patchedwc myDBHome2 -dbname proddb
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, it moves one or all databases from the cluster and Oracle home in the source working copy to the Oracle home in the target working copy in rolling mode.
You can also specify an image to create a working copy. For example, to create a target working copy and move all databases running from the source working copy to the target working copy in rolling mode:
rhpctl move database -sourcewc myDBHome1 -patchedwc myDBHome2 -image ORACLEDB12
When you run the command from Rapid Home Provisioning Server or Rapid Home Provisioning Client, it creates a target working copy from the values specified in the image, and moves all databases running on the cluster from the Oracle home in the source working copy to the Oracle home in the target working copy in rolling mode. The storage type of the newly-created target Oracle home is the same as the source Oracle home and the storage path has the default value mentioned for the -path
option in Table 4-2. For a Rapid Home Provisioning Client operation, the default storage type is LOCAL
.
Note:
You can move a source working copy from a non-shared Oracle home location to a target working copy in a shared Oracle home, but you cannot move a source working copy from a shared Oracle home location to a target working copy in a non-shared Oracle home.You can move 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. Run the following command to bring Oracle Databases within the purview of the Rapid Home Provisioning server:
rhpctl move database -sourcehome /u01/app/product/12.1.0/dbhome -oraclebase /u01/app/product/12.1.0/obase -client payrollCluster -patchedwc myDBHome1 -image ORACLEDB12
When you run the command from Rapid Home Provisioning Server, it creates a new working copy myDBHome1
from the database software gold image ORACLEDB12
and moves all databases currently configured or running in the Oracle home /u01/app/product/12.1.0/dbhome
to the new Oracle home.
Table 4-3 lists the parameters for the rhpctl
commands for patching databases.
Table 4-3 rhpctl Parameters for Patching Databases
Option | Description |
---|---|
|
Name of the old working copy from which the database needs to be moved |
|
Name of the new working copy to which the database needs to be moved |
|
Name of the image |
|
Name of the database to be provisioned |
|
Oracle base path for provisioning Oracle database home (Required only for ORACLEDBSOFTWARE image type) |
|
Name of the client cluster |
|
Source Oracle home path |
See Also:
Oracle Clusterware Administration and Deployment Guide for information aboutrhpctl
commands for Rapid Home Provisioning