4 Installing the Oracle Database Software and Creating a Database

After Oracle Grid Infrastructure for a cluster is functional, you can install the Oracle Database software on the nodes of your cluster.

Oracle Universal Installer (OUI) installs the software on the local node and then copies the binary files from the local node to all the other nodes in the cluster.

4.1 Using Rapid Home Provisioning to Install Oracle Database Software

Rapid Home Provisioning is a method of deploying software homes to any number of nodes in a data center from a single cluster, and also facilitates patching and upgrading software.

With Rapid Home Provisioning, you create, store, and manage templates of Oracle homes as images (called gold images) of Oracle software, such as databases, middleware, and applications. You can make a working copy of any gold image, and then you can provision that working copy to any node in the data center.

You store the gold images in a repository located on a Rapid Home Provisioning Server, which runs on one server in the Rapid Home Provisioning Server cluster that is a highly available provisioning system. With a single command, Rapid Home Provisioning can provision new Oracle Database homes for the various releases of Oracle Database, such as 11.2.0.x (Oracle Database 11g), 12.1.0.2 and 12.2.0.1 (Oracle Database 12c). There are no prerequisites for the target servers. You do not need to install any client or agent software on the servers before the provisioning the Oracle Grid Infrastructure software.

When you provision such software, Rapid Home Provisioning offers additional features for creating various types of databases (such as Oracle Real Application Clusters (Oracle RAC), single instance, and Oracle Real Application Clusters One Node (Oracle RAC One Node) databases) on different types of storage, and other options, such as using templates and creating container databases (CDBs).

See Also:

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

4.2 Using Oracle Enterprise Manager Cloud Control for Provisioning Operations

As part of the database provisioning solution, Oracle Enterprise Manager Cloud Control enables you to provision Oracle Databases (also known as single-instance databases) and Oracle Real Application Clusters (Oracle RAC) databases.

Using Oracle Enterprise Manager Cloud Control, you can extend or delete Oracle RAC nodes, and provision Oracle RAC One node databases. Oracle Enterprise Manager Cloud Control also helps in setting up the environment for provisioning and does various pre-checks on the host to verify provisioning is successful. Before you can use Oracle Enterprise Manager Cloud Control to provision your Oracle software, you must perform the following system configuration tasks:

  • Discover all host by installing the Enterprise Manager Agent on all nodes.

  • Configure named and preferred credentials in Enterprise Manager.

  • Configure a software library and setup roles.

  • Download software from Oracle Technology Network to create installation media components in Enterprise Manager. Optionally, you can create a Provisioning Profile (similar to a gold image) from an existing system.

Details on how to perform these tasks, and how to provision your Oracle Grid Infrastructure and Oracle RAC software using Oracle Enterprise Manager Cloud Control are available in Oracle Enterprise Manager Lifecycle Management Administrator's Guide.

4.3 Verifying My Oracle Support Credentials

When you first start OUI, you are prompted to enter your e-mail address and My Oracle Support password.

By entering this information, you enable the following features:

  • Oracle Configuration Manager is installed and configured. This option enables you to associate information about your Oracle RAC configuration with your My Oracle Support account. In the event that you must place a service request with Oracle Support, that configuration information can help provide a more rapid resolution to the service issue.

  • You can receive e-mail notification of security alerts from My Oracle Support.

  • Automatic download and application of the most recent patches to the newly installed Oracle software (with Oracle Grid Infrastructure for a cluster or Oracle Database). The software updates that can be downloaded include patches, critical patch updates, installer updates, and patch sets.

If you choose to enable these features, then you must supply your My Oracle Support account name (your e-mail address) and your password. You may have to configure the proxy settings before your computer can connect to My Oracle Support.

If you have downloaded the software updates, then during installation you can enter the directory location where the files are stored on the local server instead of downloading them from My Oracle Support. The software updates are applied to the installed software during the installation process.

4.4 Configuring the Operating System Environment

You run Oracle Universal Installer (OUI) from the oracle user account. You don’t have to configure the environment of the oracle user before you start OUI.

You can set the ORACLE_BASE environment variable to the directory in which you want the Oracle Inventory files for the Oracle Database software located. For example, if you plan to make the Oracle Database home directory /u01/app/oracle/product/12.2.0/dbhome_1, then you would set ORACLE_BASE to the directory /u01/app/oracle/. If you set the ORACLE_BASE environment variable before installation, then the path specified becomes the default location for the central inventory displayed by OUI.

You can also set the ORACLE_HOME environment variable to the location chosen for the Oracle Database home. If you set the ORACLE_HOME environment variable before installation, then the path specified becomes the default location for the Oracle home displayed by OUI.

(Optional) To modify the user environment before installing Oracle Database software on Oracle Linux:

  1. As the oracle user, execute the following commands:
    [oracle]$ unset ORACLE_SID
    [oracle]$ export ORACLE_BASE=/u01/app/oracle/
    [oracle]$ export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
  2. Verify the changes have been made by executing the following commands:
    [oracle]$ echo $ORACLE_SID
    
    [oracle]$ echo $ORACLE_HOME
    /u01/app/oracle/product/12.2.0/dbhome_1
    [oracle]$ echo $ORACLE_BASE
    /u01/app/oracle/
    

4.5 Creating Additional Oracle ASM Disk Groups

If you want to use a separate disk group for your Oracle database files or for the fast recovery area, then you must create the additional Oracle ASM disk groups before installing Oracle Database software.

If you chose to store the Oracle Clusterware files on Oracle ASM during the Oracle Grid Infrastructure for a cluster installation, then a single disk group was created in Oracle ASM. You can use this same disk group to store the data files for your Oracle database, or you can create a separate disk group for the Oracle Database files.

To create an additional disk group using ASMCA:

  1. Prepare the disks or devices for use with Oracle ASM, as described in "Configuring Installation Directories and Shared Storage".
  2. Start the Oracle Automatic Storage Configuration Assistant (ASMCA) from the Grid home:
    /u01/app/12.2.0/grid/bin/asmca
    

    ASMCA starts, and displays the Disk Groups window.

  3. Click the Create button to create a disk group.

    The Create Disk Group window appears.

  4. Provide the following information:
    • In the Disk Group Name field, enter a name for the new disk group, for example, FRA, for a disk group that stores the fast recovery files.

    • Choose a Redundancy level, for example, Normal.

    • Select the disks to include in the new disk group.

    After you have provided all the information, click OK. A progress window titled DiskGroup: Creation appears. After a few minutes, a message appears indicating the disk group was created successfully. Click OK to continue.

  5. Repeat Step 3 and 4 to create additional disk groups, or click Exit, then select Yes to exit the utility.

4.6 Deciding Between Multitenant Container Databases and Non-CDBs in Oracle RAC

Review the information to decide how to deploy your Oracle Database using the CDB or Non-CDB options.

Starting in Oracle Database 12c Release 1 (12.1), you must create a database as either a multitenant container database (CDB) or as an Oracle database that is non-CDB. This also applies to Oracle RAC databases. The only difference to the installation process is to choose whether to create the Oracle RAC database as a CDB or non-CDB.

A pluggable database (PDB) is a portable collection of schemas, schema objects, and nonschema objects that appears to an Oracle Net client as a non-CDB. PDBs can be plugged into CDBs. A CDB can contain multiple PDBs. Each PDB appears on the network as a separate database.

If you create an Oracle RAC database as a CDB and plug one or more PDBs into the CDB, then, by default, a PDB is not started automatically on any instance of the Oracle RAC CDB. With the first dynamic database service assigned to the PDB (other than the default database service which has the same name as the database name), the PDB is made available on those instances on which the service runs.

Whether or not a PDB is available on more than one instance of an Oracle RAC, CDB is typically managed by the services running on the PDB. You can manually enable PDB access on each instance of an Oracle RAC CDB by starting the PDB manually on that instance.

See Also:

4.7 Using Oracle Universal Installer to Install Oracle RAC Software

After you have configured the operating system environment, you can use Oracle Universal Installer to install the Oracle RAC software and create an Oracle RAC database.

To install Oracle Database software on your cluster and to create a database:

  1. As the oracle user, use the following commands to start OUI, where staging_area is the location of the staging area on disk, or the location of the mounted installation disk:
    cd /staging_area
    ./runInstaller
    
    The Configure Security Updates window appears.
  2. Optional: Enter your email address and My Oracle Support password, then click Next to continue.

    If you want to receive notification by email of any newly discovered security issues related to the software you are installing, then enter an email address in the Email field. If you also want to receive the security updates through My Oracle Support, then use the same email address that is registered with My Oracle Support, select the I wish to receive security updates via My Oracle Support option, and enter your My Oracle Support login password in the My Oracle Support Password field.

    If you provide an email address, then the Oracle Configuration Manager (OCM) tool will also be installed. This utility provides Oracle Support Services with configuration information about your system when creating service requests. You can disable the OCM tool after installation, but Oracle strongly discourages this. OCM does not access, collect, or store any personal information (except for technical support contact information), or any business data files residing in your software environment. For more information about OCM, see http://www.oracle.com/technetwork/documentation/ocm-092152.html.

    After you click Next, the Select Installation Option window appears.
  3. Select Create and configure a database, then click Next to continue:
    The System Class window appears.
  4. Choose Server Class, then click Next.
    If you choose the Desktop Class option, then OUI installs a single-instance database, not a clustered database.
    The Grid Installation Options window appears.
  5. Choose either the Oracle Real Application Clusters database installation option or the Oracle RAC One Node database installation option.
    The Select Install Type window appears.
  6. Choose Admin-managed or Policy-Managed for your database, then click Next to continue.
    If you chose Admin-Managed, then the Select List of Nodes window appears. If you selected Policy-Managed, then the Select Install Type window appears.
  7. For an administrator-managed database, you must select the nodes in the cluster where you want to run Oracle RAC or Oracle RAC One Node.
    1. Select the nodes on which you want to install Oracle Database software and create an Oracle RAC instance. All the available nodes in the cluster are selected by default.

      Note:

      Select both nodes during installation, even if you are creating an Oracle RAC One Node database.

    2. Click the SSH Connectivity button at the bottom of the window.
      The bottom panel of the window displays the SSH Connectivity information.
  8. Because you configured SSH connectivity between the nodes for the Oracle Grid Infrastructure for a cluster installation, select the Reuse private and public keys existing in user home option. Click Test.
    If you are using a network user that has a home directory on shared storage, then also select the User home if shared by the selected nodes option.
    A message window appears, indicating that passwordless SSH connectivity has been established between the cluster nodes. Click OK to continue.
  9. When returned to the Node Selection window, click Next to continue.
    The Select Install Type window appears.
  10. Choose the Typical install option, and click Next.
    A typical installation requires minimal input. It installs the software and optionally creates a general-purpose database. If you choose the Advanced installation type (not documented in this guide), then you are prompted to provide more information about how the database should be configured. For example, you could set passwords for each user account individually, choose a different template for the starter database, choose a nondefault language for the database, and so on.
    The Typical Install Configuration window appears.
  11. In this window, you must provide the following information:
    • Oracle base location: The default value is /u01/app/oracle/. If you did not set the ORACLE_BASE environment variable and the default location is different from the directory location you have chosen, then enter the directory for your Oracle base or click the Browse button to change the directory path.

    • Software location: If you did not set the ORACLE_HOME environment variable before starting the installation, then enter the directory for your Oracle home or click the Browse button to change the directory path.

    • Storage Type: In this drop-down list, choose Automatic Storage Management (ASM). If you do not want to use Oracle ASM, then choose File System. Because Oracle ASM was installed with the Oracle Grid Infrastructure for a cluster, Oracle Automatic Storage Management is the default value.

    • Database file location: Choose the disk group to use for storing the database files. You can use the same disk group that Oracle Clusterware uses. If you do not want to use the same disk group that is currently being used to store the Oracle Clusterware files, then you must exit the installation and create a new disk group using Oracle ASM utilities. Refer to "Creating Additional Oracle ASM Disk Groups" for more information on creating a disk group.

      If you chose the File System storage type, then enter the directory location of the shared storage where the database files will be created.

    • ASMSNMP Password: Enter the password for the ASMSNMP user. The ASMSNMP user is used primarily by Oracle Enterprise Manager to monitor Oracle ASM instances. See Oracle Automatic Storage Management Administrator's Guide for more information about the ASMSNMP user.

      If you chose File System for the Storage Type, then this field is disabled.

    • Database edition: From this drop-down list choose either Enterprise Edition or Standard Edition. The number in parentheses next to your choice indicates the amount of disk space required.

    • OSDBA Group: From this drop-down list select the operating system group used for database administration, for example, dba.

    • Global database name: Enter the fully qualified global name for your database. The global database name is in the form DB_UNIQUE_NAME.DB_DOMAIN, for example, orcl.example.com.

      Note:

      The first eight characters of the ORACLE_SID must be a unique identifier for each database. The SID prefix cannot contain underscore (_), dollar ($), or pound (#) characters. The total length of the ORACLE_SID cannot exceed 15 characters for Oracle RAC databases.

    • Administrative password: Enter the password to be used for the administrative account, such as SYS, SYSTEM, and DBSNMP.

    • Confirm Password: Enter the same password in this field.

  12. After you have provided all the necessary information, click Next.
    The Perform Prerequisite Checks window appears.
  13. After a short period of time, the Summary window appears. Review the information on this window, then click Finish to continue.

    If any of the information in the Summary window is incorrect, then use the Back button to return to a previous window and correct it.

    After you click Finish, OUI displays a progress indicator to show that the installation has begun. This step takes several minutes to complete.
  14. After the software is installed on each node, if you select the option to create a database, then OUI starts the Database Configuration Assistant (DBCA).

    This utility creates the database using the global database name specified in Step 9. At the end of the database creation, you see the DBCA window with the database configuration information displayed.

    There is also a Password Management button that you can click to unlock the database user accounts, or change their default passwords.

    After making note of the information in the Summary window, click OK.

    OUI configures Oracle Configuration Management, if you provided the information in Step 2.

    If you chose to perform a software-only installation, then the database configuration assistants are not started. You must run DBCA separately to create the Oracle RAC One Node database.

    See Also:

    Oracle Real Application Clusters Installation Guide for your platform for information about creating an Oracle RAC One Node database using DBCA

  15. Perform the following steps to run the root.sh script (note that for clarity, the examples show the current user, node and directory in the prompt):
    In the last step of the installation process, you are prompted to perform the task of running the root.sh script on both nodes, as specified in the Execute Configuration Scripts window. Do not click OK until you have run the scripts on all nodes.
    1. Open a terminal window as the oracle user on the first node. Change directories to your Oracle home directory, and then switch to the root user by entering the following commands:
      [oracle@racnode1 oracle]$ cd /u01/app/oracle/product/12.2.0/dbhome_1
      [oracle@racnode1 dbhome_1]$ su
      
    2. Enter the password for the root user, and then run the script specified in the Execute Configuration scripts window:
      [root@racnode1 dbhome_1]# ./root.sh

      Note:

      You can run the root.sh script simultaneously on all nodes in the cluster for Oracle RAC installations or upgrades.

    3. After responding to prompt, press the Enter key. To accept the default choice, press the Enter key without entering any text.
      As the root.sh script runs, it prompts you for the path to the local bin directory. The information displayed in the brackets is the information it has obtained from your system configuration. It also writes the dbhome, oraenv, and coraenv files in the /usr/local/bin directory. If these files exist, then you are asked to overwrite them.
    4. Enter commands similar to the following to run the script on the other nodes:
      [root@racnode1 dhome_1]# exit
      [oracle@racnode1 dhome_1]$ ssh racnode2
      [oracle@racnode2 ~]$ cd /u01/app/oracle/product/12.2.0/dbhome_1
      [oracle@racnode2 dbhome_1]$ su
      
    5. Enter the password for the root user, and then run the script specified in the Execute Configuration scripts window:
      [root@racnode2 dbhome_1]# ./root.sh
      
    6. After responding to each prompt, press the Enter key.
    7. When the root.sh script completes, the following messages are displayed:
  16. After you finish executing the script on all nodes, return to the Execute Configuration scripts window and click OK.
    The Install Product window displays.
  17. Click Next to complete the installation.
    The Finish window is displayed.
  18. Click Close to exit the installer.

4.8 Verifying Your Oracle RAC Database Installation

If you chose to create an Oracle RAC database during installation, then verify that all the database services are up and running.

To verify the Oracle RAC database services are started:

  1. Log in as the oracle user and go to the Grid_home/bin directory:
    [oracle] $ cd /u01/app/12.2.0/grid/bin
    
  2. Run the following command to view the status of the resources managed by Oracle Clusterware that contain the string 'ora':
    [oracle] $ ./crsctl status resource -w "TYPE co 'ora'" -t
    

    The output of the command should show that the Oracle Clusterware, Oracle ASM, and Oracle Database resources are available (online) for each host. An example of the output is:

    ---------------------------------------------------------------------------
    NAME              TARGET STATE    SERVER            STATE_DETAILS
    ---------------------------------------------------------------------------
    Local Resources
    ---------------------------------------------------------------------------
    ora.DATA.dg
                      ONLINE  ONLINE   racnode1
                      ONLINE  ONLINE   racnode2
    
    ora.LISTENER.lsnr
                      ONLINE  ONLINE   racnode1
                      ONLINE  ONLINE   racnode2
    
    ora.asm
    
                      ONLINE  ONLINE   racnode1          Started
                      ONLINE  ONLINE   racnode2          Started
    
    ora.eons
                      ONLINE  ONLINE   racnode1
                      ONLINE  ONLINE   racnode2
    
    ora.gsd
                      OFFLINE OFFLINE   racnode1
                      OFFLINE OFFLINE   racnode2
    
    ora.net1.network
                      ONLINE  ONLINE   racnode1
                      ONLINE  ONLINE   racnode2
    
    ora.ons
                      ONLINE  ONLINE   racnode1
                      ONLINE  ONLINE   racnode2
    ora.registry.acfs
                      ONLINE  ONLINE   racnode1
                      ONLINE  ONLINE   racnode2
    ---------------------------------------------------------------------------
    Cluster Resources
    ---------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
          1           ONLINE  ONLINE   racnode1
    ora.oc4j
          1           OFFLINE OFFLINE
    ora.orcl.db
          1           ONLINE  ONLINE   racnode1            Open
          2           ONLINE  ONLINE   racnode2            Open
    ora.racnode1.vip
          1           ONLINE  ONLINE   racnode1
    ora.racnode2.vip
          1           ONLINE  ONLINE   racnode2
    ora.scan1.vip
          1           ONLINE  ONLINE   racnode1
    

Caution:

After installation is complete, do not remove manually or run cron jobs that remove /tmp/.oracle or /var/tmp/.oracle directories or their files while Oracle software is running on the server. If you remove these files, then the Oracle software can encounter intermittent hangs. Oracle Clusterware installations will fail with the error:

 CRS-0184: Cannot communicate with the CRS daemon. 

4.9 Performing Postinstallation Tasks

After you have installed the Oracle Real Application Clusters (Oracle RAC) software and created an Oracle RAC database there are additional tasks to perform before your cluster database is ready for use. These steps are recommended, but are not required.

4.9.1 About Downloading and Installing Oracle Database Patches

Ensure that you run the latest patch set of the installed software.

Periodically, Oracle issues bug fixes for its software called patches. Patch sets are a collection of bug fixes that were produced up to the time of the patch set release. Patch sets are fully tested product fixes. Application of a patch set affects the software residing in your Oracle home.

If you configured access to My Oracle Support during installation, then the latest patches should have been downloaded and applied during installation.

If you did not configure access to My Oracle Support within OUI, then you should apply the latest patch set for your release and any necessary patches that are not included in a patch set. Information about downloading and installing patches and patch sets is covered in Managing Oracle Software and Applying Patches.

See Also:

Oracle Grid Infrastructure Installation Guide for Linux for detailed instructions on how to locate and download patches and patch sets

4.9.2 Recompiling All Invalid Objects

Oracle recommends you run the utlrp.sql script after you install, patch, or upgrade a database, to identify and recompile invalid objects.

The utlrp.sql script recompiles all invalid objects. Run the script immediately after installation, to ensure that users do not encounter invalid objects.
  1. Start SQL*Plus:
    sqlplus "/ AS SYSDBA"
    
  2. Run the utlrp.sql script, where Oracle_home is the Oracle home path:
    SQL> @Oracle_home/rdbms/admin/utlrp.sql
    

The utlrp.sql script automatically recompiles invalid objects in either serial or parallel recompilation, based on both the number invalid objects, and on the number of CPUs available. CPUs are calculated using the number of CPUs (cpu_count) multiplied by the number of threads for each CPU (parallel_threads_per_cpu). On Oracle Real Application Clusters (Oracle RAC), this number is added across all Oracle RAC nodes.

4.9.3 About Configuring User Accounts

You can use different operating system accounts for accessing and managing your Oracle RAC database.

The oracle user operating system account is the account that you used to install the Oracle Database software. You can modify the shell configuration file to set environment variables such as ORACLE_HOME whenever you log in as that operating system user.

4.9.4 Configuring Services on Oracle RAC and Oracle RAC One Node CDBs

During installation, if you select a multitenant container database (CDB), and configure pluggable databases (PDBs), then you must 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 the CDB that do not have registered services are restarted in MOUNTED state.

PDBs are opened in Read-Write mode after failover, in case of Oracle RAC One Node database, or relocation in case of any Oracle RAC database, 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 for Oracle RAC One Node databases, then the PDBs associated with that CDB automatically open in Read-Write state.

See Also:

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

4.9.5 Downloading and Installing the ORAchk Health Check Tool

Download and install the ORAchk utility to perform proactive heath checks for the Oracle software stack.

ORAchk replaces the RACCheck utility. ORAchk extends health check coverage to the entire Oracle software stack, and identifies and addresses top issues reported by Oracle users. ORAchk proactively scans for known problems with Oracle products and deployments, including the following:

  • Standalone Oracle Database

  • Oracle Grid Infrastructure

  • Oracle Real Application Clusters

  • Maximum Availability Architecture (MAA) Validation

  • Upgrade Readiness Validations

  • Oracle Golden Gate

Oracle is continuing to expand checks, based on customer requests.

ORAchk is supported on Windows Server 2012 and Windows Server 2016 on a Cygwin environment only.

Oracle recommends that you download and run the latest version of ORAchk from My Oracle Support. For information about downloading, configuring and running ORAchk utility, refer to My Oracle Support note 1268927.2:

https://support.oracle.com/epmos/faces/DocContentDisplay?id=1268927.2&parent=DOCUMENTATION&sourceId=USERGUIDE

4.10 Creating an Oracle RAC Database Using DBCA

The Database Configuration Assistant (DBCA) utility is used to create Oracle Databases.

If you did not select the option to create an Oracle Real Application Clusters (Oracle RAC) database during installation, then you will need to create one using DBCA after you have verified that the installation of the Oracle RAC software was successful. The steps for creating an Oracle RAC database are documented in Oracle Real Application Clusters Installation Guide for Linux and UNIX.