기술노트

기술노트

게시물 상세
[Linux] CentOS 7 Oracle 11gR2 설치
작성자 : 관리자(jieun@ehostidc.co.kr)  작성일 : 2018-06-22   조회수 : 4693

OS : CentOS 7.4

DB : Oracle 11gR2 (linux.x64_11gR2_database_1of2.zip,linux.x64_11gR2_database_2of2.zip)

전제 사항 : 리눅스 서버 X-windows 환경에 접속 가능 (xrdp / vnc / x-manager 등등)

 

1. oracle 설치 관련 의존성 패키지 설치

[root@ehostidc oracle]# yum install binutils elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel glibc-static.x86_64 glibc-static.i686

pdksh 관련 패키지(설치 안해도 동작은 함)

rpm -Uvh ftp://ftp.pbone.net/mirror/archive.download.redhat.com/pub/redhat/linux/7.0/en/os/i386/RedHat/RPMS/pdksh-5.2.14-8.i386.rpm --nodeps

 

 2. 커널 파라미터 설정

[root@ehostidc oracle]# vi /usr/lib/sysctl.d/00-system.conf

#해당 부분 # 처리

# Disable netfilter on bridges.
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

 

[root@ehostidc oracle]# vi /etc/sysctl.conf

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

 

커널 파라미터 적용

[root@ehostidc oracle]# sysctl -p

 

3. 그룹 및 사용자 추가 

[root@ehostidc oracle]# groupadd -g 200 oinstall

[root@ehostidc oracle]# groupadd -g 201 dba

[root@ehostidc oracle]# useradd -u 440 -g oinstall -G dba -d /home/oracle oracle

[root@ehostidc oracle]# passwd oracle

 

4. 환경 설정 파일

[root@ehostidc oracle]# vi /etc/pam.d/login

 

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

 

[root@ehostidc oracle]# vi /etc/profile

 

[root@ehostidc oracle]# vi /home/oracle/.bash_profile

export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_SID=ehost  

 

5. 폴더 생성

[root@ehostidc oracle]# mkdir /home/oracle/app
[root@ehostidc oracle]# mkdir /home/oracle/oradata

 

6. oracle DB 업로드 및 압축 해제 후 소유자 변경

[root@ehostidc oracle]# chown -R oracle:oinstall /home/oracle

 

7. oracle 계정으로 x-windows 접속

 

8. DB 설치

 

이메일 경고 무시 가능

 

 

 

 

Global database name 입력 :  oracle 변수의  SID 값

DB 패스워드 입력

 

 

 

패키지 설치 확인 후 버전 차이일 경우 ignore

 

 

설치 완료 후 root 계정에서 아래의 스크립트 실행

/home/oracle/oraInventory/orainstRoot.sh
/home/oracle/app/product/11.2.0/dbhome_1/root.sh

 

 9. 서비스 등록

[root@ehostidc oracle]# vi /etc/init.d/oracle
#!/bin/bash
#chkconfig: 2345 95 20
#description: oracle service
#processname: oracle

# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab

export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/binif [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
    echo "Oracle startup: cannot start"
    exit 1
ficase "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        sudo touch /var/lock/oracle
        echo "OK"
        ;;    stop)
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        sudo rm -f /var/lock/oracle
        echo "OK"
        ;;    reload|restart)
        $0 stop
        $0 start
        ;;    *)
        echo "Usage: `basename $0` start|stop|restart|reload"
        exit 1
esacexit 0

 

[root@ehostidc oracle]# chmod 755 /etc/init.d/oracle

[root@ehostidc oracle]# chkconfig --add oracle --level 0356

[root@ehostidc oracle]# vi /etc/oratab

ehost:/home/oracle/app/product/11.2.0/dbhome_1:Y

 

10. 서비스 확인

[root@ehostidc oracle]#  su - oracle

[oracle@ehostidc ~]$ sqlplus sys/PASS as sysdba

이전글 [Windows] 원격데스크톱 연결시 "CredSSP 암호화 Oracle 수정 때문일 수 있습니다 "오류
다음글 [Linux] 원격데스크탑으로 CentOS 6 X-Windows 환경 사용하기