Oracle Installation on Linux
Oracle
Installation on Linux
Checking
Hardware Requirements
Log
into the system as the root user.
For
setting up the system to be used by Oracle there are a few
prerequisites that must be checked and possibly changed by the root
user. Log in as the root user and this document will tell you when it
is time to switch from the root user to someone else.
How
much memory
command:
grep -i memtotal /proc/meminfo
results:
should be at least 1GB
How
much swap
command:
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
command:
grep "model name" /proc/cpuinfo
results:
informational
How
much available RAM and swap
command:
free
results:
informational
How
much shared memory available
command:
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
command:
df -k /tmp
results:
should have at least 400MB available
How
much disk space for Oracle binaries
command:
df -k
results:
Depending on installation type you should have between 1.5GB and
3.5GB
Checking
Software Requirements
What
distribution and version of Linux is installed
command:
cat /proc/version
results:
Linux version 2.6.18-8.1.15.el5 (mockbuild@builder6.centos.org)
(gcc
version 4.1.1 20070105 (Red Hat 4.1.1-52))
#1
SMP Mon Oct 22 08:32:04 EDT 2007
What
version of the kernel is installed
command:
uname -r
results:
2.6.18-8.1.15.el5
Are
the following packages installed (assumes CentOS-5 and above
distribution)
command:rpm
-q binutils \
compat-libstdc++
\
elfutils-libelf
\
elfutils-libelf-devel
\
glibc
\
glibc-common
\
glibc-devel
\
glibc-headers
\
gcc
\
gcc-c++
\
libaio-devel
\
libaio
\
libgcc
\
libstdc++
\
libstdc++
\
make
\
sysstat
\
unixODBC
\
unixODBC-devel
results:
you will probably get quite a few packages that are not installed
with a typical installation. You can investigate missing packages
with the following command making sure you add/subtract from this
list if necessary.
yum
list available "compat*" \
"elfutils*"
\
"glibc*"
\
"gcc*"
\
"libaio*"
\
"sysstat*"
\
"unixODBC*"
action
: Our base installation left us needing to issue the following
command to install missing packages.
yum
-y install compat-libstdc++-296.i386 \
compat-libstdc++-33.i386
\
elfutils-libelf-devel.i386
\
glibc-devel.i386
\
glibc-headers.i386
\
gcc.i386
\
gcc-c++.i386
\
libaio-devel.i386
\
sysstat.i386
\
unixODBC.i386
\
unixODBC-devel.i386
Hosts
File
The
"/etc/hosts" file must contain a fully qualified name for
the server.
<IP-address>
<fully-qualified-machine-name> <machine-name>
For
example.
127.0.0.1
localhost.localdomain localhost
192.168.168.32
linux linux
Kernel
Parameter Setup
Oracle
recommend the following minimum parameter settings.
fs.suid_dumpable
= 1
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
The
current values can be tested using the following command.
/sbin/sysctl
-a | grep <param-name>
Add
or amend the following lines in the "/etc/sysctl.conf"
file.
fs.suid_dumpable
= 1
fs.aio-max-nr
= 1048576
fs.file-max
= 6815744
kernel.shmall
= 2097152
kernel.shmmax
= 536870912
kernel.shmmni
= 4096
#
semaphores: semmsl, semmns, semopm, semmni
kernel.sem
= 250 32000 100 128
net.ipv4.ip_local_port_range
= 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
Run
the following command to change the current kernel parameters.
/sbin/sysctl
-p
Add
the following lines to the "/etc/security/limits.conf"
file.
oracle
soft nproc 2047
oracle
hard nproc 16384
oracle
soft nofile 4096
oracle
hard nofile 65536
oracle
soft stack 10240
Create
the new groups and users.
Description
|
Oracle
Privilege
|
Oracle
Group Name
|
UNIX
Group name
|
Oracle
Inventory and Software Owner
|
|
|
oinstall
|
Database
Administrator
|
SYSDBA
|
OSDBA
|
dba
|
Database
Operator
|
SYSOPER
|
OSOPER
|
oper
|
ASM
Administrator
|
SYSASM
|
OSASM
|
asm
|
OSDBA
Group for ASM
|
|
|
asmdba
|
#groupadd
oinstall
#groupadd
dba
#groupadd
oper
#groupadd
asmadmin
#useradd
-g oinstall -G dba,oper,asmadmin oracle
#passwd
oracle
Note.
We are not going to use the "asmadmin" group, since this
installation will not use ASM.
Verify
That the User nobody Exists
Before
installing the Oracle software, complete the following procedure to
verify that the user nobody exists on the system:
- To determine if the user exists, enter the following command:
- # id nobody
uid=99(nobody)
gid=99(nobody) groups=99(nobody)
If
this command displays information about the nobody user, then you do
not have to create that user.
- If the user nobody does not exist, then enter the following command to create it:
#
/usr/sbin/useradd
nobody
SELINUX
disabled
The
following setup tasks must be performed regardless of which setup
method you used previously.
Disable
secure linux by editing the "/etc/selinux/config"
file, making sure the SELINUX flag is set as follows.
SELINUX=disabled
Alternatively,
this alteration can be done using the GUI tool (Applications >
System Settings > Security Level). Click on the SELinux tab and
disable the feature. If SELinux is disabled after installation, the
server will need a reboot for the change to take effect.
Create
directories
Create
the directories in which the Oracle software will be installed.
#mkdir
-p /u01/app/oracle/product/11.1.0/db_1
#chown
-R oracle:oinstall /u01
#chmod
-R 775 /u01
Login
as root and issue the following command.
#xhost
+<machine-name>
or
#xhost
+SI:localuser:oracle
Configuring
Shell Limits for the oracle User
For
the Bourne, Bash, or Korn shell, add the following lines to the
/etc/profile file by running the following command:
#vi
/etc/profile
if
[ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh"
]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF
To
make these changes, run the following as root:
#vi
/etc/pam.d/login
#
Added for Oracle Shell Limits
session
required /lib/security/pam_limits.so
session
required pam_limits.so
Login
as the oracle user and add the following lines at the end of the
".bash_profile" file, remembering to adjust them for your
specific installation.
#vi
.bash_profile
Add
following line
#
Oracle Settings
umask
022
#
Oracle Settings
TMP=/tmp;
export TMP
TMPDIR=$TMP;
export TMPDIR
ORACLE_HOSTNAME=linux;
export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl;
export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle;
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1;
export ORACLE_HOME
ORACLE_SID=orcl;
export ORACLE_SID
PATH=/usr/sbin:$PATH;
export PATH
PATH=$ORACLE_HOME/bin:$PATH;
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
Start Installation
Log
into the oracle user.
Start
the Oracle Universal Installer (OUI) by issuing the following command
in the database directory.
./runInstaller
Proceed
with the installation of your choice. You can see the type of
installation I performed by clicking on the links below to see screen
shots of each stage.
Start
Oracle Lisnter and DB
TO
start Listener Service:
$ lsnrctl start
TO
start Database:
$ sqlplus /nolog
SQL> conn / as sysdba
SQL> startup;
TO
start DB Console:
$ emctl start dbconsole
then open browser and go to
https://localhost:5500/em