3.3. Preparing Oracle Nodes

To prepare the Oracle nodes, follow these steps:

  1. At each node, create the oracle group. For example:

    # groupadd dba -g 501
  2. Make the oracle user's home directory. For example:

    # mkdir -p /home/oracle
  3. At each node, create the oracle user. Make sure that the oracle user primary group is the dba group. For example:

    # useradd -c "Oracle Software Owner" -g dba -u 101 -m -d
     /home/oracle -s /bin/bash oracle

    NoteNote
     

    All text on the preceding lines should appear as one continuous line. It has been broken up because of print limitations.

  4. Change ownership of /home/oracle to oracle.dba. For example:

    # chown oracle.dba /home/oracle
  5. Grant unlimited ulimit to oracle.

  6. Make sure that oracle:dba owns the following mount points and quorum pool devices:

    • /dev/raw/raw1

    • /dev/raw/raw2

    • /mnt/oracle_base

    • /mnt/oraundo

    • /mnt/oraindex

    • /mnt/oradata

  7. Adjust kernel parameters to the values shown in Table 3-1.

    NoteNote
     

    The kernel parameter values are for the example cluster in this manual and may be different for your environment.

    Kernel ParameterSetting
    fs.aio-max-size1048576
    fs.aio-max-nr1048576
    net.ipv4.ip_local_port_range1024 65000
    net.ipv4.ip_forward0
    shmmax2147483648
    shmmni4096
    semmsl250
    semmns32000
    semopm100
    semmni128

    Table 3-1. Kernel Parameter Values

    1. Specify the kernel parameters by modifying the /etc/sysctl.conf file according to Example 3-1. Specifying the parameters in the sysctl.conf file causes the parameters to be set upon reboot.

      # Kernel sysctl configuration file for Red Hat Linux
      #
      # For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
      # sysctl.conf(5) for more details.
      fs.aio-max-size = 1048576
      fs.file-max = 327680
      fs.aio-max-nr = 1048576
      net.ipv4.ip_local_port_range = 1024 65000
      net.ipv4.ip_forward = 0
      kernel.shmmax = 2147483648
      kernel.shmmni = 4096
      kernel.sem = 250 32000 100 128

      Example 3-1. Kernel Parameters

    2. After modifying the sysctl.conf file, set the parameters with the sysctl -p command as follows:

      # sysctl -p
      fs.aio-max-size = 1048576
      fs.file-max = 327680
      fs.aio-max-nr = 1048576
      net.ipv4.ip_local_port_range = 1024 65000
      net.ipv4.ip_forward = 0
      kernel.shmmax = 2147483648
      kernel.shmmni = 4096
      kernel.sem = 250 32000 100 128
  8. Create libcwait.c.

    1. As user oracle, in the oracle user's home directory, create a file named libcwait.c with the following contents:

      #include <errno.h>
      #include <sys/syscall.h>
      #include <sys/types.h>
      #include <sys/wait.h>
      pid_t
      __libc_wait (int *status)
      {
        int res;
        asm volatile ("pushl %%ebx\n\t"
                      "movl %2, %%ebx\n\t"
                      "movl %1, %%eax\n\t"
                      "int $0x80\n\t"
                      "popl %%ebx"
                      : "=a" (res)
                      : "i" (__NR_wait4), "0" (WAIT_ANY), "c" (status), "d" (0),
                        "S" (0));
        return res;
      }
    2. Compile the file in the oracle user's home directory:

      # gcc -O2 -shared -o $HOME/libcwait.so -fpic $HOME/libcwait.c
  9. Establish environment variables for the oracle user.

    1. Set the following Oracle environment variables (Table 3-2):

      Environment VariableSuggested Value
      ORACLE_BASEFor example: /mnt/oracle_base
      ORACLE_HOMEFor example: $ORACLE_BASE/product/920
      ORACLE_TERMXterm
      ORA_NLS33$ORACLE_HOME/ocommon/nls/admin/data
      PATH$ORACLE_HOME/bin:/usr/bin/X11/:/usr/local/bin and any other items you require in your PATH
      DISPLAYip-address:0.0 (Note: Comment out if installing remotely. Remember to use the ssh -X user@hostname command. For example, use ssh -X oracle@rac1 for the rac1 node.)
      TMPDIRSet a temporary directory path for TMPDIR with at least 100 MB of free space to which the OUI has write permission.
      ORACLE_SIDSet this to what you will call your database instance. This should be a unique value on each node.
      umask022
      LD_ASSUME_KERNEL2.4.19
      LD_LIBRARY_path$ORACLE_HOME/lib:/usr/lib
      LD_PRELOAD$HOME/libcwait.so
      LD_LIBRARY_path$ORACLE_HOME/lib:/usr/lib

      Table 3-2. Environment Variables for the oracle User

    2. Save the environment values listed in Table 3-2 to .bashrc, .login, or .profile for user oracle and user root. By saving the environment values to one of those files, you do not have to set the environment values each time you log in.

    3. Create the directory /var/opt/oracle and set ownership to the user oracle if it does not exist. For example:

      $ mkdir /var/opt/oracle
      $ chown oracle.dba /var/opt/oracle
  10. Proceed to Section 3.4 Installing and Configuring Oracle Components.