반응형

CentOS 8 Oracle 19c rpm 설치 

 

1. Oracle 19c RPM 다운

2. CentOS 8 라이브러리 추가

3. Oracle 19c RPM 설치 

4. Oracle 설정 

 

 

1. Oracle 19c RPM 다운로드

www.oracle.com/database/technologies/oracle-database-software-downloads.html

oracle-database-preinstall-19c 다운로드 링크 및 리눅스 다운로드 

https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

 

 

yum install -y https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

 

다운로드 후 리눅스 업로드 시 mkdir -p /usr/local/setting 후 /usr/local/setting 경로로 업로드

 

2. 오라클 설치 관련 라이브러리 추가 

### libnsl so so 파일을 읽을 수 있도록 동적 라이브러리 추가 

 

yum -y install libnsl

### GCC 라이브러리 

yum -y install compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel

### GNU 라이브러리

yum -y install glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel

### 비동기 I/O 관련 libaio 라이브러리

yum -y install libaio libgcc libstdc++ libstdc++ make sysstat unixODBC unixODBC-devel

 

3. 오라클 설치 (파일 2개) (/usr/local/setting 경로) 

  3.1  oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

        yum -y install oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

 

        설치 전 파일 검증

        sha256sum  oracle-database-ee-19c-1.0-1.x86_64.rpm

 

오라클 다운로드 페이지 (See All 한뒤 sha256sum 확인 가능)

 

 

  3.2  oracle-database-ee-19c-1.0-1.x86_64.rpm

        yum -y install oracle-database-ee-19c-1.0-1.x86_64.rpm

 

 

 

 

preinstall 설정 파일 생성

#cat /etc/security/limits.d/oracle-database-preinstall-19c.conf

oracle   soft   nofile    1024

oracle   hard   nofile    65536

oracle   soft   nproc    16384

oracle   hard   nproc    16384

oracle   soft   stack    10240

oracle   hard   stack    32768

oracle   hard   memlock    134217728

oracle   soft   memlock    134217728


계정 수동 생성

# groupadd dba

# useradd -g dba -G dba oracle

계정 자동 생성

# usermod -g dba -G dba oracle 

계정 패스워드 설정

# passwd oracle

 

selinux disable 설정

# vi /etc/selinux/config

SELINUX=disabled

 

임시 방화벽 사용 안함

systemctl stop firewalld

systemctl disable firewalld

 

Oracle DB 생성 및 구성

/etc/init.d/oracledb_ORCLCDB-19c configure

 

# vi /etc/sysconfig/oracledb_ORCLCDB-19c.conf

 

#This is a configuration file to setup the Oracle Database. 

#It is used when running '/etc/init.d/oracledb_ORCLCDB configure'.

#Please use this file to modify the default listener port and the

#Oracle data location.

 

# LISTENER_PORT: Database listener

LISTENER_PORT=1521

 

# ORACLE_DATA_LOCATION: Database oradata location

ORACLE_DATA_LOCATION=/opt/oracle/oradata

 

# EM_EXPRESS_PORT: Oracle EM Express listener

EM_EXPRESS_PORT=5500

 

 

oracle 계정 .bash_profile 설정

 

# su - oracle

$ vi .bash_profile 

export TMP=/tmp;

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1

export ORACLE_SID=ORCLCDB

export PATH=$PATH:$ORACLE_HOME/bin

alias ss='sqlplus / as sysdba'

 

bash_profile 적용

./.bash_profile

 

오라클 DB 접속 확인

sqlplus / as sysdba

 

 

반응형

서비스 파일 경로

/etc/init.d

 

서비스 등록할 파일 생성

vi xxxxx

 

서비스 등록

#!/bin/bash
#
# tomcat
#
# chkconfig: 345 96 30
# description:  Start up the Tomcat servlet engine.
#
# processname: java
# pidfile: /var/run/tomcat.pid
#
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Should-Start: distcache
# Short-Description: start and stop Apache HTTP Server
# Description: implementation for Servlet 2.5 and JSP 2.1
## END INIT INFO
 
# Source function library.
. /etc/init.d/functions
 
## tomcat installation directory

##프로세스 명
PROCESS_NAME=tomcat

## 등록할 서비스 경로
CATALINA_HOME="/usr/local/usr/tomcat/"
 
## run as a diffent user
#TOMCAT_USER=root
 
##  Path to the pid, runnning info file
pidfile=${PIDFILE-/var/run/${PROCESS_NAME}.pid};
lockfile=${LOCKFILE-/var/lock/subsys/${PROCESS_NAME}};
 
RETVAL=0
 
case "$1" in
 start)
        PID=`pidofproc -p ${pidfile} ${PROCESS_NAME}`
        if [[ (-n ${PID}) && ($PID -gt 0) ]]; then
                logger -s "${PROCESS_NAME}(pid ${PID}) is  already running."
                exit;
        fi
        if [ -f $CATALINA_HOME/bin/startup.sh ];
          then
            logger -s "Starting Tomcat"
            /bin/su -l ${TOMCAT_USER} -c "$CATALINA_HOME/bin/startup.sh -Dprocessname=${PROCESS_NAME}"
            PID=`ps -eaf|grep processname=${PROCESS_NAME}|grep -v grep|awk '{print $2}'`
            RETVAL=$?
            [ $RETVAL = 0 ] && touch ${lockfile}
            [ $RETVAL = 0 ] && echo "${PID}" > ${pidfile}
        fi
        ;;
 stop)
        PID=`pidofproc -p ${pidfile} ${PROCESS_NAME}`
        ## if PID valid run shutdown.sh
        if [[ -z ${PID} ]];then
            logger -s "${PROCESS_NAME} is not running."
            exit;
        fi
 
        if [[ (${PID} -gt 0) && (-f $CATALINA_HOME/bin/shutdown.sh) ]];
          then
            logger -s "Stopping Tomcat"
            /bin/su -l ${TOMCAT_USER} -c "$CATALINA_HOME/bin/shutdown.sh"
            RETVAL=$?
            [ $RETVAL = 0 ] && rm -f ${lockfile}
            [ $RETVAL = 0 ] && rm -f ${pidfile}
        fi
        ;;
 status)
        status -p ${pidfile} ${PROCESS_NAME}
        RETVAL=$?
        ;;
 restart)
         $0 stop
         $0 start
         ;;
version)
        if [ -f $CATALINA_HOME/bin/version.sh ];
          then
            logger -s "Display Tomcat Version"
            /bin/su -l ${TOMCAT_USER} -c "$CATALINA_HOME/bin/version.sh"
            RETVAL=$?
        fi
        ;;
 *)
         echo $"Usage: $0 {start|stop|restart|status|version}"
        exit 1
        ;;
esac
exit $RETVAL

 

 

 

#서비스 명령어

#서비스 등록

service xxxxx start

#서비스 재시작

service xxxxx restart

#서비스 중지

service xxxxx stop

#서비스 변경

service xxxxx reload

#서비스 상태

service xxxxx status

#서비스 자동시작 활성화

chkconfig xxxxx on

#서비스 자동시작 비활성화

chkconfig sshd off

#서비스 자동시작 활성화 여부

chkconfig --list xxxxx

'Linux' 카테고리의 다른 글

Linux 7.x 서비스 등록  (0) 2019.12.30
WAS & APACHE & open PORT  (0) 2019.11.22
포트 및 방화벽  (0) 2018.07.09
리눅스 find 명령어  (0) 2018.07.09
반응형

서비스 파일 경로 

/usr/lib/systemd/system

 

서비스 등록할 파일 생성

vi xxxx.service 

 

서비스 등록

[Unit]
Description=kpta_client
After=network.target syslog.target

[Service]
Type=forking
#자바 설치 경로 
Environment="JAVA_HOME=/usr/local/java/jdk1.8.0_111/"

#유저 계정/그룹 계정 
User=root
Group=root

UMask=0007
RestartSec=10
Restart=always

SuccessExitStatus=143
#Start/Shutdown Shell 파일 경로
ExecStart=/usr/local/src/tomcat/bin/startup.sh
ExecStop=/usr/local/src/tomcat/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

 

 

 

서비스 등록 명령어

#서비스 파일 명

 

#서비스 활성화(부팅시 자동 구동)

systemctl enable center.service 

#서비스 비활성화

systemctl disable center.service 

#서비스 활성화 여부

systemctl status xxxxxx.service

#서비스 시작

systemctl start xxxxxx.service

#서비스 중지

systemctl stop xxxxxx.service

#서비스 재구동

systemctl reload xxxxxx.service

 

#서비스 자동 활성화 여부

systemctl is-enabled xxxxx

 

#프로세스 확인

ps -ef | grep xxxxx

 

 

 

 

 

 

'Linux' 카테고리의 다른 글

Linux 6.x 서비스 등록  (0) 2019.12.30
WAS & APACHE & open PORT  (0) 2019.11.22
포트 및 방화벽  (0) 2018.07.09
리눅스 find 명령어  (0) 2018.07.09
반응형

WAS
find / -name catalina.sh
APACHE
service httpd status
사용중인 PORT
netstat -tnlp

'Linux' 카테고리의 다른 글

Linux 6.x 서비스 등록  (0) 2019.12.30
Linux 7.x 서비스 등록  (0) 2019.12.30
포트 및 방화벽  (0) 2018.07.09
리눅스 find 명령어  (0) 2018.07.09
반응형


포트 개방

iptables -I INPUT 1 -p tcp --dport 8088 -j ACCEPT 

iptables -I OUTPUT 1 -p tcp --dport 8088 -j ACCEPT 


방화벽 해제

service iptables stop

'Linux' 카테고리의 다른 글

Linux 6.x 서비스 등록  (0) 2019.12.30
Linux 7.x 서비스 등록  (0) 2019.12.30
WAS & APACHE & open PORT  (0) 2019.11.22
리눅스 find 명령어  (0) 2018.07.09
반응형


find / -name '[폴더명]' -type d 


find / -name '[폴더명]*' 


[폴더명]이 들어간 전체 폴더 조회

'Linux' 카테고리의 다른 글

Linux 6.x 서비스 등록  (0) 2019.12.30
Linux 7.x 서비스 등록  (0) 2019.12.30
WAS & APACHE & open PORT  (0) 2019.11.22
포트 및 방화벽  (0) 2018.07.09

+ Recent posts