oraclelinux docker oracle 19c 설치

catchv·2021년 10월 13일
0

oracle 19c

목록 보기
1/1

1. docker 설치

dockerfile

FROM oraclelinux:8.4
RUN dnf -y update
RUN dnf -y install net-tools
RUN dnf -y install telnet
RUN dnf -y install wget
RUN dnf -y update
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

docker-compose.yml

version: '3.8'

services:

    oracle19c:
        build: ./
        privileged: true
        hostname: oracle19c
        command:
          - /usr/sbin/init
        networks:
          - oracle19c_net

networks:
  oracle19c_net:
    name: oracle19c_net

2. oracle 설치

oracle 사전 설치 프로그램 설치

dnf install oracle-database-preinstall-19c

oracle 데이터베이스 설치

해당 파일은 oracle.com에서 다운 받아야 함.

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

config 확인

cat /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 구성

ORCLCDB 데이터베이스가 설치 됨.

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

oracle 계정에서만 접속 및 서버시작이 가능

su - oracle

profile에 환경변수 설정(파일 맨 마지막에 추가)

vi ~/.bash_profile
\# 파일 마지막에 추가
umask 022
export ORACLE_SID=ORCLCDB
export ORACLE_BASE=/opt/oracle/oradata
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin

수정된 profile을 적용

source ~/.bash_profile

접속 가능한지 sysdba로 접속

sqlplus / as sysdba

여기서 패스워드를 물어보거나 기타 문제가 발생하는 경우 oracle 계정이 아니거나 환경변수 설정에 문제가 있는 경우가 대부분임.

서버 시작

dbstart $ORACLE_HOME

만약 여기서 log의 권한 문제가 생기면 log 파일의 소유자가 oracle이 아닌 경우가 대부분임.
로그 파일을 삭제하고 log파일을 oracle 소유자로 생성.

0개의 댓글