Find the answer to your Linux question:
Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By bsdtux
Hi, Why do we need to tune some parameters for Oracle Database ? What is the need ? Which Kernel parameters are mostly required to be tuned? Regards, Appu....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2012
    Posts
    110

    Kernel Paramaters required to be tuned to for Oracle database.. Why ar


    Hi,

    Why do we need to tune some parameters for Oracle Database ? What is the need ?

    Which Kernel parameters are mostly required to be tuned?

    Regards,
    Appu.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,578
    The default settings for things like stack, heap, and such limits for applications may not be adequate for running an enterprise database such as Oracle. These settings are simple enough to change for a specific user (such as Oracle), or the system in general.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Location
    Nashville, TN
    Posts
    98
    Quote Originally Posted by redhat70 View Post
    Hi,

    Why do we need to tune some parameters for Oracle Database ? What is the need ?

    Which Kernel parameters are mostly required to be tuned?

    Regards,
    Appu.
    Because of Oracle's nature it needs these paramters to make efficent use of the OS / Kernel. I do have a script that I created when I was a semi Oracle person because I also got sick of staging Servers. You may have to tweak parts of it but it should be you going pretty quick.

    Code:
    #!/bin/sh
    #Copyright (C) 1989-1991, 1995-2011 Free Software Foundation, Inc.
    #
    #   This program is free software: you can redistribute it and/or modify
    #   it under the terms of the GNU General Public License as published by
    #   the Free Software Foundation, either version 3 of the License, or
    #   (at your option) any later version.
    #
    #   This program is distributed in the hope that it will be useful,
    #   but WITHOUT ANY WARRANTY; without even the implied warranty of
    #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    #   GNU General Public License for more details.
    #
    #   You should have received a copy of the GNU General Public License
    #   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
    #
    # :Author:  Josh Stephens
    # :Date:    5/20/2012
    # :Purpose: Stage linux servers for the installation of Oracle Linux 10g and 11g
    # :Email:   bsdtux@gmail.com
    
    #######################################
    #                                     #
    # Update /etc/sysctl.conf parameters  #
    #                                     #
    #######################################
    echo "Adding Oracle Requirements to /etc/sysctl.conf"
    grep -q 'kernel.shmmni' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/kernel.shmmni = [0-9]*/kernel.shmmni = 4096/'  /etc/sysctl.conf
    else
     echo 'kernel.shmmni = 4096' >> /etc/sysctl.conf
    fi
    
    grep -q 'kernel.shmmax' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/kernel.shmmax = [0-9]*/kernel.shmmax = 2147483648/'  /etc/sysctl.conf
    else
     echo 'kernel.shmmax = 2147483648' >> /etc/sysctl.conf
    fi
    
    grep -q 'kernel.shmall' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/kernel.shmall = [0-9]*/kernel.shmall = 2097152/'  /etc/sysctl.conf
    else
     echo 'kernel.shmall = 2097152' >> /etc/sysctl.conf
    fi
    
    grep -q 'kernel.sem' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/kernel.sem = [0-9]*[[:space:]]*[0-9]*[[:space:]]*[0-9]*[[:space:]]*[0-9]*/kernel.sem = 250 32000 100 128/'  /etc/sysctl.conf
    else
     echo 'kernel.sem = 250 32000 100 128' >> /etc/sysctl.conf
    fi
    
    grep -q 'fs.file-max' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/fs.file-max = [0-9]*/fs.file-max = 65536/'  /etc/sysctl.conf
    else
     echo 'fs.file-max = 65536' >> /etc/sysctl.conf
    fi
    
    grep -q 'fs.aio-max-nr' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]]; then
      sed -i 's/fs.aio-max-nr = [0-9]*/fs.aio-max-nr = 1048576/' etc/sysctl.conf
    else
     echo 'fs.aio-max-nr = 1048576' >> /etc/sysctl.conf
    fi
    
    grep -q 'net.ipv4.ip_local_port_range' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/net.ipv4.ip_local_port_range = [0-9]*[[:space:]]*[0-9]*/net.ipv4.ip_local_port_range = 1024 65000/'  /etc/sysctl.conf
    else
     echo 'net.ipv4.ip_local_port_range = 1024 65000' >> /etc/sysctl.conf
    fi
    
    grep -q 'net.core.rmem_default' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/net.core.rmem_default = [0-9]*/net.core.rmem_default = 262144/'  /etc/sysctl.conf
    else
     echo 'net.core.rmem_default = 262144' >> /etc/sysctl.conf
    fi
    
    grep -q 'net.core.rmem_max' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/net.core.rmem_max = [0-9]*/net.core.rmem_max = 4194304/'  /etc/sysctl.conf
    else
     echo 'net.core.rmem_max = 4194304' >> /etc/sysctl.conf
    fi
    
    grep -q 'net.core.wmem_default' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/net.core.wmem_default = [0-9]*/net.core.wmem_default = 262144/'  /etc/sysctl.conf
    else
     echo 'net.core.wmem_default = 262144' >> /etc/sysctl.conf
    fi
    
    grep -q 'net.core.wmem_max' /etc/sysctl.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/net.core.wmem_max = [0-9]*/net.core.wmem_max = 1048576/'  /etc/sysctl.conf
    else
     echo 'net.core.wmem_max = 1048576' >> /etc/sysctl.conf
    fi
    
    ##
    # Activate New configuration
    ##
    /sbin/sysctl -p
    
    #######################################################
    #                                                     #
    # update /etc/security/limits.conf to add oracle      #
    #                                                     #
    #######################################################
    echo "Adding Oracle Requirements to /etc/security/limits.conf"
    grep -q -E 'oracle[[:space:]]*soft[[:space:]]*nproc' /etc/security/limits.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/oracle[[:space:]]*soft[[:space:]]*nproc[[:space:]]*[0-9]*/oracle\tsoft\tnproc\t 2047/' /etc/security/limits.conf  
    else
      echo 'oracle' $'\t' 'soft' $'\t'  'nproc' $'\t' '2047' >> /etc/security/limits.conf
    fi
    
    grep -q -E 'oracle[[:space:]]*hard[[:space:]]*nproc' /etc/security/limits.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/oracle[[:space:]]*hard[[:space:]]*nproc[[:space:]]*[0-9]*/oracle\thard\tnproc\t 16384/' /etc/security/limits.conf
    else
      echo 'oracle' $'\t' 'hard' $'\t'  'nproc' $'\t' '16384' >> /etc/security/limits.conf
    fi
    
    grep -q -E 'oracle[[:space:]]*soft[[:space:]]*nofile' /etc/security/limits.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/oracle[[:space:]]*soft[[:space:]]*nofile[[:space:]]*[0-9]*/oracle\tsoft\tnofile\t 1024/' /etc/security/limits.conf
    else
      echo 'oracle' $'\t' 'soft' $'\t'  'nofile' $'\t' '1024' >> /etc/security/limits.conf
    fi
    
    grep -q -E 'oracle[[:space:]]*hard[[:space:]]*nofile' /etc/security/limits.conf
    
    if [[ $? -eq 0 ]] ; then
      sed -i 's/oracle[[:space:]]*hard[[:space:]]*nofile[[:space:]]*[0-9]*/oracle\thard\tnofile\t 65536/' /etc/security/limits.conf
    else
      echo 'oracle' $'\t' 'hard' $'\t'  'nofile' $'\t' '65536' >> /etc/security/limits.conf
    fi
    
    #################################################
    #                                               #
    # Edit /etc/pam.d/login file                    #
    #                                               #
    #################################################
    
    echo "Adding Oracle Requirements to /etc/pam.d/login file"
    grep -q -E 'session[[:space:]]*required[[:space:]]*/lib/security/pam_limits.so' /etc/pam.d/login
    
    if [[ ! $? -eq 0 ]] ; then
      echo 'session' $'\t' 'required' $'\t' '/lib/security/pam_limits.so' >> /etc/pam.d/login
    fi
    
    grep -q -E 'session[[:space:]]*required[[:space:]]*pam_limits.so' /etc/pam.d/login
    
    if [[ ! $? -eq 0 ]] ; then
      echo 'session' $'\t' 'required' $'\t' 'pam_limits.so' >> /etc/pam.d/login
    fi
    
    #################################################
    #				                #
    # Create Oracle Users and Groups                #
    #                                               #
    #################################################
    
    function AddGroup()
    {
     grep -q "${1}" /etc/group
    
     if [[ ! $? -eq 0 ]] ; then
       /usr/sbin/groupadd "${1}"
     fi
    }
    
    echo "Adding Oracle Group oinstall"
    AddGroup oinstall
    echo "Adding Oracle Group dba"
    AddGroup dba
    echo "Adding Oracle Group asmdba"
    AddGroup asmdba
    echo "Adding Oracle Group crs"
    AddGroup crs
    
    function AddUser()
    {
     grep -q "${1}" /etc/passwd
     
     if [[ ! $? -eq 0 ]] ; then
      case ${1} in
    	oracle) /usr/sbin/useradd -g oinstall -G dba oracle;;
    	osasm)  /usr/sbin/useradd -g oinstall -G asmdba osasm;;
    	crs)	/usr/sbin/useradd -g oinstall -G crs crs;;
      esac
     fi
    }
    
    echo "Adding Oracle User oracle"
    AddUser oracle
    echo "Adding Oracle User osasm"
    AddUser osasm
    echo "Adding Oracle User crs"
    AddUser crs
    
    ##################################################
    #                                                #
    # Install Required Oracle Software               #
    #                                                #
    ##################################################
    
    ##
    # This section will install software based on what the script finds in the /etc/redhat-release
    ##
    
    
    ##
    # Install Software using CentOS's yum package manager
    ## 
    grep -q "CentOS" /etc/redhat-release
    
    if [[ $? -eq 0 ]] ; then
     echo "Installing Required Oracle Software"
     yum install binutils* compat-libstdc++* elfutils-libelf* glibc* glibc-common* ksh* libaio* libgcc* libstdc++* make* elfutils-libelf-devel* elfutils-libelf-devel-static* glibc-headers* glibc-devel* kernel-headers* gcc* gcc-c++* libgomp* libstdc++-devel* libaio-devel* sysstat* unixODBC* unixODBC-devel* --assumeyes > /dev/null 2>&1
    fi
    
    ##
    # Install Software using Red Hats rpm. We will get the version of the OS and Locate where the RPMS are found
    #
    grep -q "Red" /etc/redhat-release
    if [[ $? -eq 0 ]]; then
      RPM_DIR=$(find /media/ -name "gcc*" | rev | cut -d/ -f2- | rev | uniq)"/"
      uname -a | grep -q i386
      
      if [[ $? -eq 0 ]]; then
        echo " "
      else
       echo "Installing Required Oracle Software"
       rpm -Uvh ${RPM_DIR}binutils*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}compat-libstdc++*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}elfutils-libelf*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}glibc*.x86_64.rpm ${RPM_DIR}kernel-headers*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}kernel-headers*.x86_64.rpm 
       rpm -Uvh ${RPM_DIR}glibc-headers*.x86_64.rpm 
       rpm -Uvh ${RPM_DIR}glibc-devel*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}glibc-common*.x86_64.rpm ${RPM_DIR}kernel-headers*.x86_64.rpm 
       rpm -Uvh ${RPM_DIR}gcc-4*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}ksh*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}libaio*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}libgcc*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}libstdc++*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}make*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}elfutils-libelf-devel*.x86_64.rpm ${RPM_DIR}elfutils-libelf-devel-static*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}libgomp*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}libstdc++-devel*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}libaio-devel*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}sysstat*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}gcc-c++-4*.x86_64.rpm 
       rpm -Uvh ${RPM_DIR}unixODBC*.x86_64.rpm
       rpm -Uvh ${RPM_DIR}unixODBC-devel*.x86_64.rpm
     fi
    fi
    
    #################################################
    #                                               #
    #  Creating Oracle Home Directory              	#
    #                                               #
    #################################################
    
    if [ ! -d "/u01/app/oracle" ]; then
    
    echo "Creating /u01/app/oracle"
    mkdir -p /u01/app/oracle
    
    echo "Changing owner of /u01/app/oracle"
    chown -R oracle:oinstall /u01/app/
    
    echo "Changing rights on /u01/app/oracle"
    chmod -R 775 /u01/app/
    fi
    
    echo "Adding Ulimit information to Oracle's Bash Profile"
    echo " " >> /home/oracle/.bash_profile
    echo "if [ \$SHELL = \"/bin/ksh\" ]; then" >> /home/oracle/.bash_profile
    echo $'\t'"ulimit -p 16384" >> /home/oracle/.bash_profile
    echo $'\t'"ulimit -n 63536" >> /home/oracle/.bash_profile
    echo "else" >> /home/oracle/.bash_profile
    echo $'\t'"ulimit -u 16384 -n 63536" >> /home/oracle/.bash_profile
    echo "fi" >> /home/oracle/.bash_profile
    Rubberman likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •