본문 바로가기

wif LiNoUz/Oracle,Sql

SLSE 11에 오라클 설취




Installation of Oracle 11g on SLES 11

News

Installing Oracle Database 11g

Recommended Links Installation ChecklistOracle kernel parameters tuning on LinuxSemaphore and Shared Segment Kernel ParametersPackages

Orarun

 

 

  HumorEtc

There are two ways to create Oracle environment in SLES 11:

  • To use orarrun. It is a very questionable package that is discussed separately. This package is not required for running Oracle and was created for Oracle 10.2. It is over-engennered and it might make installation and running Oracle more complex not less. The only advantage that I see is that it installs all the nessesary libraries. After that it can be disabled. BTW its readme  still talking about Suse 7.3
  • to adapt Oracle recommendations for Red Hat/Oracle Linux

Fixing damage from orarun

Suse orarun package cause oracle installer to report "fake" errors such as

file-max                  size is currently 6553600
   increase to       6815744
despite the fact that you put this setting in /etc/sysctl.conf. This is because it is designed to overwrite setting from /etc/sysctl.conf  with its own. Which is strange design decision but that's the design decision they made.

Due to this I do not recommend installing orarun during the initial installation on Suse 11.

After the initial installation just install dependencies but not the package itself.

If you did install the package quick fix that I used is as following

mkdir /root/orarun_junk
cd /init.d
mv oracle /root/orarun_junk
rm `find . -name "*oracle"`
mv  /etc/profile.d/oracle* /root/orarun_junk
mv /etc/sysconfig/oracle /root/orarun_junk
That does not fix all the damage (it also inserts unnecessary line in login PAM as well, but you can live with it. At least after the reboot you can install oracle without errors.

Installing without orarun

We will discuss the second way here, as orarrun looks over-engineered and some design decision are questionable

There are three main steps in Installation of Oracle on SLES 11:

There are also several types of common installation errors that you need to be aware of

Pre-Installation Tasks

If you selected orarrun package during the installation, deinstall  if forcefully without deinstalling dependencies

1. Create oracle account and dba group

su - 
# groupadd -g 5000 dba 
# useradd -u 5001 -g dba oracle 
# mkdir /home/oracle 
# chown oracle:dba /home/oracle 
2. Edit the /etc/sysctl.conf and add following lines:
# Controls the maximum number of shared memory segments, in pages
# For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
# fs.file-max = 327679
fs.file-max = 6815744

# Oracle-Validated setting for kernel.msgmni is 2878
kernel.msgmni = 2878


# Oracle-Validated setting for kernel.msgmnb is 65536
kernel.msgmnb = 65536

# Oracle-Validated setting for kernel.sem is '250 32000 100 142'
kernel.sem = 250 32000 100 142

# Oracle-Validated setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# Oracle-Validated setting for kernel.shmall is 1073741824
kernel.shmall = 1073741824

# Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
kernel.shmmax = 4398046511104

# Oracle-Validated setting for kernel.sysrq is 1
kernel.sysrq = 1

# Oracle-Validated setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
# For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
# net.core.rmem_max = 2097152
net.core.rmem_max = 4194304

# Oracle-Validated setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
# For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
# net.core.wmem_max = 262144
net.core.wmem_max = 1048576

# Oracle-Validated setting for fs.aio-max-nr is 3145728
fs.aio-max-nr = 3145728

# For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
# For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
# net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_local_port_range = 9000 65500

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200
Note: You need to execute "sysctl -p" command to apply above settings.

Recommendation to insert in the file /etc/pam.d/login file the line:

session required pam_limits.so
is bogus as this line exists in common_session include used in login (orarun does this and in this case you can delete the line).

Edit the /etc/security/limits.conf file and add following lines:

## added by orarun ##
oracle	soft	nproc	2047
oracle	hard	nproc	16384
oracle	soft	nofile	1024
oracle	hard	nofile	65536
3. Creating oracle directories

# mkdir /opt/oracle
# mkdir /opt/oracle/111
# chown -R oracle:dba /opt/oracle


4. Setting Oracle Enviroment
Edit the /home/oracle/.bash_profile file and add following lines: 
Use this settings for 64bit (x86_64) architecture.

ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/111
ORACLE_SID=ORCL
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_LIBRARY_PATH_32 PATH


Save the .bash_profile and execute following commands for load new enviroment:

cd /home/oracle
. .bash_profile


5. For OpenSuSE only!:Backup original /etc/SuSE-release and change the distribution and release in original file. Change content as following:

SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 1

 Installation

1. Download and install required .rpm packages.  You can get them by checking the dependicies for orarun package.

Installation of oracle database is standard and is well described in Oracle publications.


Post-Instalation Tasks

1. Create an init script for auto startup and shutdown of  the database and listener

See Oracle Database HOWTO Automatic Startup and Shutdown
 


Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):

chmod 750 /etc/init.d/oracle
chkconfig --add oracle --level 0356


2. (Optional) Auto Startup and Shutdown of Enterprise Manager Database Control

As root user create new file "oraemctl" (init script for startup and shutdown EM DB Console) in /etc/init.d/ directory with following content:

#! /bin/bash
#
#
# /etc/init.d/oracle
#
#
### BEGIN INIT INFO
# Provides: oracle
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Starting and stopping Oracle Database
### END INIT INFO
. ~oracle/.profileRETVAL=0

function start {
# Start daemons.
   [ -x /dba_scripts/startup_oracle.sh ] || exit 4
   su - oracle -c /dba_scripts/startup_oracle.sh tee /var/log/oracle/startup.log 2>&1
   return 0
}

function stop {
# Stop daemons.
   echo -n $"Shutting down oracle"
   [ -x /dba_scripts/stop_oracle.sh ] || exit 4
   su - oracle -c /dba_scripts/stop_oracle.sh tee /var/log/oracle/stop.log 2>&1
   return 0
}

# See how we were called.
case "$1" in
  start)
     start
     ;;
  stop)
     stop
     ;;
  restart|reload)
     stop
     start
     ;;
  *)
     echo $"Usage: $0 {start|stop|reload|restart}"
     exit 2
esac
exit 0

Change the permissions, and enable init scripts for specific runlevels:

chmod 750 /etc/init.d/oracle
chkconfig --add oracle --level 0356

'wif LiNoUz > Oracle,Sql' 카테고리의 다른 글

시간계산 쿼리  (0) 2013.03.18
install oracle 11g on suse11 sp1  (0) 2013.03.07
db2 기본 명령어  (0) 2013.02.22
DB2 접속  (0) 2013.02.22
SQL_LOADer로 db쳐박기 쉘 or bat  (0) 2013.02.15