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
version: '3.8'
services:
oracle19c:
build: ./
privileged: true
hostname: oracle19c
command:
- /usr/sbin/init
networks:
- oracle19c_net
networks:
oracle19c_net:
name: oracle19c_net
dnf install oracle-database-preinstall-19c
해당 파일은 oracle.com에서 다운 받아야 함.
dnf install oracle-database-ee-19c-1.0-1.x86_64.rpm
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
ORCLCDB 데이터베이스가 설치 됨.
/etc/init.d/oracledb_ORCLCDB-19c configure
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
sqlplus / as sysdba
여기서 패스워드를 물어보거나 기타 문제가 발생하는 경우 oracle 계정이 아니거나 환경변수 설정에 문제가 있는 경우가 대부분임.
dbstart $ORACLE_HOME
만약 여기서 log의 권한 문제가 생기면 log 파일의 소유자가 oracle이 아닌 경우가 대부분임.
로그 파일을 삭제하고 log파일을 oracle 소유자로 생성.