3 Creating Oracle RAC Databases with DBCA

This chapter describes how to use Database Configuration Assistant (DBCA) in standalone mode to create and delete Oracle Real Application Clusters (Oracle RAC) databases. The topics in this chapter include the following:

See Also:

Oracle Real Application Clusters Administration and Deployment Guide for information about using DBCA to add and delete instances

3.1 Using Database Configuration Assistant with Oracle RAC

DBCA has the following primary database functions:

  • Create and delete databases

  • Create database templates

  • Create, plug, unplug, and delete pluggable databases (PDBs)

  • Add and delete database instances

  • Register databases in Oracle Enterprise Manager Cloud Control

  • Configure and register database options (such as Oracle Database Vault) with the Directory Server

    Note:

    Cluster Managed Services are no longer managed through DBCA. Instead, use the Cluster Managed Services page in Oracle Enterprise Manager Cloud Control, if available, or SRVCTL. For more information, see Oracle Real Application Clusters Administration and Deployment Guide.

See Also:

3.2 Benefits of Using Database Configuration Assistant

Oracle recommends that you use DBCA to create your Oracle RAC database, because preconfigured databases optimize your environment for features such as the server parameter file (SPFILE), and automatic undo management.

DBCA enables you to create both policy-managed and administrator-managed databases. With DBCA, you can create site-specific tablespaces as part of database creation. If you have data file requirements that differ from those offered by DBCA templates, then create your database with DBCA and modify the data files later. You can also run user-specified scripts as part of your database creation process.

DBCA also configures your Oracle RAC environment for various Oracle high availability features, such as cluster administration tools. DBCA also starts any database instances required to support your defined configuration.

You can use DBCA to create a database from templates supplied by Oracle, or from templates that you create. The templates contain settings optimized for a particular type of workload.

Oracle ships templates for the following two workload types:

  • General purpose or transaction processing

  • Data warehouse

For more complex environments, you can select the Custom Database option. This option does not use templates and results in a more extensive interview, which means that it takes longer to create your database.

Click Show Details to see the configuration for each type of database. Select the template suited to the type of workload your database will support. If you are not sure which to choose, then select the default General Purpose or Transaction Processing template.

3.3 Automatic Listener Migration from Earlier Releases

If your system has an Oracle Database 10g or 11g installation, and you install Oracle Database 12c Release 1 (12.1) either to coexist with or to upgrade the Oracle Database 10.1, 10.2, 11.1, or 11.2 installation, then most installation types automatically migrate the existing Oracle Database listener to the 12c Release 1 (12.1) Oracle home. During migration, the upgrade process configures and starts a default Oracle Net listener using the same TCP/IP port as the existing listener, with the IPC key value.

During the Oracle Clusterware upgrade, the default listener (LISTENER_NODENAME) was migrated to the Oracle Grid Infrastructure home (Grid home). DBCA always uses the default listener.

The listener migration process stops the listener in the existing Oracle home, and restarts it in the new Oracle home. If the database was using the default listener (LISTENER_NODENAME), then Oracle Net Configuration Assistant (NETCA) migrates the listener automatically to the Grid home as part of the Oracle Grid Infrastructure upgrade. If the database was using a nondefault listener, then Database Upgrade Assistant (DBUA) migrates the nondefault listener to the Oracle Database home.

Note:

During migration, client applications might not be able to connect to any databases that are registered to the listener that is being migrated.

3.4 Verifying Requirements for DBCA

To use Database Configuration Assistant (DBCA) to change the database configuration, run Cluster Verification Utility (CVU) to verify that your system is prepared for configuration changes using the following command syntax:

Grid_home\bin\cluvfy stage -pre dbcfg -n node_list -d Oracle_home [-verbose]

In the preceding syntax example, the variable Grid_home is the Oracle Grid Infrastructure home, the variable node_list is the list of nodes in your cluster, separated by commas, and the variable Oracle_home is the path for the Oracle home directory where OUI creates or modifies the database.

For example, to verify that your system is prepared for an Oracle Database with Oracle RAC installation on a two-node cluster with nodes node1 and node2, with the Grid home C:\app\12.1.0\grid, and with the Oracle home path C:\app\oracle\product\12.1.0\dbhome_1, enter the following command:

C:\app\12.1.0\grid\bin> cluvfy stage -pre dbcfg -n node1,node2 \
-d C:\app\oracle\product\12.1.0\dbhome_1

You can select the option -verbose to receive progress updates as CVU performs its system checks, and detailed reporting of the test results.

If the CVU summary indicates that the cluster verification check fails, then review and correct the relevant system configuration steps, and run the test again.

3.5 Creating an Oracle RAC Database with DBCA

To create a database with DBCA, you must have run the Oracle Net Configuration Assistant (NETCA) to configure your Oracle Net listener.ora file. You no longer need to set the operating system environment variables ORACLE_HOME to the Oracle RAC database home. You do not need to set ORACLE_UNQNAME to the database unique name unless you are using Oracle Transparent Data Encryption with Oracle RAC.

Note:

You can no longer set up email notification for Oracle RAC databases from either DBCA or OUI.

This section contains the following topics:

3.5.1 Tasks to Complete Before Using DBCA to Create an Oracle RAC Database

Before you can create an Oracle RAC database using DBCA, you must configure your system to meet the software requirements, if this was not done as part of the Oracle Grid Infrastructure installation.

The following sections describe some common tasks you must perform:

3.5.1.1 Decide on a Naming Convention to Use for Your Oracle RAC Database

The global database name can be up to 30 characters in length, and must begin with an alphabetic character. The domain portion of the global database name can be no more than 128 characters and can contain only alphabetic and numeric characters, and the period (.) character.

The maximum number of characters you can use for the SID prefix is 8 characters. DBCA uses the SID prefix to generate a unique value for the variable ORACLE_SID for each instance. The SID prefix must begin with an alphabetic character.

3.5.1.2 Configure Shared Storage for the Oracle RAC Database

Before starting DBCA to configure an Oracle RAC database, you must have installed Oracle Grid Infrastructure for a cluster, and you must have configured shared storage areas for Oracle RAC files. Storage administration tasks require the SYSASM system privileges, which are granted to members of the OSASM operating system group. This group may not be the same as the OSDBA group, whose members are granted the SYSDBA system privileges.

On Windows-based systems, if you plan to use Oracle ASM storage, then before you use DBCA to create a database, you must first create logical partitions without primary partitions on the disk drives. After creating the logical disk partitions you must delete the drive letters for these partitions on all nodes. Alternatively, you can stamp these partitions with asmtool.

After you have configured the disks to be used by Oracle ASM, you must create the disk groups that will be used by the database before starting DBCA. You can create disk groups by using SQL*Plus, Oracle Enterprise Manager, or Oracle ASM Configuration Assistant (ASMCA).

See Also:

3.5.1.3 Obtain the Password for the Oracle Home User

When using DBCA to create an Oracle database, or an Oracle RAC database, if an Oracle Home User was specified when the Oracle Database software was installed, then you will need to enter the password for this user when you create the database.

Figure 3-1 Specifying the Password for the Oracle Home User

Description of Figure 3-1 follows
Description of "Figure 3-1 Specifying the Password for the Oracle Home User"

3.5.2 Using DBCA to Create an Oracle RAC Database

The following topics in this section describe how to use DBCA to create and configure an Oracle RAC database:

3.5.2.1 Starting DBCA

To start DBCA, log in as an Administrator user. The user should also be a member of ORA_DBA or ORA_Homename_DBA group and should also be a member of ORA_ASMDBA if Oracle ASM is used as storage for the Oracle RAC database. You are prompted to enter the password for the Oracle Home User if you are administering an Administrator-managed Oracle RAC database and chose not to store the password in an Oracle Wallet.

Enter the command dbca from the Oracle_home\bin directory. On Windows-based platforms, you can also use the following method to start DBCA:

  1. Click Start.

  2. Select Programs.

  3. Under Programs, select Oracle - Oracle_home name.

  4. Select Configuration and Migration Tools.

  5. Select Database Configuration Assistant.

After you have started DBCA, to create an Oracle RAC database, you select the following:

  • Create Database on the Database Operation/Welcome page

  • Advanced Mode on the Creation Mode page

  • Oracle RAC database on the Database Template page

Note:

To run DBCA, you no longer need to set operating system environment variables ORACLE_HOME to the Oracle RAC database home, or ORACLE_UNQNAME to the database unique name. However, if you are using Oracle Transparent Data Encryption with Oracle RAC, then you still need to configure the ORACLE_UNQNAME parameter.

3.5.2.2 Cluster Detection and Node Selection when Using DBCA

When you start DBCA, it automatically shows options for Oracle RAC if it detects from the central Oracle Inventory that the Oracle Home is enabled for Oracle RAC.

If DBCA does not detect the Oracle home as an Oracle RAC home, check that the OUI inventory is correctly located in the directory C:\Program Files\Oracle\Inventory, and that the oraInventory file is not corrupted. Also, perform clusterware diagnostics by using the following CVU command syntax:

Grid_home\bin\cluvfy\cluvfy.bat stage -post crsinst -n nodelist

For example, if the Grid Home is D:\app\12.1.0\grid, and the nodes are named node1 and node2, then run the following command:

D:\app\12.1.0\grid\bin> cluvfy stage -post crsinst -n node1,node2

When using DBCA, if nodes that are part of your cluster installation do not appear on the Node Selection page, then run the Opatch lsinventory command to perform inventory diagnostics. Also use CVU to perform clusterware diagnostics.

3.5.2.3 Using DBCA to Select Storage to Use With Oracle RAC Database

You can choose to use either Oracle ASM Disk groups or a shared file system as storage for Oracle RAC database files.

On the Specify Database Storage Options page, if you do not see the diskgroups in DBCA, then either Oracle ASM is not configured, or diskgroups are not mounted. You can create diskgroups using ASMCA in the Grid home before starting DBCA.

If you are using Oracle ASM, then you can also select the Fast Recovery Area and size on this page.

3.5.2.4 Using DBCA to Specify Database Initialization Parameters for Oracle RAC

On the Initialization Parameters page, if you intend to add more nodes in your cluster than you have during the current DBCA session, then click All Initialization Parameters, and change the parameter CLUSTER_DATABASE_INSTANCES to the total number of nodes that you plan to add to the cluster.

In addition, if you click All Initialization Parameters, note that if your global database name is longer than 8 characters, then the database name value (in the DB_NAME parameter) is truncated to the first 8 characters, and the DB_UNIQUE_NAME parameter value is set to the global name.

See Also:

Oracle Database Administrator's Guide for information about initialization parameters

3.5.2.5 Actions Performed By DBCA for Oracle RAC Databases

After you respond to DBCA prompts, review the Summary dialog information and click OK, DBCA does the following:

  • Creates an Oracle RAC database, and its instances

  • Creates the Oracle RAC data dictionary views

  • Starts the Oracle services if you are on a Windows-based platform

  • Starts the Oracle Clusterware high availability services

  • Starts the database instances across cluster nodes

Caution:

After you have created the Oracle RAC database, to install additional Oracle Database products in the Oracle RAC database you have created, before you attempt to install the products, you must stop all processes running in the Oracle RAC database homes.

You must stop all processes running in the Oracle RAC homes so that Oracle Universal Installer can relink certain executables and libraries. Refer to Appendix D, "How to Stop Processes in an Existing Oracle Real Application Clusters Database" for additional information.

3.6 Creating an Oracle RAC Database on Direct NFS

This section describes how to install and create an Oracle RAC database that uses Direct NFS (dNFS) for storage. There are different configuration processes you must perform to use dNFS for your database file system.

  1. Perform a Software-Only Installation of Oracle Database

  2. Use ASMCA to Configure an ACFS Mount Point

  3. Use DBCA to Create and Configure the Database

  4. Enable and Configure Direct NFS

  5. Use ASMCA to Remove the ACFS Mount Point

3.6.1 Perform a Software-Only Installation of Oracle Database

In a software-only installation you install the Oracle Database software but do not create a database as part of the installation process.

  1. Start OUI by running setup.exe from the software staging location.

  2. On the Select Installation Option screen select "Install database software only".

  3. On the Grid Installation Options screen, select the product to install, for example "Oracle Real Application Clusters database software installation."

  4. Select the nodes on which you want to install the database software.

  5. Choose the languages to use with the installed software.

  6. Select the database edition to install. For Oracle RAC databases, you must choose Enterprise Edition.

  7. Specify an Oracle Home user, or choose to use a Windows-built in user for the software installation owner.

  8. On the Specify Installation Location screen, enter a path to the Oracle base directory and the software location (Oracle home directory).

  9. On the Summary screen, verify your selections, then click Install.

3.6.2 Use ASMCA to Configure an ACFS Mount Point

ASMCA enables you to create a ACFS mount point which will be used in the "common file location" step of DBCA.

When creating Oracle ACFS file systems on Windows, run ASMCA as a Windows domain user who is also an administrator of the computer.

  1. From the Grid_home/bin directory, run asmca.exe to start the Oracle ASM Configuration Assistant.

  2. Select the Disk Groups tab.

  3. Right-click Disk Group Name and select Create ACFS for Database use.

  4. In the Create ACFS for Database window specify the mount point location, volume name, and size, then click OK.

    For example, you might specify the following:

    • Mount Point: C:\oradatamnt

    • Volume Name: dbnfs

    • Size (GB): 70

  5. Click OK in the informational pop-up window that appears. This window summarizes the actions performed by ASMCA.

  6. Select the ASM Cluster File Systems tab.

  7. The mount point you just created should be displayed on this page.

See Also:

Oracle Automatic Storage Management Administrator's Guide for more information about creating an Oracle ACFS file system for database use

3.6.3 Use DBCA to Create and Configure the Database

Use DBCA to create an Oracle database.

  1. From the Oracle_home\bin directory, run dbca.exe to start the Database Configuration Assistant.

  2. On the Database Operation screen, select Create Database.

  3. On the Creation Mode screen, select Advanced Mode.

  4. On the Database Template screen, select Oracle Real Application Clusters (RAC) database for the Database Type.

    For the Configuration Type, you can choose either Policy-Managed or Administrator-Managed. Select the template most appropriate for the type of database you want to create.

  5. For the next four screen, make selections and provide information that best meet your business requirements.

  6. On the Storage Locations screen, select File System for the Database files Storage type. Select the option Use Common Location for All Database Files. In the File location field, specify the location of the mount point you created in "Use ASMCA to Configure an ACFS Mount Point," for example, C:\oradatamnt.

  7. On the Specify Database Options screen, choose any additional configuration you want for your database.

  8. On the Initialization Parameters screen, use the default settings, or provide customized values for the initialization parameters.

  9. On the Creation Options screen, select the option "Generate Database Creation Scripts." Specify a destination directory for the script file, or use the default value.

  10. After the Prerequisite checks complete, on the Summary screen, minimize the installation window. DO NOT click Finish at this point.

  11. Enable the Direct NFS option as described in "Enable and Configure Direct NFS.".

  12. Remove the virtual mount point you created with ASMCA, as described in "Use ASMCA to Remove the ACFS Mount Point."

  13. Create all the directories needed locally on each node as well as on the NFS server. For this example, you would create the following, where orcl represents the database SID and pdb1 represents the Pluggable Database (PDB) name:

    • On each node, create the directory c:\oracle\oradatamnt\orcl\pdb1

    • On the NFS server, create the directory /export/abcd/orcl/pdb1

  14. Return to the DBCA window and click Finish.

  15. Run the generated scripts on the cluster node to create the database.

  16. Map a drive letter to a CIFS share on the NFS server that represents the location of the database files.

    Use a command similar to the following:

    NET USE * \\filer\vol0\orcl 
    

    After you complete this step, both Oracle and the Windows OS can access the location where the database files reside. Oracle is using DNFS, but the Windows OS uses CIFS to access the same location on the NFS server.

  17. Verify Direct NFS is configured for the database.

    1. Start SQL*Plus.

    2. Connect to the newly created database as a DBA user.

    3. Run the following SQL command:

      SELECT * FROM v$dnfs_servers; 
      

3.6.4 Enable and Configure Direct NFS

To enable the Direct NFS option, run the program Oracle_home\bin\enable_dnfs.bat.

You must also create an oranfstab file. See Oracle Grid Infrastructure Installation Guide for Microsoft Windows x64 (64-Bit) for details.

3.6.5 Use ASMCA to Remove the ACFS Mount Point

Now you have configured the mount point using Direct NFS, you can remove the ACFS mount point using ASMCA.

When creating Oracle ACFS file systems on Windows, run ASMCA as a Windows domain user who is also an administrator of the computer.

  1. From the Grid_home/bin directory, run asmca.exe to start the Oracle ASM Configuration Assistant.

  2. Select the ASM Cluster File System tab.

  3. Select the mount point created earlier (C:\oradatamnt), then click Dismount All.

  4. Select the Volumes tab.

  5. Right-click the mount point you created in "Use ASMCA to Configure an ACFS Mount Point," then select Delete.

3.7 Using DBCA to Configure Oracle RAC One Node

If you have selected to install only the Oracle RAC software on cluster nodes, then you can use Oracle Database Configuration Assistant (DBCA) to configure Oracle RAC One Node.

See Also:

Oracle Technology Network for more information about Oracle RAC One Node:
http://www.oracle.com/technetwork/database/clustering/overview/

3.7.1 Using DBCA to Configure Non-CDBs

After installation, start DBCA. From the Database Operation page, select the option Create Database. On the Creation Mode page, select Advanced Mode. On the Database Template page, select Oracle RAC One Node database.

Selecting one node deploys Oracle RAC One Node on a single node. Oracle recommends that you select all nodes in the cluster to which you want Oracle RAC One Node to be able to fail over.

If you select less than two nodes, or create server pools with a cardinality of 2 or more, then DBCA posts a warning message that the configuration you select will not support failover of the Oracle RAC One Node instance.

When you create an administrator-managed Oracle RAC One Node database, note that while the database is started on only one of the pool of nodes you installed the binaries, all the candidate servers are placed into the Generic server pool. If the servers are not already in Generic or Free, then this may result in stopping resources that run on candidate servers.

See Also:

Oracle Database Concepts and Oracle Real Application Clusters Administration and Deployment Guide for more information about PDBs and adding services

3.8 Deleting an Oracle RAC Database Using DBCA

Deleting an Oracle RAC database using DBCA involves first deleting the database, and then removing the database's initialization parameter files, instances, Optimal Flexible Architecture (OFA) structure, and the Oracle network configuration for the database.

To delete a database using DBCA:

  1. Start DBCA on one of your cluster nodes:

    See "Starting DBCA".

    DBCA displays the Operations page, displaying different database deployment options.

  2. Select Delete a database, and click Next.

    DBCA displays a list of all Oracle RAC and single-instance databases running from the Oracle home where DBCA is run.

  3. If your user ID and password are not operating-system authenticated, then the List of Cluster Databases page displays the user name and password fields. If these fields appear, then enter a user ID and password for a user account that has SYSDBA privileges.

  4. Select the database to delete, and click Finish.

    After you click Finish, DBCA displays a dialog box to confirm the database and instances that you have configured DBCA to delete.

  5. Click OK to begin the deletion of the database and its associated files, services, and environment settings, or click Cancel to stop the operation.

When you click OK, DBCA continues the operation and deletes all the associated instances for this database. DBCA also removes the parameter files and password files.

At this point, you have accomplished the following:

  • Deleted the selected Oracle RAC database from the cluster

  • Deleted the selected Oracle RAC Database Oracle services on Windows-based platforms

  • Deleted high availability services assigned to the Oracle RAC database

  • Deleted the Oracle Net configuration for the Oracle RAC database

  • Deconfigured Oracle Enterprise Manager for the Oracle RAC database

  • Deleted the OFA directory structure for that Oracle RAC database from the cluster

  • Deleted the Oracle RAC database data files

3.9 Configuring Services on Oracle RAC with CDBs

During installation, if you select a multitenant container database (CDB), and configure pluggable databases (PDBs), then Oracle recommends that you add services to the PDBs after installation. If you do not add services to PDBs, and then the Oracle RAC One Node CDB fails over to another node, or you manually relocate the CDB to another node, then by default, all PDBs associated with that CDB that do not have registered services are restarted in MOUNTED state.

PDBs are opened in Read Write mode after failover or relocation only after you have configured the PDBs to have associated services. If you have not associated services to PDBs, then the PDBs remains in MOUNTED state when the CDB instance restarts.

To add services to a PDB, use the following srvctl command syntax, where cdbname is the name of the CDB, service_name is the name of the service, and pdbname is the name of the PDB:

srvctl add service -d cdbname -s service_name -pdb pdbname

After you add services to your PDBs, if you relocate the CDB with which the PDBs are associated, or the CDB fails over, then the PDBs associated with that CDB automatically open in Read Write state.