4 Deploying Oracle RAC Databases with Rapid Home Provisioning

This chapter describes how to deploy Oracle Real Application Clusters (Oracle RAC) databases using Rapid Home Provisioning and contains the following sections:

4.1 Understanding Rapid Home Provisioning for Oracle RAC

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

4.2 Using Rapid Home Provisioning to Deploy Oracle RAC Database Software

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:

This section contains the following topics:

4.2.1 Creating the Gold Image

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:

  1. 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.

  2. 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.

4.2.2 Provisioning Oracle Homes Using Database Software

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.

4.3 Deploying Database Software and Creating Databases

This section contains the following topics:

4.3.1 Creating Databases Using Templates

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).

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

4.3.2 Use Cases for Provisioning Databases

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:

4.3.2.1 Provisioning Oracle Database Locally and Remotely

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.

4.3.2.2 Provisioning Policy-Managed Databases Using Gold Images

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.

4.3.2.3 Provisioning Oracle RAC One Node Database

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

4.3.2.4 Provisioning Multitenant Container Database

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.

4.3.2.5 Provisioning Administrator-Managed Databases from Gold Images

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.

4.3.2.6 Provisioning Databases Using Templates

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.

4.3.2.7 Provisioning Database in an Existing Oracle Home

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.

4.3.2.8 Provisioning Database in Oracle Flex Cluster Environment

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

-workingcopy workingcopy_name

Working copy to provision the database

-image image_name

Image name

-oraclebase oraclebase_path

Oracle base location for provisioning Oracle Database home

-dbname unique_db_name

Unique name for the database

-datafileDestination datafile_destination_path

Path to store database data files or Oracle ASM disk group name.

-serverpool pool_name

Server pool in which the policy-managed database is provisioned

-node node_list

A node or comma-delimited list of several nodes on which to create the administrator-managed database

-pdbName pdb_prefix

The PDB name prefix if one or more PDBs need to be created.

-numberOfPDBs pdb_count

Number of PDBs

-dbTemplate file_path or -dbTemplate image-name:relative_file_path

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.

-storagetype {NFS|LOCAL|RHP_MANAGED}

Type of storage used for the provisioned Oracle home. The possible values are:

  • RHP_MANAGED: Storage provided by the Rapid Home Provisioning infrastructure, that is Oracle ACFS.

  • LOCAL: Storage that you specify on a file system on the target cluster.

  • NFS: Storage provided by Rapid Home Provisioning infrastructure on the server cluster and NFS-mounted on the target cluster.

If both -storagetype and -path options are not specified, then Rapid Home Provisioning will attempt to use RHP_MANAGED storage.

-path storage_path

Path where Oracle Database software is provisioned when using the LOCAL/NFS storage type.

If the -path option is not specified, then there are two possibilities:

  • If Rapid Home Provisioning Client is configured with a disk group, then Oracle Database software is provisioned on RHP_MANAGED storage, that is, Oracle ACFS.

  • If Rapid Home Provisioning Client is not configured with a disk group, then a default Oracle home path, such as oracle_base_path/product/db_version/workingcopy_name, based on the value of the -oraclebase option is used to provision the database software. This path could be shared or non-shared.

Note: To determine whether the Rapid Home Provisioning Client is configured with a disk group, run the srvctl config rhpclient command on the target cluster.

-client cluster_name

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 rhpctl command is run.

-user user_name

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 rhpctl command. When provisioning remotely, use the -client option to specify the client cluster and the -user option to specify the user on the client cluster.

-dbtype {RACONENODE|RAC|SINGLE}

Type of database to provision on the local Rapid Home Provisioning Server or remote Rapid Home Provisioning Clients. This can be RAC, RACONENODE, or SINGLE. If the -dbtype option is not specified on the command line, then an Oracle RAC database is created.

-pqpool server_pool_name

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 -newpqpool parameter) running on Leaf Nodes. If you create a new server pool, then you must specify a cardinality value for the server pool using the -pqcardinality parameter.


See Also:

4.3.3 Specifying Passwords for Provisioned Databases

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.

4.3.4 Deleting Databases on Provisioned Homes

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.

4.4 Patching Databases

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:

4.4.1 Creating an Image for Database Patching

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:

  1. Create a working copy of an existing database image that needs to be patched.

  2. On the provisioned ORACLE_HOME which is the working copy, apply the necessary set of patches using OPatch or other mechanism.

  3. 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
    
  4. To include the image as part of an existing image series:

    $ rhpctl add image -image image_name -workingcopy workingcopy_name -series series_name
    

4.4.2 Use Cases for Patching

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:

4.4.2.1 Moving Databases from Source Working Copy to Target Working Copy

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.

4.4.2.2 Creating a Working Copy Using a Database Image

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.

4.4.2.3 Moving Databases to an Oracle Home Managed by Rapid Home Provisioning Server

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

-sourcewc oracle_home_path

Name of the old working copy from which the database needs to be moved

-patchedwc oracle_home_path

Name of the new working copy to which the database needs to be moved

-image image_name

Name of the image

-dbname unique_db_name

Name of the database to be provisioned

-oraclebase oraclebase_path

Oracle base path for provisioning Oracle database home (Required only for ORACLEDBSOFTWARE image type)

-client client_cluster_name

Name of the client cluster

-sourcehome oracle_home_path

Source Oracle home path


See Also:

Oracle Clusterware Administration and Deployment Guide for information about rhpctl commands for Rapid Home Provisioning