Sunday, April 17, 2016

Oracle : Install Oracle 11G on Centos Server 6.x

Hardware Requirements

To check out your recommended hardware requirements, login to the CentOS 6.2 Linux Server box as the bozzuser and verify the below list:

    How much memory:

$ grep -i memtotal /proc/meminfo


        results: should be at least 1GB

     How much swap:

$ grep -i swaptotal /proc/meminfo

        results: 
        
        - should be 1.5 the size of memtotal if memtotal < 2GB

             - should be equal to memtotal if memtotal is between 2GB and 8GB

             - should be .75 the size of memtotal if memtotal > 8GB

    What processor type:

$ grep "model name" /proc/cpuinfo

        results: informational
    
    How much available RAM and swap:

$ free

        results: informational

    How much shared memory available:

$ df -k /dev/shm

        results: informational

        purpose: The shared memory should be sized to be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer.

    How much disk space in /tmp:

$ df -k /tmp

        results: should have at least 400MB available

    How much disk space for Oracle binaries:

$ df -k

        results: Depending on installation type you should have between 1.5GB and 3.5GB 


Software Requirements

To check out your recommended software requirements, login to the CentOS 6.2 Linux Server box as the bozzuser and verify the below list:      

   What distribution and version of Linux is installed:

$ cat /proc/version
        results:  Linux version 2.6.32-220.2.1.el6.x86_64 (mockbuild@c6-x8664-build.centos.org) 

(gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) ) 

#1 SMP Fri Dec 23 02:21:33 CST 2011


    What version of the kernel is installed:

$ uname -r
        results: 2.6.32-220.2.1.el6.x86_64

    Ensure that the following packages are installed:

$ rpm -q compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel 
$ rpm -q glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel 
$ rpm -q libaio libgcc libstdc++ libstdc++ make sysstat unixODBC unixODBC-devel
    if some of this packages are missing then install them
   

$ sudo yum install compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel 
$ sudo yum install glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel 
$ sudo yum install libaio libgcc libstdc++ libstdc++ make sysstat unixODBC unixODBC-devel

     also install unzip package: 

$ sudo yum install unzip 

Install Steps

  1. Login in as bozz user
  2. Create Oracle's user and groups
    1. Create groups oinstall & dba:
    2. $ sudo groupadd oinstall
      $ sudo groupadd dba
      
    3. Create the oracle user and set its password:
    4. $ sudo useradd -m -g oinstall -G dba -s /bin/bash oracle
      $ sudo passwd oracle
      
    5. Check if nobody user exists, this user is almost always created on a base CentOS installation:
    6. $ id nobody
      uid=99(nobody) gid=99(nobody) groups=99(nobody)
      
      if this user doesn't exists then use the following command to create it:
      $ sudo useradd nobody
      
  3. Configure some kernel parameters. The following kernel parameters must be validated and possibly changed. Use the commands given below to view a particular kernel setting and then change it if the setting is lower than the recommendation given here. The changed parameters are in bold in my case.
    1. Verify kernel parameters: 
    2. # semaphores: semmsl, semmns, semopm, semmni
      $ sysctl -a | grep kernel.sem
      
      results should be >= than: 
      
      kernel.sem = 250        32000   100     128
      
      $ sysctl -a | grep kernel.shm
      
      results should be >= than: 
      
      kernel.shmmax = 536870912
      
      kernel.shmmni = 4096
      
      kernel.shmall = 2097152
      
      $ sysctl -a | grep file-max
      
      results should be >= than: 
      
      fs.file-max = 6815744
      
      $ sysctl -a | grep ip_local_port_range
      
      results should be >= than: 
      
      net.ipv4.ip_local_port_range = 9000 65500
      
      $ sysctl -a | grep rmem_default
      
      results should be >= than: 
      
      net.core.rmem_default = 262144
      
      $ sysctl -a | grep rmem_max
      
      results should be >= than: 
      
      net.core.rmem_max = 4194304
      
      $ sysctl -a | grep wmem_default
      
      results should be >= than: 
      
      net.core.wmem_default = 262144
      
      $ sysctl -a | grep wmem_max
      
      results should be >= than: 
      
      net.core.wmem_max = 1048576
      
      $ sysctl -a | grep aio-max-nr
      
      results should be >= than: 
      
      fs.aio-max-nr = 1048576
      
    3. Make the changes permanent by editing the archive /etc/sysctl.conf file. This is given as an example only and does not reflect the results obtained above by the sysctl commands. Only add lines that are needed and do not change any values to be lower than the base installation might have assigned. In my case I only change the following settings on /etc/sysctl.conf:
    4. 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
      
    5. Apply the changes now:
    6. $ sudo sysctl -p
      
  4. Setting shell limits for the oracle user
    1. Edit the file /etc/security/limits.conf:
    2. $ sudo nano /etc/security/limits.conf
      
      and add the following:
      oracle soft nproc  2047
      oracle hard nproc  16384
      oracle soft nofile 1024
      oracle hard nofile 65536
      
    3. Edit /etc/pam.d/login:
    4. $ sudo nano /etc/pam.d/login
      and add the following depending on the architecture:
      session required /lib64/security/pam_limits.so
      session required pam_limits.so
      NOTE: be aware of the real location of pam_limits.so. It depens on the architecture and distro. On CentOS 6.2 64 bits /lib64/security/pam_limits.so
    5. Create a new profile archive at  /etc/profile.d/custom.sh:
    6. $ sudo nano /etc/profile.d/custom.sh
      and add the following content:
      #!/bin/bash
      
      if [ $USER = "oracle" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
        else
          ulimit -u 16384 -n 65536
        fi
      fi
      then add execution permissions to profile script: 
      $ sudo chmod +x /etc/profile.d/custom.sh
  5. Creating necessary directories to install the Oracle Software
    1. Check if you have enough space on disk and choose a directory to install:
    2. $ df -kh
      1. Create subdirectories and give permissions to the oracle user:
      2. $ sudo mkdir -p /opt/app/oracle/product/11.2.0
        $ sudo chown -R oracle:oinstall /opt/app
        $ sudo chmod -R 775 /opt/app
        
    3. Logout, login as oracle user (don't forget ssh -Y oracle@SERVER) and set the environment for the installation by adding the following to ~/.bash_profile: :
    4. $ nano ~/.bash_profile
      
      add the following line:
      umask 022
      
      export TMPDIR=$TMP
      export ORACLE_BASE=/opt/app/oracle
      export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
      export PATH=$ORACLE_HOME/bin:$PATH
      
      exit nano (Ctrl+X) and execute oracle's .bash_profile for testing purposes:
      $ source ~/.bash_profile
      logout from oracle user:
      $ exit
    5. Ensure oracle user is using an X Windows System. For example you can install and execute xterm:
    6. $ sudo yum install xterm
      
      logout and login remotely again as oracle user from a Linux client machine with Desktop environment:
      $ ssh -Y oracle@SERVER
      
      test if xterm works you should be able to see a X11 Windows on your client Desktop environment, if not then enable SSH X11 Forwarding (see last step)
      $ xterm
      
    7. Start the database installer (you should be able to see a X11 Windows with the Oracle database installation wizard on your client Desktop environment):
      $ cd /tmp/database 
      $ ./runInstaller
    8. NOTE: I assume you already had the database installer on the server. If not then copy the installer archives to the server via scp and uncompress them: 
      on the client run:
      $ scp linux.x64_11gR2_database_1of2.zip oracle@SERVER:/tmp
      $ scp linux.x64_11gR2_database_2of2.zip oracle@SERVER:/tmp
      
      on the server run:
      $ pushd /tmp
      $ unzip linux.x64_11gR2_database_1of2.zip
      $ unzip linux.x64_11gR2_database_2of2.zip
      $ popd 
      
    9. Optionally specify email address to be informed about security issues
    10. Choose "Install database software only", click "Next"
    11. Choose "Single instance database installation", click "Next"
    12. Add another language besides of English if you wish, click "Next"
    13. Choose 'Enterprise Edition' and on "Select options" choose the components you wish to install, click "Next"
    14. Set the following settings and click "Next":
      • verify Oracle Base: '/opt/app/oracle'
      • verify Oracle Home: '/opt/app/oracle/product/11.2.0/db_1'
    15. Verify path of inventory directory: '/opt/app/oraInventory'  and verify group name for install of 'oinstall', click "Next" 
    16. Prerequisite Checks:  the installer will verify the system environment and report on any issues it may find. If all goes well you will get the status of 'Succeeded' for every check. You have to check 'Ignore All' but ensure at least that the following checks pass
      1. Physical memory (also Available)
      2. Free space
      3. User and groups existence
      4. Group membership
      5. Hard and soft limits
      6. Architecture
      7. Kernel version
      8. OS Kernel parameters
      9. Swap size
      10. Run level.
      11. Packages
      12. Users with same ID
    17. Summary: This screen give a summary of the installation you are about to perform. Click and expand the products being installed to give you an idea of the what product and version is going to be installed.
      1. validate 'Global Settings' for directories
      2. validate 'Space Requirements'
      3. Click NEXT
    18. Install: This screen gives a status of what is being installed. If all system settings have been properly set and all packages been installed properly then this should proceed without error. 
      1. Note the time it takes for specific products. If you notice one hanging or taking a long amount of time (greater than 10 minutes) you could have a condition that requires a pre-installation patch. Don't stop the installer yet but instead start looking for a bug / patch for the Oracle 11g installation process and the actual product being installed.
      2. Execute configuration scripts, when the wizard ask it:
        • open up a different terminal window
        • login as the bozz user
        • run:
        • $ sudo /opt/app/oraInventory/orainstRoot.sh
          $ sudo /opt/app/oracle/product/11.2.0/db_1/root.sh
          accept a default of /usr/local/bin
        • click OK
    19. Cleanup: If you downloaded the software from the net you can now remove .zip file and the complete directory structure you unzipped it to.
    20. Final setup:  Add the following lines to oracle's $HOME/.bash_profile archive. This will allow you to execute various Oracle binaries to create databasesconfigure network settings, and generally manage the Oracle database environment:
    21. umask 022
      
      export TMPDIR=/tmp
      export ORACLE_BASE=/opt/app/oracle
      export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
      export PATH=$ORACLE_HOME/bin:$PATH
      NOTE: remember to first login as oracle user to edit the $HOME/.bash_profile archive. Finally ensure the execution permissions for this archive.

    Post Install

    References

    No comments:

    Post a Comment