Sunday, 2 January 2011

Oracle 11Gr2 Installation Pre-Task

2.1 Creating Groups and User for Oracle

Open a terminal window and login as the root user.
[root@~]# groupadd -g 1000 oinstall
[root@~]# groupadd -g 1200 asmadmin
[root@~]# groupadd -g 1300 dba
[root@~]# groupadd -g 1301 oper
[root@~]# groupadd -g 1201 asmdba
[root@~]# useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
[root@~]# Id oracle
[root@~]# Passwd oracle

(Not Needed in 11GR2 DATABASE Installation)
[root@~]# groupadd -g 1202 asmoper
[root@racnode1 ~]# useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid 
2.2 Configure Oracle Installation Owner Shell Limits
For information, review "Configuring the oracle User's Environment"

To improve the performance of the software, you must increase the following shell limits for the oracle and grid user:
Shell Limit Item in limits.conf Hard Limit
Maximum number of open file descriptors nofile
Maximum number of processes available to a single user nproc
Maximum size of the stack segment of the process stack10240

To increase the shell limits:
Depending on your environment, make the following changes for all Oracle installation owners. The steps below only show the user oracle.
  1. Add the following lines to the /etc/security/limits.conf file: (the following example shows only the software account owner oracle):
  2. oracle soft nproc 2047
  3. oracle hard nproc 16384
  4. oracle soft nofile 1024
  5. oracle hard nofile 65536
  6. Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
    session required
2.3 Configuring Kernel Parameters
During installation, you can generate and run the Fixup script to check and set the kernel parameter values required for successful installation of the database. This script updates required kernel packages if necessary to minimum values.
If you cannot use the Fixup scripts, then verify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown. The procedure following the table describes how to verify and set the values manually.
The kernel parameter and shell limit values shown in the following section are minimum values only. For production database systems, Oracle recommends that you tune these values to optimize the performance of the system. Refer to the operating system documentation for more information about tuning kernel parameters.
2.8.1 Configuring Kernel Parameters for Linux
Parameter Minimum Value File



2097152 /proc/sys/kernel/shmall
Either 4 GB - 1 byte, or half the size of physical memory (in bytes), whichever is lower.
Default: 536870912
4096 /proc/sys/kernel/shmmni
6815744 /proc/sys/fs/file-max
aio-max-nrMaximum: 1048576
Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.
Minimum: 9000
Maximum: 65500
262144 /proc/sys/net/core/rmem_default
4194304 /proc/sys/net/core/rmem_max
262144 /proc/sys/net/core/wmem_default
1048576 /proc/sys/net/core/wmem_max

If the current value for any parameter is greater than the value listed in this table, then the Fixup scripts do not change the value of that parameter.
2.8.2 Displaying and Changing Kernel Parameter Values
Enter the commands shown in the following table to display the current values of the kernel parameters, make a note of these values and identify any values that you must change:
Parameter Command
semmsl, semmns, semopm, and semmni# /sbin/sysctl -a | grep sem

This command displays the value of the semaphore parameters in the order listed.
shmall, shmmax, and shmmni# /sbin/sysctl -a | grep shm

This command displays the details of the shared memory segment sizes.
file-max# /sbin/sysctl -a | grep file-max

This command displays the maximum number of file handles.
ip_local_port_range# /sbin/sysctl -a | grep ip_local_port_range

This command displays a range of port numbers.
rmem_default# /sbin/sysctl -a | grep rmem_default
rmem_max# /sbin/sysctl -a | grep rmem_max
wmem_default# /sbin/sysctl -a | grep wmem_default
wmem_max# /sbin/sysctl -a | grep wmem_max
aio-max-nr# /sbin/sysctl -a | grep aio-max-nr

If the value of any kernel parameter is different from the minimum value, then perform the following: edit /etc/sysctl.conf
#ADDED BY HEMESH 28/04/2010
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
#kernel.shmmax = 536870912
#kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
After updating the values of kernel parameters in the /etc/sysctl.conf file, either restart the computer, or run the command sysctl -p to make the changes in the /etc/sysctl.conf file available in the active kernel memory.

]# sysctl –p


Configure Kernel Parameters

Oracle Database 11g release 2 on RHEL/OEL 5 requires the kernel parameter settings shown below. The values given are minimums, so if your system uses a larger value, do not change it.
kernel.shmmax = 4294967295
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
RHEL/OEL 5 already comes configured with default values defined for the following kernel parameters:
Use the default values if they are the same or larger than the required values.
This article assumes a fresh new install of Oracle Enterprise Linux 5 and as such, many of the required kernel parameters are already set (see above). This being the case, you can simply copy / paste the following to both Oracle RAC nodes while logged in as root:
[root@racnode1 ~]# cat >> /etc/sysctl.conf <<EOF

# Controls the maximum number of shared memory segments system wide
kernel.shmmni = 4096

# Sets the following semaphore values:
# SEMMSL_value  SEMMNS_value  SEMOPM_value  SEMMNI_value
kernel.sem = 250 32000 100 128

# Sets the maximum number of file-handles that the Linux kernel will allocate
fs.file-max = 6815744

# Defines the local port range that is used by TCP and UDP
# traffic to choose the local port
net.ipv4.ip_local_port_range = 9000 65500

# Default setting in bytes of the socket "receive" buffer which
# may be set by using the SO_RCVBUF socket option

# Maximum setting in bytes of the socket "receive" buffer which
# may be set by using the SO_RCVBUF socket option

# Default setting in bytes of the socket "send" buffer which
# may be set by using the SO_SNDBUF socket option

# Maximum setting in bytes of the socket "send" buffer which
# may be set by using the SO_SNDBUF socket option

# Maximum number of allowable concurrent asynchronous I/O requests requests

Activate All Kernel Parameters for the System

The above command persisted the required kernel parameters through reboots by inserting them in the /etc/sysctl.conf startup file. Linux allows modification of these kernel parameters to the current system while it is up and running, so there's no need to reboot the system after making kernel parameter changes. To activate the new kernel parameter values for the currently running system, run the following as root on both Oracle RAC nodes in the cluster:
[root@racnode1 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
Verify the new kernel parameter values by running the following on both Oracle RAC nodes in the cluster:
[root@racnode1 ~]# /sbin/sysctl -a | grep shm
vm.hugetlb_shm_group = 0
kernel.shmmni = 4096
kernel.shmall = 4294967296
kernel.shmmax = 68719476736

[root@racnode1 ~]# /sbin/sysctl -a | grep sem
kernel.sem = 250        32000   100     128

[root@racnode1 ~]# /sbin/sysctl -a | grep file-max
fs.file-max = 6815744

[root@racnode1 ~]# /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 9000     65500

[root@racnode1 ~]# /sbin/sysctl -a | grep 'core\.[rw]mem'
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576

2.4 Creating an Oracle Base Directory

Create the directory for the software installation and assign ownership to oracle:oinstall.
$ mkdir -p /u01/app/oracle
$ chown -R oracle:oinstall /u01/app/
$ chmod -R 775 /u01/app/oracle

  • /u01 owned by root.
  • /u01/app/oracle owned by oracle:oinstall with 775 permissions.

  • 2.4 Setting /home/oracle/.bash_profile for the Oracle user

    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    umask 022
    # User specific environment and startup programs
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
    export PATH=/usr/sbin:$PATH
    export PATH=$ORACLE_HOME/bin:$PATH
    export ORACLE_TERM=xterm
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
    export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
    export TEMP=/tmp
    export TMPDIR=/tmp

    unset ORACLE_HOME
    unset TNS_ADMIN

    If the ORACLE_HOME environment variable is set, then Oracle Universal Installer uses the value that it specifies as the default path for the Oracle home directory. However, if you set the ORACLE_BASE environment variable, then Oracle recommends that you unset the ORACLE_HOME environment variable and choose the default path suggested by Oracle Universal Installer. Update the default shell startup file for the "oracle" UNIX account.
    For the Bourne, Bash, or Korn shell, we add the following lines to the /etc/profile file by running the following command:
    cat >> /etc/profile <<EOF
    if [ \$USER = "oracle" ]; then
    if [ \$SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    ulimit -u 16384 -n 65536
    umask 022

No comments: