ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Centos8 오라클설치하기
    리눅스(CentOS 8) 2021. 3. 17. 22:29

    root 로 로그인

     

    호스트네임 변경

     

    1) [root@localhost ~]# hostnamectl set-hostname orcl19c

     

     

    2) vi /etc/hosts 로 서버 정보 추가

     

    3) 오라클 설치전 사전설정하기

    스크린샷에서 보듯이 Oracle19c를 설치 하려면 #oracle-database-preinstall-19c 패키지를 설치해야 한다.

    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

    위와 같이 Oracle Linux의 Repository에 존재하는 RPM을 yum을 이용하여 설치해 주면 되는데,

    Oracle Linux에서는 큰 문제 없이 설치가 되지만 CentOS에서는 compat-libca1, compat-libstdc++-33 패키지 누락 오류가 발생한다.

    해당 패키지들은 RHEL8에서 제거가 되었으나 RHEL7 및CentOS7에는 여전히 존재하기 때문에 이를 설치해주면 된다.

    yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
    yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.rpm

    위의 명령을 통해 해당 패키지들을 설치 후 다시 oracle-database-preinstall을 설치하면 정상적으로 설치가 진행된다.

    그 후 다운받은 Oracle19c RPM 파일의 설치를 진행해주면 된다.

     

    오라클 preinstall 패키지가 쭉 설치된다.

    /etc/sysctl.conf에 아래 내용 추가내용확인(자동세팅) preinstall시

     

     

    4) 아래 파일 생성 후 내용 추가확인

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

    rpm 설치용 쉘파일 생성

     

    # vi rpm.sh

    dnf install -y bc    

    dnf install -y binutils

    #dnf install -y compat-libcap1

    dnf install -y compat-libstdc++-33

    #dnf install -y dtrace-modules

    #dnf install -y dtrace-modules-headers

    #dnf install -y dtrace-modules-provider-headers

    #dnf install -y dtrace-utils

    dnf install -y elfutils-libelf

    dnf install -y elfutils-libelf-devel

    dnf install -y fontconfig-devel

    dnf install -y glibc

    dnf install -y glibc-devel

    dnf install -y ksh

    dnf install -y libaio

    dnf install -y libaio-devel

    #dnf install -y libdtrace-ctf-devel

    dnf install -y libXrender

    dnf install -y libXrender-devel

    dnf install -y libX11

    dnf install -y libXau

    dnf install -y libXi

    dnf install -y libXtst

    dnf install -y libgcc

    dnf install -y librdmacm-devel

    dnf install -y libstdc++

    dnf install -y libstdc++-devel

    dnf install -y libxcb

    dnf install -y make

    dnf install -y net-tools # Clusterware

    dnf install -y nfs-utils # ACFS

    dnf install -y python # ACFS

    dnf install -y python-configshell # ACFS

    dnf install -y python-rtslib # ACFS

    dnf install -y python-six # ACFS

    dnf install -y targetcli # ACFS

    dnf install -y smartmontools

    dnf install -y sysstat

    dnf install -y unixODBC

     

    # New for OL8

    dnf install -y libnsl

    dnf install -y libnsl.i686

    dnf install -y libnsl2

    dnf install -y libnsl2.i686

     

    쉘실행!!

     

    # sh rpm.sh

    2) vi /etc/selinux/config 로 SELinux 설정 변경

    # vi /etc/selinux/config

    SELINUX=disabled




     

    3) yum update

    사용하지 않는 서비스 끄기

    # systemctl stop firewalld

    # systemctl disable firewalld

     

    방화벽을 사용할 경우!!!!!

     

    Allow Oracle SQL* Net Listener port 1521/tcp in CentOS 8 Firewall.

    [root@oracle-db-19c ~]# firewall-cmd --permanent --add-port=1521/tcp success

    [root@oracle-db-19c ~]# firewall-cmd --reload success

    Create Users and Groups for Oracle Database 19c:

    [root@centos8 ~]# groupadd -g 1501 oinstall
    [root@centos8 ~]# groupadd -g 1502 dba
    [root@centos8 ~]# groupadd -g 1503 oper
    [root@centos8 ~]# groupadd -g 1504 backupdba
    [root@centos8 ~]# groupadd -g 1505 dgdba
    [root@centos8 ~]# groupadd -g 1506 kmdba
    [root@centos8 ~]# groupadd -g 1507 racdba
    [root@centos8 ~]#  useradd -u 1501 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle
    [root@centos8 ~]# echo "oracle" | passwd oracle --stdin
    oracle 사용자의 비밀 번호 변경 중
    passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
    [root@centos8 ~]# 

     

     

    Create 30-oracle.conf configuration file in /etc/security/limits.d directory, to set the security limits for the oracle user.

     

    [root@oracle-db-19c ~]# vi /etc/security/limits.d/30-oracle.conf

    And add following directives therein.

    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

     

     

     

     

    Reload Kernel parameters now by using sysctl command.

    [root@oracle-db-19c ~]# sysctl -p

     

     

     

     

    Create Directories for Oracle Database 19c:

    o install Oracle Database 19c software, create the necessary directories and adjust the ownership and permissions on these directories.

     

    [root@oracle-db-19c ~]# mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1

    [root@oracle-db-19c ~]# mkdir -p /u02/oradata

    [root@oracle-db-19c ~]# chown -R oracle:oinstall /u01 /u02

    [root@oracle-db-19c ~]# chmod -R 775 /u01 /u02

     

     

    Configure Linux Environment for Oracle User:

    Connect as oracle user.

    [root@oracle-db-19c ~]# su - oracle

    [oracle@oracle-db-19c ~]$

    Edit oracle user's .bash_profile.

    [oracle@oracle-db-19c ~]$ vi ~/.bash_profile

     

    해당파일에 다음내용을 추가한다.

    # Oracle Settings

    export TMP=/tmp

    export TMPDIR=$TMP

    export ORACLE_HOSTNAME=oracle-db-19c.centlinux.com

    export ORACLE_UNQNAME=cdb1

    export ORACLE_BASE=/u01/app/oracle

    export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1

    export ORA_INVENTORY=/u01/app/oraInventory

    export ORACLE_SID=cdb1

    export PDB_NAME=pdb1

    export DATA_DIR=/u02/oradata

    export PATH=$ORACLE_HOME/bin:$PATH

    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

    export DISPLAY=192.168.119.1:0.0

    Execute .bash_profile to set environment for the current session.

    [oracle@oracle-db-19c ~]$ source ~/.bash_profile

     

     

     

    CentOS 8 에 Oracle Database 19c 설치

    오라클 zip 파일을 oracle폴더로 복사

     

     

    ORACLE_HOME directory로 다운로드된 zip파일을 푼다.

    [oracle@oracle-db-19c ~]$ unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME

     

     

    Oracle Database 19c installer have problems detecting CentOS 8 operating system, however, we can workaround it, by setting an environment variable before starting installation.

     

    [oracle@oracle-db-19c ~]$ export CV_ASSUME_DISTID=RHEL8.0

     

    Go to ORACLE_HOME directory and start installation.

     

    [oracle@oracle-db-19c ~]$ cd $ORACLE_HOME

    [oracle@oracle-db-19c dbhome_1]$ ./runInstaller

     

    오라클 홈 디렉토리

     

     

    에러발생

    x-display가 필요하다고한다.

     

    설치시 한글꺠짐될때 아래명령어 실행한다.

    export LANG=C

    export LC_ALL=C

     

Designed by Tistory.