리눅스 상에서 오라클 설치

# centOS 설치

- centOS 설치시에 xwindow 설치

# 패키지 설치

# yum -y install binutils compat-db control-center gcc gcc-c++ \
glibc glibc-common gnome-libs libstdc++ libstdc++-devel make \
pdksh sysstat xscreensaver compat-libstdc++-33 libaio-devel \
unixODBC unixODBC-devel

# 오라클 계정 설정

# groupadd dba

# useradd -d /oracle -g dba oracle

# passwd oracle

# chmod 755 -R /oracle

# chown -R oracle.dba /oracle

# /etc/sysctl.conf 파일 수정 및 적용

# vi /etc/sysctl.conf

-> 아래 내용 추가

### oracle ###
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

# /sbin/sysctl -p

-> 위 명령어로 /etc/sysctl.conf 파일에서 추가한 내용 적용

# /etc/security/limits.conf 파일에서 실행되는 프로세스 수 제한

# vi /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

# /etc/pam.d/login 파일에 /lib/security/pam_limits.so 관련 내용 추가

# vi /etc/pam.d/login

-> 맨 아래 줄에 아래 내용 추가

session required /lib/security/pam_limits.so

# oracle 계정의 .bash_profile에서 환경 변수 수정

# vi /oracle/.bash_profile

export ORACLE_BASE=/oracle
export ORACLE_SID=ORCL
export ORACLE_HOME=$ORACLE_BASE/product
export PATH=$PATH:$ORACLE_HOME/bin
export DISPLAY=:0.

# 오라클 계정으로 su 후 파일 압축풀기

# su oracle

# unzip linux_11gR2_database_1of2.zip

# unzip linux_11gR2_database_2of2.zip

# chown -R oracle.dba database

# 압축을 풀면 database라는 디렉토리가 생성되고 runInstaller를 실행한다

- database 디렉토리는 ORACLE_HOME에 있어야 한다

# startx

- Xwindows로 부팅이 되면 터미널에서 runInstaller 파일을 실행

# ./runInstaller

# 오라클 자동 시작 설정

- /etc/oratab 파일에서 맨 아래 내용의 N을 Y로 변경

orcl:/oracle/11g:Y

# 리스너 파일 링크

# ln -s /oracle/product/bin/lsnrctl /usr/bin/lsnrctl

# 오라클 자동실행 스크립트

#!/bin/bash
ORA_HOME="/oracle/product"
ORA_OWNER="oracle"

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle Startup: failed"
exit 1
fi

case "$1" in
start)
echo -n "Oracle Start: "
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle
echo "OK"
;;
stop)
echo -n "ORACLE Shutdown: "
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "OK"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart"
exit 1
esac
exit 0

2011/11/14 16:25 2011/11/14 16:25

Trackback Address :: https://youngsam.net/trackback/1646