- Now with Oracle 11g R2.
- Install steps were fixed according to R2.
- Reference added to Creating a new Oracle 11g R2 Database on CentOS 6.2
- Reference added to Configuring a network listener for Oracle on CentOS 6.2
The former post I wrote was a how to install an Oracle-ready CentOS 6.2 Linux Server box.Its time then to install the Oracle 11g Database server. This post is about the same thing, but using a CentOS 5, so I based this how to on it and improve some minor things, but the whole idea is pretty much the same.
Hardware RequirementsTo check out your recommended hardware requirements, login to the CentOS 6.2 Linux Server box as the bozz user 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
- 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
How much available RAM and swap:
How much shared memory available:
$ df -k /dev/shm
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 RequirementsTo check out your recommended software requirements, login to the CentOS 6.2 Linux Server box as the bozz user and verify the below list:
What distribution and version of Linux is installed:
results: Linux version 2.6.32-220.2.1.el6.x86_64 (firstname.lastname@example.org)$ cat /proc/version
(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:
results: 2.6.32-220.2.1.el6.x86_64$ uname -r
Ensure that the following packages are installed:
if some of this packages are missing then install them$ 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
$ 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
- Login in as bozz user
- Create Oracle's user and groups
- Create groups oinstall & dba:
- Create the oracle user and set its password:
- Check if nobody user exists, this user is almost always created on a base CentOS installation:
- 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.
- Verify kernel parameters:
- 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:
- Apply the changes now:
- Setting shell limits for the oracle user
- Edit the file /etc/security/limits.conf:
- Edit /etc/pam.d/login:
- Create a new profile archive at /etc/profile.d/custom.sh:
- Creating necessary directories to install the Oracle Software
- Check if you have enough space on disk and choose a directory to install:
- Create subdirectories and give permissions to the oracle user:
- 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: :
- Ensure oracle user is using an X Windows System. For example you can install and execute xterm:
- 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
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:
- Optionally specify email address to be informed about security issues
- Choose "Install database software only", click "Next"
- Choose "Single instance database installation", click "Next"
- Add another language besides of English if you wish, click "Next"
- Choose 'Enterprise Edition' and on "Select options" choose the components you wish to install, click "Next"
- Set the following settings and click "Next":
$ sudo groupadd oinstall $ sudo groupadd dba
$ sudo useradd -m -g oinstall -G dba -s /bin/bash oracle $ sudo passwd oracle
if this user doesn't exists then use the following command to create it:$ id nobody uid=99(nobody) gid=99(nobody) groups=99(nobody)
$ sudo useradd nobody
# 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
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
$ sudo sysctl -p
and add the following:$ sudo nano /etc/security/limits.conf
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
and add the following depending on the architecture:$ sudo nano /etc/pam.d/login
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.sosession required /lib64/security/pam_limits.so session required pam_limits.so
and add the following content:$ sudo nano /etc/profile.d/custom.sh
then add execution permissions to profile script:#!/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
$ sudo chmod +x /etc/profile.d/custom.sh
$ df -kh
$ sudo mkdir -p /opt/app/oracle/product/11.2.0 $ sudo chown -R oracle:oinstall /opt/app $ sudo chmod -R 775 /opt/app
add the following line:$ nano ~/.bash_profile
exit nano (Ctrl+X) and execute oracle's .bash_profile for testing purposes: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
logout from oracle user:$ source ~/.bash_profile
logout and login remotely again as oracle user from a Linux client machine with Desktop environment:$ sudo yum install xterm
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)$ ssh -Y oracle@SERVER
on the client run:
on the server run:$ scp linux.x64_11gR2_database_1of2.zip oracle@SERVER:/tmp $ scp linux.x64_11gR2_database_2of2.zip oracle@SERVER:/tmp
$ pushd /tmp $ unzip linux.x64_11gR2_database_1of2.zip $ unzip linux.x64_11gR2_database_2of2.zip $ popd
- verify Oracle Base: '/opt/app/oracle'
- verify Oracle Home: '/opt/app/oracle/product/11.2.0/db_1'
- Physical memory (also Available)
- Free space
- User and groups existence
- Group membership
- Hard and soft limits
- Kernel version
- OS Kernel parameters
- Swap size
- Run level.
- Users with same ID
- validate 'Global Settings' for directories
- validate 'Space Requirements'
- Click NEXT
- 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.
- Execute configuration scripts, when the wizard ask it:
- open up a different terminal window
- login as the bozz user
- click OK
$ sudo /opt/app/oraInventory/orainstRoot.sh $ sudo /opt/app/oracle/product/11.2.0/db_1/root.sh
NOTE: remember to first login as oracle user to edit the $HOME/.bash_profile archive. Finally ensure the execution permissions for this archive.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
- Configure a network listener for Oracle Database on CentOS 6.2
- Creating a new Oracle 11g R2 Database on CentOS 6.2
- Create a init script to make Oracle database start automatically on system booting