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.

See Also:

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

3.1 Using DBCA with Oracle RAC or Oracle RAC One Node

Oracle Database Configuration Assistant (DBCA) is a tool for creating and configuring an Oracle database.

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 Oracle Database Configuration Assistant (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

Use Cluster Verification Utility (CVU) to verify that your system is prepared for configuration changes.

  • Prior to using 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.

    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.

Example 3-1 Using CVU Prior to Verify Your System is Prepared for an Oracle RAC Installation

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

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, or ORACLE_UNQNAME to the database unique name.

Note:

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

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

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

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

The global database name for an Oracle RAC database must meet the naming requirements. The global database name consists of the database name and the domain name.

  1. Choose a name for your database that has the following characteristics:
    1. Up to 30 characters in length
    2. Begins with an alphabetic character
  2. Determine the domain name portion of the global database name, that satisfies these requirements:
    1. Is up to 128 characters in length
    2. Contains only alphabetic and numeric characters, and the period (.) character
  3. Determine the ORACLE_SID values for each instance.
    The maximum number of characters you can use for the SID prefix is 8 characters. Oracle Database Configuration Assistant 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 Oracle Database Configuration Assistant (DBCA) to configure an Oracle RAC database, you must install Oracle Grid Infrastructure for a cluster, and configure shared storage areas for Oracle RAC files.

  1. Login as a user with SYSASM system privileges.
    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.
  2. On Windows-based systems, if you plan to use Oracle ASM storage, then before you use DBCA to create a database, you must perform the following steps:
    1. Create logical partitions without primary partitions on the disk drives.
    2. Delete the drive letters for these partitions on all nodes.
      Alternatively, you can stamp these partitions with asmtool.
    3. After you have configured the disks to be used by Oracle ASM, you must create the disk groups that is used by the database.
      You can create disk groups by using SQL*Plus, Oracle Enterprise Manager, or Oracle Automatic Storage Management Configuration Assistant (ASMCA).

See Also:

3.5.1.3 Obtain the Password for the Oracle Home User

When you use Oracle Database Configuration Assistant to create an Oracle database or an Oracle RAC database, and specify an Oracle Home User during installation, then you need to enter the password for this user.

Contact the user that installed the Oracle Database software and perform the following task:

See Also:

Oracle Grid Infrastructure Installation Guide for Microsoft Windows x64 (64-Bit) for more information about the Oracle Home user.

3.5.2 Using DBCA to Create an Oracle RAC Database

When using DBCA to create and configure an Oracle RAC database, there are a few screens to navigate and several actions performed.

3.5.2.1 Starting DBCA

You can either start the Oracle Database Configuration Assistant (DBCA) utility from the command line or from the Windows Start menu.

Note:

To run DBCA, you do not have to set operating system environment variables ORACLE_HOME to the Oracle RAC database home, or ORACLE_UNQNAME to the database unique name.
  1. Log in as an Administrator user.
    The user must also be a member of ORA_DBA or ORA_Homename_DBA group and must 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.
  2. To start DBCA from the command line:
    1. Open a command prompt window.
    2. Navigate to the Oracle_home\bin directory.
    3. Enter the command dbca.
  3. To start DBCA from the Start menu:
    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.
  4. 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

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

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.

Example 3-2 Performing Clusterware Diagnostics If DCBA Fails To Detect A Two-Node Cluster

If the Grid Home is D:\app\12.1.0\grid, and the nodes are named node1 and node2, then run the following command to perform clusterware diagnostics:

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

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 Oracle Database Configuration Assistant (DBCA), then either Oracle ASM is not configured, or the diskgroups are not mounted.
    You can create diskgroups using Oracle Automatic Storage Management Configuration Assistant (ASMCA) in the Grid Infrastructure home before starting DBCA.
  • If you are using Oracle ASM, then you can select the Fast Recovery Area and size on the Specify Database Storage Options page.
    When using Oracle ASM, the Fast Recovery Area defaults to the Oracle ASM Disk Group.

3.5.2.4 Using DBCA to Specify Database Initialization Parameters for Oracle RAC

Set the CLUSTER_DATABASE_INSTANCES parameter to the expected number of instances.

  1. On the Initialization Parameters page, if you intend to add more nodes in your cluster than you have during the current Oracle Database Configuration Assistant 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.
  2. 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

Review this information to understand about Oracle Database Configuration Assistant (DBCA) actions during Oracle RAC database creation.

After you respond to DBCA prompts, review the Summary dialog information and click OK, DBCA performs several actions.

  • 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, if you decide to install additional Oracle Database products in the Oracle RAC database you have created, then 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 "Preparing to Upgrade an Existing Oracle RAC Database" for additional information.

3.6 Creating an Oracle RAC Database on Direct NFS

There are different configuration processes you must perform when installing and create an Oracle RAC database that uses Direct NFS (dNFS) for the database files.

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 Oracle Universal Installer (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

Oracle Automatic Storage Management Configuration Assistant (ASMCA) enables you to create an Oracle Automatic Storage Management Cluster File System (Oracle ACFS) mount point which is used in the "common file location" step of Oracle Database Configuration Assistant (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 ASMCA.
  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 can 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.

    The mount point you just created is 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 Oracle RAC Database

Use Oracle Database Configuration Assistant (DBCA) to create an Oracle Real Application Clusters (Oracle RAC) database that uses Direct NFS for datafile storage.

  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. Perform the following steps on the Storage Locations screen:
    1. Select File System for the Database files Storage type.
    2. Select the option Use Common Location for All Database Files.
    3. 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 Oracle Automatic Storage Management Configuration Assistant (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 can 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

You must manually enable the Direct NFS option after installing the Oracle Database software.

  1. Run the program Oracle_home\bin\enable_dnfs.bat.
  2. Create an oranfstab file.

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 Oracle Automatic Storage Management Cluster File System (Oracle ACFS) mount point using Oracle Automatic Storage Management Configuration Assistant (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 ASMCA.
  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

You can use DBCA to create an Oracle RAC One Node database that is not a multi-tenant database.

  1. After installation, start DBCA.
  2. From the Database Operation page, select the option Create Database.
  3. On the Creation Mode page, select Advanced Mode.
  4. On the Database Template page, select Oracle RAC One Node database.
  5. Select the nodes on which to deploy Oracle RAC One Node.
    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.

    Note:

    When you create an administrator-managed Oracle RAC One Node database, 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:

3.8 Deleting an Oracle RAC Database Using DBCA

Deleting an Oracle RAC database using Oracle Database Configuration Assistant (DBCA) involves deleting the database and database objects.

DBCA first deletes the database, and then removes the database's initialization parameter files, instances, Optimal Flexible Architecture (OFA) structure, and the Oracle network configuration for the database.

  1. Start DBCA on one of your cluster nodes.
    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.

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