15 Converting Single-Instance Oracle Databases to Oracle RAC and Oracle RAC One Node

Procedures for converting from Oracle Database single-instance databases to Oracle Real Application Clusters (Oracle RAC) and Oracle RAC One Node databases.

The procedures in this chapter assume that your original single-instance database and the target Oracle RAC database are using the same release and running on the same platform. If you are upgrading from an earlier version of Oracle RAC to Oracle RAC 12c, then use Oracle Database Upgrade Assistant (DBUA).

This chapter includes the following topics:

Note:

You must use clustered Oracle Automatic Storage Management (Oracle ASM) instances for Oracle RAC databases.

15.1 Administrative Issues for Converting Databases to Oracle RAC

You must address administrative considerations before converting single-instance databases to Oracle RAC.

  • Backup procedures should be available before converting from a single-instance Oracle Database to Oracle RAC. This includes taking a backup of your existing database before converting to Oracle RAC and being prepared to backup your Oracle RAC database immediately following the conversion.

  • For archiving with Oracle RAC environments, the archive file format requires a thread number.

  • The archived logs from all instances of an Oracle RAC database are required for media recovery. Because of this requirement, if you archive to a file and you do not use a cluster file system, or some other means to provide shared file systems, then you require a method of accessing the archive logs from all nodes on which the cluster database has instances.

  • By default, all database files are migrated to Oracle Managed Files. This feature simplifies tablespace creation, ensures data file location consistency and compliance with Oracle Flexible Architecture rules, and reduces human error with data file management.

15.2 Converting to Oracle RAC and Oracle RAC One Node Using DBCA

You can use Database Configuration Assistant (DBCA) to convert from single-instance Oracle databases to Oracle RAC or Oracle RAC One Node databases.

DBCA automates the configuration of the control file attributes, creates the undo tablespaces and the redo logs, and creates the initialization parameter file entries for cluster-enabled environments. DBCA also configures Oracle Net Services, Oracle Clusterware resources, and the configuration for Oracle RAC database management using Oracle Enterprise Manager or the Server Control utility (SRVCTL).

Before you use DBCA to convert a single-instance database to an Oracle RAC or an Oracle RAC One Node database, ensure that your system meets the following conditions:

  • Your system uses supported hardware and operating system software. Your system is configured properly to support an Oracle RAC database.

  • The nodes have access to shared storage; for example, either Oracle Cluster File System or Oracle ASM is available and accessible from all nodes. On Linux on POWER systems, ensure that GPFS is available and accessible from all nodes.

  • Your applications have no design characteristics that preclude their use with cluster database processing.

If your platform supports a cluster file system, then you can use it for Oracle RAC. You can also convert to Oracle RAC and use a non-shared file system. In either case, Oracle strongly recommends that you use Oracle Universal Installer to install Oracle Database 12c, which sets up the Oracle home and inventory in an identical location on each of the selected nodes in your cluster.

This section includes the following topics:

Related Topics

15.2.1 Converting Oracle Database Installations to Oracle RAC Using DBCA

To convert from a single-instance Oracle Database that is on a non-clustered computer to Oracle RAC, perform the procedures described in the following sections, and in the order shown:

15.2.1.1 Use DBCA to Create an Image of the Single-Instance Database

Use DBCA to create a preconfigured image of your single-instance database by using the following procedure:

  1. Navigate to the bin directory in $ORACLE_HOME, and start DBCA.

  2. At the Welcome page, click Next.

  3. On the Operations page, select Manage Templates, and click Next.

  4. On the Template Management page, select Create a database template and From an existing database (structure as well as data), then click Next.

  5. On the Source Database page, select the database name in the Database instance list, and click Next.

  6. Use SQL to ensure that all pluggable databases (PDBs) are open, as follows:

    SQL> SELECT name, open_mode FROM v$pdbs;

    If any of the PDBs are in a state other than OPEN, then open them using SQL.

  7. On the Template Properties page, enter a name for your template in the Name field. Oracle recommends that you use the database name.

    By default, the template files are generated in the directory $ORACLE_HOME/assistants/dbca/templates. You can enter a description of the file in the Description field, and change the template file location in the Template data file field.

    When you have completed the entries, click Next.

  8. On the Location of Database Related Files page, select Maintain the file locations, so that you can restore the database to the current directory structure, and click Finish.

DBCA generates two files: a database structure file (template_name.dbc), and a database preconfigured image file (template_name.dfb).

15.2.1.2 Complete the Oracle Clusterware Installation

Complete the installation of Oracle Clusterware.

15.2.1.3 Validate the Cluster

Validate the cluster configuration using Cluster Verification Utility (CVU).

15.2.1.4 Copy the Preconfigured Database Image

Copy the preconfigured database image. This includes copying the database structure *.dbc file and the database preconfigured image *.dfb file (that you used DBCA to create in a previous section) to a temporary location on the node in the cluster from which you plan to run DBCA.

15.2.1.5 Install Oracle Database 12c Software with Oracle RAC
  1. Run Oracle Universal Installer to install an Oracle Database with Oracle RAC.

  2. Select Cluster Installation Mode on the Specify Hardware Cluster Installation page of Oracle Universal Installer, and select the nodes to include in your Oracle RAC database.

  3. On the Oracle Universal Installer Database Configuration Types page, select the Advanced installation type.

    After installing the Oracle Database software, Oracle Universal Installer runs postinstallation configuration tools, such as Net Configuration Assistant (NETCA), DBCA, and so on.

  4. On the DBCA Template Selection page, use the template that you copied to a temporary location in the previous section. Use the browse option to select the template location.

    Select the option that you want to deploy. Your choices are the following: Oracle RAC database; Oracle RAC One Node database; or Oracle single-instance database.

  5. After creating the Oracle RAC database, DBCA displays the Password Management page on which you must change the passwords for database users who have SYSDBA and SYSOPER privileges. When DBCA exits, the conversion process is complete.

15.2.2 Converting Single Instance on a Cluster to Oracle RAC One Node Using DBCA

Use DBCA to convert a single-instance Oracle Database to Oracle RAC One Node by using the following procedure:

  1. Change directory to $ORACLE_HOME/bin.

  2. Start DBCA:

    $ dbca
  3. From the Welcome window, select Oracle RAC One Node database.

  4. Use the template that you selected to deploy in the previous section.

15.2.3 Converting Single Instance on a Cluster to Oracle RAC Using DBCA

There are three scenarios in which a single-instance database can exist on a cluster node:

  • Scenario 1: The Oracle home for the single-instance database was installed on a cluster node and has Oracle RAC enabled.

  • Scenario 2: The Oracle home for the single-instance database was installed on a cluster node, but the Oracle RAC feature is disabled for this Oracle home.

  • Scenario 3: The Oracle home for the single-instance database was installed on only the local node in a cluster. This happens when you select the Local Installation option on the Oracle Universal Installer Specify Hardware Cluster Installation page during the Oracle Database 12c installation.

15.2.3.1 Single-Instance Database on a Cluster Running from an Oracle RAC-Enabled Home

Perform the following procedures to convert a single-instance database on a cluster node running from an Oracle home that has the Oracle RAC option enabled.

  1. Use DBCA to create a preconfigured image of your single-instance database. To perform the conversion manually, shut down the single-instance database.

  2. Add nodes to your cluster. Ensure that all nodes can access the shared storage used by Oracle Clusterware and Oracle RAC.

  3. From the existing Oracle home, extend this home to the new nodes.

  4. From a newly added node, configure the listeners on the additional nodes using NETCA. Choose the same port number and protocol that you used on the existing node. If NETCA displays the existing node in the node list page, then do not select this node, because the listener is already configured on it.

  5. Convert the database using one of the following procedures:

15.2.3.1.1 Automated Conversion Procedure Using DBCA

If you used DBCA to create a preconfigured image of your single-instance database as described in a previous section, then perform the following steps to complete the conversion to an Oracle RAC database:

  1. Start DBCA from the initial node. Select the names of the nodes to include as part of your cluster database. On the Template Selection page, select the preconfigured template that you created. Enter the database name and respond to the remaining DBCA prompts.

  2. Specify the shared storage location for the Oracle Database data files.

After creating the Oracle RAC database, DBCA displays the Password Management page on which you must change the passwords for the database users who have SYSDBA and SYSOPER privileges. When DBCA exits, the conversion process is complete.

15.2.3.1.2 Manual Conversion Procedure

If you did not use DBCA to create a preconfigured image of your single-instance database as described in a previous section, then perform the following steps to complete the conversion:

  1. Create the Optimal Flexible Architecture directory structure on each of the nodes that you have added.

  2. Re-create the control files by running the CREATE CONTROLFILE SQL statement with the REUSE keyword and specify MAXINSTANCES and MAXLOGFILES, and so on, as needed for your Oracle RAC configuration. The MAXINSTANCES recommended default is 32.

  3. Shut down the database instance.

  4. If your single-instance database was using an SPFILE, then create a temporary parameter file (PFILE) from the SPFILE using the following SQL statement:

    CREATE PFILE='pfile_name' from spfile='spfile_name'
  5. Set the CLUSTER_DATABASE parameter to TRUE, and set the INSTANCE_NUMBER parameter to a unique value for each instance, using the sid.parameter=value syntax.

    If you optimized memory usage on your single-instance database, then adjust the size of the system global area (SGA) to avoid swapping and paging when you convert to Oracle RAC. You should make this adjustment because Oracle RAC requires about 350 bytes for each buffer to accommodate the Global Cache Service (GCS). For example, if you have 10,000 buffers, then Oracle RAC requires approximately 350 multiplied by 10,000 bytes more memory. Therefore, adjust the size of the SGA by changing the DB_CACHE_SIZE and DB_nK_CACHE_SIZE parameters accordingly.

  6. Start the database instance using the PFILE created in Step 4.

  7. If your single-instance database was using automatic undo management, then create an undo tablespace for each additional instance using the CREATE UNDO TABLESPACE SQL statement.

  8. Create redo threads that have at least two redo logs for each additional instance. Enable the new redo threads by using an ALTER DATABASE SQL statement. Then, shut down the database instance.

  9. Copy the Oracle password file from the initial node, or from the node on which you are working, to the corresponding location on the additional nodes on which the cluster database will have an instance. Replace the ORACLE_SID name in each password file appropriately for each additional instance.

  10. Set the REMOTE_LISTENER parameter to the single client access name (SCAN) and port.

  11. Configure the net service entries for the database and instances, and address entries for the LOCAL_LISTENER for each instance and for the REMOTE_LISTENER in the tnsnames.ora file, and copy the tnsnames.ora file to all nodes.

  12. Create the SPFILE from the PFILE.

  13. Create the $ORACLE_HOME/dbs/initsid.ora file that contains the following entry, where spfile_path_name is the complete path name of the SPFILE:

    spfile='spfile_path_name'
  14. On the local node, use SQL*Plus to run catclust.sql. This script creates the dictionary views needed for Oracle RAC databases. For example:

    SQL> start ?/rdbms/admin/catclust.sql
  15. Add the configuration for the Oracle RAC or Oracle RAC One Node database and its instance-to-node mapping using SRVCTL.

    1. To add the configuration of an Oracle RAC database, use the following commands:

      $ srvctl add database -dbname db_name -oraclehome Oracle_home -spfile spfile_path_name
      $ srvctl add instance -dbname db_name -instance inst1_name -node node1_name
      $ srvctl add instance -dbname db_name -instance inst2_name -node node2_name
      ...
    2. To add the configuration of an Oracle RAC One Node database, use the following command:

      $ srvctl add database -dbname db_name -dbtype RACONENODE -oraclehome Oracle_home
        -spfile spfile_path_name
  16. Start the Oracle RAC or Oracle RAC One Node database using SRVCTL:

    srvctl start database -d db_name

After starting the database with SRVCTL, your conversion process is complete. You can run the following SQL statement to see the status of all the instances in your Oracle RAC database:

SQL> SELECT * FROM v$active_instances;
15.2.3.2 Single-Instance Database on a Cluster Running from an Oracle RAC-Disabled Home

You can create a single-instance database on a cluster running from an Oracle home with the Oracle RAC option disabled. To create an Oracle home on a cluster with Oracle RAC disabled, you can select local and non-cluster on the Node Selection Page of Oracle Universal Installer when installing the Oracle Database software. You can also performed a one-node cluster (with Oracle RAC) installation, but later disable the Oracle RAC option.

Perform the following procedures to convert this type of single-instance database to an Oracle RAC or Oracle RAC One Node database:

  1. Use DBCA to create a preconfigured image of your single-instance database as described in a previous section. To perform the conversion manually, shut down the single-instance database.

  2. Change the directory to the lib subdirectory in the rdbms directory under the Oracle home.

  3. Relink the oracle binary by running the following commands:

    make -f ins_rdbms.mk rac_on
    make -f ins_rdbms.mk ioracle 
  4. Add nodes to your cluster. Ensure that all nodes can access the shared storage used by Oracle Clusterware and Oracle RAC.

15.3 Postconversion Steps

After completing the conversion, follow the recommendations for configuring Oracle RAC environments.

  • Follow the recommendations for using load balancing and transparent application failover as described in a previous chapter.

  • Use locally managed tablespaces instead of dictionary managed tablespaces to reduce contention and manage sequences in Oracle RAC as described in Oracle Database Administrator’s Guide

  • Follow the guidelines for using automatic segment space management as described in Oracle Database Administrator’s Guide

The buffer cache and shared pool capacity requirements in Oracle RAC are slightly greater than the requirements for single-instance Oracle databases. Therefore, you should increase the size of the buffer cache by about 10%, and the size of the shared pool by about 15%.