B Using Scripts or Response Files to Create Oracle RAC Databases

This appendix describes the steps for noninteractive installations during which you can create Oracle Real Application Clusters (Oracle RAC) databases using scripts.

Note:

The scripts generated by Database Configuration Assistant (DBCA) are for reference only. Oracle strongly recommends that you use DBCA to create a database.

See Also:

Oracle Universal Installer NextGen Installation Guide for detailed information about generating scripts

This appendix contains the following topics:

B.1 Using DBCA to Generate Installation Scripts for Oracle RAC

To generate scripts to create an Oracle RAC database, create a database using the generated scripts, and prepare the database for use, complete the following steps:

  1. Start DBCA and select your preferred options to build the Oracle RAC database.

    On the Creation Options page of your DBCA session, deselect Create Database and select Generate Database Creation Scripts before you click Finish. You can accept the default destination directory for the scripts, or browse for a different location. In either case, you should note the path name for use in the next step.

    See Also:

    Chapter 3, "Creating Oracle RAC or Oracle RAC One Node Databases with DBCA" for additional information about running a DBCA session
  2. Go to the directory where DBCA created the scripts, and review the SQL scripts to ensure that they contain the statements to build a database with the characteristics you require. If they do not, then Oracle recommends that you rerun DBCA to create scripts with the desired configuration rather than editing the scripts yourself.

  3. On each cluster node you identified during your DBCA session, run the script sid.sh, where sid is the SID prefix that you entered on the DBCA Database Name page.

  4. Set the initialization parameter, cluster_database, to the value TRUE in your SPFILE by running an ALTER SYSTEM statement in SQL*Plus, or by uncommenting the parameter in the PFILE for each instance.

  5. Configure Oracle Net Services to support your new database and instances as described in Chapter 7, "Understanding the Oracle RAC Installed Configuration".

  6. Set the REMOTE_LISTENER parameter to the SCAN (using the Easy Connect Naming syntax scanname:scanport) in your SPFILE by entering an ALTER SYSTEM statement in SQL*Plus, or by uncommenting the parameter in the PFILE for each instance.

  7. Run the Server Control Utility (SRVCTL) to configure and start database and instance applications as described in Oracle Real Application Clusters Administration and Deployment Guide.

    See Also:

    The Oracle Universal Installer NextGen Installation Guide for additional information about creating and using scripts to install Oracle software with Oracle Universal Installer (OUI)

B.2 About DBCA Noninteractive (Silent) Configuration for Oracle RAC

You can perform a noninteractive, or silent configuration of Oracle RAC using DBCA. To perform a silent configuration, you must have completed an Oracle Grid Infrastructure (Oracle Clusterware and Oracle ASM) installation, run the root.sh script from the Oracle Database home, and defined the Oracle home directory environment variable.

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 provides 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 installation interview, which means that it takes longer to create your database.

B.3 DBCA Commands for Noninteractive (Silent) Configuration for Oracle RAC

You can use the following command syntax to create an Oracle RAC database using the general purpose template, placing the data files in an existing Oracle ASM disk group. Nodes node1 and node2 are the cluster nodes on which Oracle RAC database instances are created. The disk group name is +ASMgrp1, and password is a placeholder for a password. The passwords can be all the same password or different passwords each time:

# su oracle -c "$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName
General_Purpose.dbc -gdbName $DBNAME -sid $ORACLE_SID -sysPassword password
-systemPassword password -sysmanPassword password -dbsnmpPassword password
-emConfiguration LOCAL -storageType ASM -diskGroupName ASMgrp1
-datafileJarLocation $ORACLE_HOME/assistants/dbca/templates -nodeinfo
node1,node2 -characterset WE8ISO8859P1 -obfuscatedPasswords false -sampleSchema
false -asmSysPassword password"

See Also:

Oracle Database Administrator's Guide for a complete description of the dbca commands and options

B.4 How Response Files Work

When you start Oracle Universal Installer (OUI), you can use a response file to automate the installation and configuration of Oracle software, either fully or partially. OUI uses the values contained in the response file to provide answers to some or all installation prompts.

Typically, the installer runs in interactive mode, which means that it prompts you to provide information in graphical user interface (GUI) screens. When you use response files to provide this information, you run the installer from a command prompt using either of the following modes:

  • Silent mode

    If you include responses for all of the prompts in the response file and specify the -silent option when starting the installer, then it runs in silent mode. During a silent mode installation, the installer does not display any screens. Instead, it displays progress information in the terminal that you used to start it.

  • Response file mode

    If you include responses for some or all of the prompts in the response file and omit the -silent option, then the installer runs in response file mode. During a response file mode installation, the installer displays all the screens, screens for which you specify information in the response file, and also screens for which you did not specify the required information in the response file.

You define the settings for a silent or response file installation by entering values for the variables listed in the response file. For example, to specify the Oracle home name, supply the appropriate value for the ORACLE_HOME environment variable:

ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

Another way of specifying the response file variable settings is to pass them as command-line arguments when you run the installer. For example:

-silent directory_path

In this command, directory_path is the path of the database directory on the DVD or the path of the directory on the hard drive.

See Also:

Oracle Universal Installer NextGen Installation Guide for more information about response files

B.4.1 Reasons for Using Silent Mode or Response File Mode

The following table provides use cases for running the installer in silent mode or response file mode.

Mode Uses
Silent Use silent mode for the following installations:
  • Complete an unattended installation, which you schedule using operating system utilities such as at.

  • Complete several similar installations on multiple systems without user interaction.

  • Install the software on a system that does not have X Window System software installed on it.

The installer displays progress information on the terminal that you used to start it, but it does not display any of the installer screens.

Response file Use response file mode to complete similar Oracle software installations on more than one system, providing default answers to some, but not all of the installer prompts.

If you do not specify information required for a particular installer screen in the response file, then the installer displays that screen. It suppresses screens for which you have provided all of the required information.


B.4.2 Creating a Database Using Oracle ASM for Database Files

Before you create a database that uses Oracle Automatic Storage Management (Oracle ASM), you must run the root.sh script. For this reason, you cannot create a database using Oracle ASM as the storage option for database files during a silent mode installation. Instead, you can complete a software-only installation using silent-mode, and then run the Oracle Net Configuration Assistant and DBCA in silent mode after you have completed the software-only installation and you have run the root.sh script.

Note:

This limitation applies only to databases that use Oracle Automatic Storage Management as the storage option for database files. You can create a database that uses the file system option during a silent-mode installation.

B.4.3 General Procedure for Using Response Files

Use the following general steps to install and configure Oracle products using the installer in silent or response file mode:

Note:

You must complete all required preinstallation tasks on a system before running the installer in silent or response file mode.
  1. Create the oraInst.loc file if it is not present on the server.

  2. Prepare a response file.

  3. Run the installer in silent or response file mode.

  4. If you completed a software-only installation, then run Net Configuration Assistant and DBCA in silent or response file mode.

These steps are described in the following sections.

B.5 Preparing Response Files

This section describes the following methods to prepare response files for use during silent mode or response file mode installations:

B.5.1 Editing a Response File Template

For Oracle Database, these files are located in the database/response directory on the installation media or in the Oracle_home/inventory/response directory after the software has been installed.

Note:

If you copied the software to a hard disk, then the response files are located in the directory /response.

Table B-1 lists the response files provided with this software:

Table B-1 Response Files for Oracle Database

Response File Description

db_install.rsp

Silent installation of Oracle Real Application Clusters

dbca.rsp

Silent creation and configuration of Oracle Database using DBCA

netca.rsp

Silent configuration of Oracle Net using NETCA


Caution:

When you modify a response file template and save a file for use, the response file may contain plain text passwords. Ownership of the response file should be given to the Oracle software installation owner only, and permissions on the response file should be changed to 600. Oracle strongly recommends that database administrators or other administrators delete or secure response files when they are not in use.

To copy and modify a response file:

  1. Copy the response file from the response file directory to a directory on your system:

    $ cp /directory_path/response/response_file.rsp local_directory
    

    In this example, directory_path is the path to the database directory on the installation media. If you have copied the software to a hard drive, then you can edit the file in the response directory if you prefer.

  2. Open the response file in a text editor:

    $ vi /local_dir/response_file.rsp
    

    See Also:

    The Oracle Universal Installer NextGen Installation Guidefor detailed information on creating response files
  3. Follow the instructions in the file to edit it.

    Note:

    The installer or configuration assistant fails if you do not correctly configure the response file.
  4. Secure the response file by changing the permissions on the file to 600:

    $ chmod 600 /local_dir/response_file.rsp
    

    Ensure that only the Oracle software owner user can view or modify response files or consider deleting them after the installation succeeds.

    Note:

    A fully-specified response file for an Oracle Database installation contains the passwords for database administrative accounts and for a user who is a member of the OSDBA group (required for automated backups).

B.5.2 Recording Response Files

You can use OUI in interactive mode to record response files, which you can then edit and use to complete silent mode or response file mode installations. This method is useful for Advanced or software-only installations.

You can save all the installation steps into a response file during installation by clicking Save Response File on the Summary page. You can use the generated response file for a silent installation later.

When you record the response file, you can either complete the installation, or you can exit from the installer on the Summary page, before OUI starts to copy the software to the system.

If you use record mode during a response file mode installation, then the installer records the variable values that were specified in the original source response file into the new response file.

Note:

You cannot save passwords while recording the response file.

To record a response file:

  1. Complete preinstallation tasks as for a standard installation.

    When you run the installer to record a response file, it checks the system to verify that it meets the requirements to install the software. For this reason, Oracle recommends that you complete all of the required preinstallation tasks and record the response file while completing an installation.

  2. Ensure that the Oracle software owner user (typically oracle) has permissions to create or write to the Oracle home path that you will specify when you run the installer.

  3. On each installation screen, specify the required information.

  4. When the installer displays the Summary screen, perform the following steps:

    1. Click Save Response File. In the window, specify a file name and location for the new response file. Click Save to write the responses you entered to the response file.

    2. Click Finish to continue with the installation.

      Click Cancel if you do not want to continue with the installation. The installation stops, but the recorded response file is retained.

  5. If you do not complete the installation, then delete the Oracle home directory that the installer created using the path you specified in the Specify File Locations screen.

  6. Before you use the saved response file on another system, edit the file and make any required changes. Use the instructions in the file as a guide when editing it.

B.6 Running Oracle Universal Installer Using a Response File

Now, you are ready to run OUI at the command line, specifying the response file you created, to perform the installation.

B.6.1 Viewing the Help Information for OUI

For information about all the available options for OUI, run the runInstaller command with the -help option, for example:

$ directory_path/runInstaller -help

The help information appears in your session window after a brief delay.

B.6.2 Running OUI Using a Response File for Input

To run the installer with a response file to install the Oracle Database software, complete the following steps:

  1. Complete the preinstallation tasks as for a typical installation.

  2. Log in as the software installation owner user.

  3. If you are completing a response file mode installation, set the DISPLAY environment variable.

    Note:

    You do not have to set the DISPLAY environment variable if you are completing a silent mode installation.
  4. To start the installer in silent or response file mode, enter a command similar to the following:

    $ /directory_path/runInstaller [-silent] [-noconfig] \
     -responseFile responsefilename
    

    Note:

    Do not specify a relative path for the response file. If you specify a relative path, then the installer fails.

    In this example:

    • directory_path is the path of the database directory on the DVD or the path of the directory on the hard drive.

    • -silent runs the installer in silent mode.

    • -noconfig suppresses running the configuration assistants during installation, and a software-only installation is performed instead.

    • responsefilename is the full path and file name of the installation response file that you configured previously. See "Editing a Response File Template".

    Note:

    For more information about other options for the runInstaller command, enter the following command:
    $ /directory_path/runInstaller -help
    
  5. When the installation completes, log in as the root user and run the root.sh script:

    $ sudo sh
    password:
    # /oracle_home_path/root.sh
    

B.7 Postinstallation Configuration Using Response Files

The following sections explain how to create and run a response file configuration after installing Oracle software. The topics in this section are:

B.7.1 About the Postinstallation Configuration File

When you run a silent or response file installation, you provide information about your servers in a response file that you otherwise provide manually during a graphical user interface installation. However, the response file does not contain passwords for user accounts that configuration assistants require after software installation is complete. The configuration assistants are started with a script called configToolAllCommands. You can run this script in response file mode by using a password response file. The script uses the passwords to run the configuration tools in succession to complete configuration.

If you keep the password file to use for clone installations, then Oracle strongly recommends that you store the password file in a secure location. In addition, if you have to stop an installation to fix an error, then you can run the configuration assistants using configToolAllCommands and a password response file.

The configToolAllCommands password response file has the following syntax options:

  • internal_component_name is the name of the component that the configuration assistant configures

  • variable_name is the name of the configuration file variable

  • value is the desired value to use for configuration.

The command syntax is as follows:

internal_component_name|variable_name=value

For example:

oracle.assistants.asm|S_ASMPASSWORD=myPassWord

Oracle Database configuration assistants require the SYS, SYSTEM, and DBSNMP passwords for use with DBCA. You might need to specify the following additional passwords, depending on your system configuration:

  • If the database is using Oracle ASM for storage, then you must specify a password for the S_ASMSNMPPASSWORD variable. If you are not using Oracle ASM, then leave the value for this password variable blank.

  • If you create a multitenant container database (CDB) with one or more pluggable databases (PDBs), then you must specify a password for the S_PDBADMINPASSWORD variable. If you are not using Oracle ASM, then leave the value for this password variable blank.

Oracle strongly recommends that you maintain security with a password response file:

  • Permissions on the response file should be set to 600.

  • The owner of the response file should be the installation owner user, with the group set to the central inventory (oraInventory) group.

B.7.2 Creating a Password Response File

To create a password response file to use with the configuration assistants, perform the following steps:

  1. Create a response file that has a name of the format filename.properties, for example:

    $ touch pwdrsp.properties
    
  2. Open the file with a text editor, and cut and paste the sample password file contents, as shown in Example B-1, modifying as needed.

  3. Change permissions to secure the password response file. For example:

    $ ls -al pwdrsp.properties
    -rw------- 1 oracle oinstall 0 Apr 30 17:30 pwdrsp.properties
    

Example B-1 Password response file for Oracle Real Application Clusters

This example provides a template for a password response file to use with the database configuration assistants.

oracle.assistants.server|S_SYSPASSWORD=password
oracle.assistants.server|S_SYSTEMPASSWORD=password
oracle.assistants.server|S_SYSMANPASSWORD=password
oracle.assistants.server|S_DBSNMPPASSWORD=password
oracle.assistants.server|S_ASMSNMPPASSWORD=password
oracle.assistants.server|S_PDBADMINPASSWORD=password

B.7.3 Running Postinstallation Configuration Using a Response File

To run configuration assistants with the configToolAllCommands script:

  1. Create a password response file as described in "Creating a Password Response File".

  2. Change directory to $ORACLE_HOME/cfgtoollogs.

  3. Run the configuration script using the following syntax:

    configToolAllCommands RESPONSE_FILE=/path/name.properties
    

    For example:

    $ ./configToolAllCommands RESPONSE_FILE=/home/oracle/pwdrsp.properties
    

B.8 Running Configuration Assistants Using Response Files

You can run configuration assistants in response file or silent mode to configure and start Oracle software after it is installed on the system. To run configuration assistants in response file or silent mode, you must copy and edit a response file template.

Note:

If you copied the software to a hard disk, then the response file template is located in the /response directory.

This section contains the following topics:

B.8.1 Running Database Configuration Assistant in Response File or Silent Mode

You can run Database Configuration Assistant (DBCA) in response file mode, either in silent mode or progress only mode, to configure and start an Oracle database on the system. To run Database Configuration Assistant in response file mode, you must copy and edit a response file template. Oracle provides a response file template named dbca.rsp in the ORACLE_HOME/assistants/dbca directory and also in the /response directory on the DVD. To run DBCA in response file mode, you must use the -responseFile flag in combination with either the -silent or -progressOnly flag. You must also use a graphical display and set the DISPLAY environment variable.

To run Database Configuration Assistant in response file mode:

  1. Copy the dbca.rsp response file template from the response file directory to a directory on your system:

    $ cp /directory_path/response/dbca.rsp local_directory
    

    In this example, directory_path is the path of the database directory on the DVD. If you have copied the software to a hard drive, you can edit the file in the response directory if you prefer.

    Note:

    As an alternative to editing the response file template, you can also create a database by specifying all required information as command line options when you run DBCA. For information about the list of options supported, enter the following command:
    $ $ORACLE_HOME/bin/dbca -help
    
  2. Open the response file in a text editor:

    $ vi /local_dir/dbca.rsp
    
  3. Edit the file, following the instructions in the file.

    Note:

    DBCA fails if you do not correctly configure the response file.
  4. Log in as the Oracle software owner user, and set the ORACLE_HOME environment variable to specify the correct Oracle home directory.

  5. To run DBCA in response file mode, set the DISPLAY environment variable.

  6. Use the following command syntax to run DBCA in silent or response file mode using a response file:

    $ORACLE_HOME/bin/dbca {-progressOnly | -silent} -responseFile \
    /local_dir/dbca.rsp 
    

    In this example:

    • The -silent option indicates that DBCA should run in silent mode.

    • The -progressOnly option indicates that DBCA should run in response file mode.

    • local_dir is the full path of the directory where you copied the dbca.rsp response file template.

B.8.2 Running Net Configuration Assistant Using Response Files

You can run Net Configuration Assistant in silent mode to configure and start an Oracle Net listener on the system, configure naming methods, and configure Oracle Net service names. To run Net Configuration Assistant in silent mode, you must copy and edit a response file template. Oracle provides a response file template named netca.rsp in the response directory in the database/response directory on the DVD.

Note:

If you copied the software to a hard disk, then the response file template is located in the database/response directory.

To run Net Configuration Assistant using a response file:

  1. Copy the netca.rsp response file template from the response file directory to a directory on your system:

    $ cp /directory_path/response/netca.rsp local_directory
    

    In this example, directory_path is the path of the database directory on the DVD. If you have copied the software to a hard drive, you can edit the file in the response directory if you prefer.

  2. Open the response file in a text editor:

    $ vi /local_dir/netca.rsp
    
  3. Follow the instructions in the file to edit it.

    Note:

    Net Configuration Assistant fails if you do not correctly configure the response file.
  4. Log in as the Oracle software owner user, and set the ORACLE_HOME environment variable to specify the correct Oracle home directory.

  5. Enter a command similar to the following to run Net Configuration Assistant in silent mode:

    $ $ORACLE_HOME/bin/netca -silent -responsefile /local_dir/netca.rsp
    

    In this command:

    • The -silent option indicates to run Net Configuration Assistant in silent mode.

    • local_dir is the full path of the directory where you copied the netca.rsp response file template.