[Oracle] Oracle 19c + CentOS7 사일런트(Silent) 설치

오라클을 설치할때는 2가지 방법이 있습니다. GUI에서 설치하는 방법과 백그라운드에서 설치되는 사일런트(Silent) 설치방법이 있습니다.

여기에서는 GUI 설치하는 방법을 알아봅니다.

 

 오라클 다운로드

먼저 오라클 홈페이지에서 Oracle 19c 다운로드 받습니다.

https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c

 

섹션 : 19.3 - Enterprise Edition (also includes Standard Edition 2) 

파일 : Linux x86-64

종류 : ZIP

 

 OS설정

 호스트 네임 등록

/etc/hosts 반드시 호스트이름  ip 등록합니다.

 

shell> ifconfig -a

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.10.10.110  netmask 255.255.255.0  broadcast 10.30.224.255

        inet6 fdb2:2c26:f4e4:0:ebdf:5218:4dda:fe58  prefixlen 64  scopeid 0x0<global>

        inet6 fe80::a48e:a24c:6dcb:a93b  prefixlen 64  scopeid 0x20<link>

        inet6 fe80::7181:ed8a:bd9:a640  prefixlen 64  scopeid 0x20<link>

        ether 00:1c:42:d7:dd:51  txqueuelen 1000  (Ethernet)

        RX packets 12289  bytes 10143349 (9.6 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 6253  bytes 3895390 (3.7 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

......

 

shell> vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 

10.30.224.100  ora01

 

 

 

 

■ OS설정

 호스트 네임 등록

/etc/hosts 반드시 호스트이름  IP 등록합니다.

 

shell> ifconfig -a

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.10.10.110  netmask 255.255.255.0  broadcast 10.30.224.255

        inet6 fdb2:2c26:f4e4:0:ebdf:5218:4dda:fe58  prefixlen 64  scopeid 0x0<global>

        inet6 fe80::a48e:a24c:6dcb:a93b  prefixlen 64  scopeid 0x20<link>

        inet6 fe80::7181:ed8a:bd9:a640  prefixlen 64  scopeid 0x20<link>

        ether 00:1c:42:d7:dd:51  txqueuelen 1000  (Ethernet)

        RX packets 12289  bytes 10143349 (9.6 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 6253  bytes 3895390 (3.7 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

......

 

shell> vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 

10.30.224.100  ora01

 

• selinux permissive 설정

shell> vi /etc/selinux/config

SELINUX=permissive

 

 설치 환경 구성

오라클에서 자동으로 OS 설치 환경을 셋팅해주는 RPM 제공하고 있습니다. 이전에는 하나하나 수동으로 설정을해주어야 했는데 이것을 설치하면 필수 패키지 설치  OS 커널파라미터와 자원 제한 설정을 자동으로 수정  추가를 합니다.

자동환경 설정을 해는주는 패키지 주소는 다음과 같습니다.(CentOS, RHEL 기준입니다.)

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

터미널에서 yes/no 물어볼시 y 입력합니다.

 

 수동설치

인터넷이 안되는 환경, 혹은 수동으로 패키지를 설치할때 다음 패키지들을 설치.(모두 yum으로 설치.)

bc
binutils
compat-libcap1
compat-libstdc++
elfutils-libelf
elfutils-libelf-devel
fontconfig-devel
glibc
glibc-devel
ksh
libaio
libaio-devel
libXrender
libXrender-devel
libX11
libXau
libXi
libXtst
libgcc
libstdc++
libstdc++-devel
libxcb
make
net-tools
nfs-utils
python
python-configshell
python-rtslib
python-six
targetcli
smartmontools
sysstat

 

▶︎ 자동, 수동 추가 Group  User

 자동 추가 group

- Group : oinstall, dba, oper, backupdba, dgdba, kmdba, racdba

- 확인방법

shell> cat /etc/group

oinstall:x:54321:

dba:x:54322:

oper:x:54323:

backupdba:x:54324:

dgdba:x:54325:

kmdba:x:54326:

racdba:x:54330:

위의 숫자는 시스템마다 틀릴  있습니다.

 

 수동그룹추가

shell> groupadd asmdba

 

 자동 추가 user

- 유저명 : oracle

- 확인방법

shell> cat /etc/passwd

oracle:x:54321:54321::/home/oracle:/bin/bash

위의 숫자는 시스템마다 틀릴  있습니다.

 

▶︎ 자동 커널 파라미터 추가

다음과 같은 파라미터들이 추가가 되었는지 확인합니다.

 

shell> cat /etc/sysctl.conf 

# sysctl settings are defined through files in

# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.

#

# Vendors settings live in /usr/lib/sysctl.d/.

# To override a whole file, create a new file with the same in

# /etc/sysctl.d/ and put new settings there. To override

# only specific settings, add a file with a lexically later

# name in /etc/sysctl.d/ and put new settings there.

#

# For more information, see sysctl.conf(5) and sysctl.d(5).

 

# oracle-database-preinstall-19c setting for fs.file-max is 6815744

fs.file-max = 6815744

 

# oracle-database-preinstall-19c setting for kernel.sem is '250 32000 100 128'

kernel.sem = 250 32000 100 128

 

# oracle-database-preinstall-19c setting for kernel.shmmni is 4096

kernel.shmmni = 4096

 

# oracle-database-preinstall-19c setting for kernel.shmall is 1073741824 on x86_64

kernel.shmall = 1073741824

 

# oracle-database-preinstall-19c setting for kernel.shmmax is 4398046511104 on x86_64

kernel.shmmax = 4398046511104

 

# oracle-database-preinstall-19c setting for kernel.panic_on_oops is 1 per Orabug 19212317

kernel.panic_on_oops = 1

 

# oracle-database-preinstall-19c setting for net.core.rmem_default is 262144

net.core.rmem_default = 262144

 

# oracle-database-preinstall-19c setting for net.core.rmem_max is 4194304

net.core.rmem_max = 4194304

 

# oracle-database-preinstall-19c setting for net.core.wmem_default is 262144

net.core.wmem_default = 262144

 

# oracle-database-preinstall-19c setting for net.core.wmem_max is 1048576

net.core.wmem_max = 1048576

 

# oracle-database-preinstall-19c setting for net.ipv4.conf.all.rp_filter is 2

net.ipv4.conf.all.rp_filter = 2

 

# oracle-database-preinstall-19c setting for net.ipv4.conf.default.rp_filter is 2

net.ipv4.conf.default.rp_filter = 2

 

# oracle-database-preinstall-19c setting for fs.aio-max-nr is 1048576

fs.aio-max-nr = 1048576

 

# oracle-database-preinstall-19c setting for net.ipv4.ip_local_port_range is 9000 65500

net.ipv4.ip_local_port_range = 9000 65500

 

▶︎ 자동 자원 제한 관련 설정

다음과 같은 설정들이 추가가 되었는지 확인합니다.

 

shell> cat /etc/security/limit.d/oracle-database-preinstall-19c.conf

# oracle-database-preinstall-19c setting for nofile soft limit is 1024

oracle   soft   nofile    1024

 

# oracle-database-preinstall-19c setting for nofile hard limit is 65536

oracle   hard   nofile    65536

 

# oracle-database-preinstall-19c setting for nproc soft limit is 16384

# refer orabug15971421 for more info.

oracle   soft   nproc    16384

 

# oracle-database-preinstall-19c setting for nproc hard limit is 16384

oracle   hard   nproc    16384

 

# oracle-database-preinstall-19c setting for stack soft limit is 10240KB

oracle   soft   stack    10240

 

# oracle-database-preinstall-19c setting for stack hard limit is 32768KB

oracle   hard   stack    32768

 

# oracle-database-preinstall-19c setting for memlock hard limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM

oracle   hard   memlock    134217728

 

# oracle-database-preinstall-19c setting for memlock soft limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90% of RAM

oracle   soft   memlock    134217728

 

# oracle-database-preinstall-19c setting for data soft limit is 'unlimited'

oracle   soft   data    unlimited

 

# oracle-database-preinstall-19c setting for data hard limit is 'unlimited'

oracle   hard   data    unlimited

 

 

▶︎ 오라클 계정 추가 그룹 지정

오라클 환경설정 RPM 설치  다음 명령어로 oracle 계정에 대해 모두 추가가 되도록 설정합니다.

usermod -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle

 

 

▶︎ 수동 패키지 설치

수동으로 패키지 하나를 설치합니다. 거의 대부분 설치가 되지만 아래 하나만 설치가 되지 않는듯 합니다.

아래 패키지를 설치하지 않으면 데이터베이스 생성시 에러가 납니다.

shell> yum install gcc-c++

 

▶︎ 방화벽 해제

네트워크 인터페이스 이름은 시스템별로 틀릴  있습니다.

shell> firewall-cmd --get-active-zones

public

  interfaces: eth0 

 

shell> firewall-cmd --zone=public --add-port=1521/tcp --add-port=5500/tcp --add-port=5520/tcp --add-port=3938/tcp --permanent

success

 

shell> firewall-cmd --reload

success

 

shell> firewall-cmd --list-ports

1521/tcp 5500/tcp 5520/tcp 3938/tcp

 

▶︎ 오라클 계정 환경설정

 오라클 소프트웨어 db설치 디렉토리로 이동

shell> mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1

shell> mv LINUX.X64_193000_db_home.zip /u01/app/oracle/product/19.0.0/dbhome_1

 

 소유권을 변경

shell> chown -R oracle:oinstall /u01

 

 계정 환경 설정

shell> su - oracle

shell> vi .bash_profile

 

export TMP=/tmp

export TMPDIR=$TMP

 

export ORACLE_HOSTNAME=ora01

export ORACLE_UNQNAME=oracle19

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1

export ORA_INVENTORY=/u01/app/oraInventory

export ORACLE_SID=ORCL

export DATA_DIR=/u01/app/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 NLS_LANG=KOREAN_KOREA.AL32UTF8

 

 압축 해제

unzip LINUX.X64_193000_db_home.zip

 

 

 응답파일을 이용한 사일런트 설치

응답파일을 설치하기 위해서는 3단계로 나누어서 설치를 합니다.

1. 오라클 소프트웨어를 설치합니다.

2. 리스너를 설정합니다..

3. 데이터베이스를 생성합니다.

 

 응답파일의 위치는 다음과 같습니다. 오라클 압축 파일을 풀면 다음과 같은 경로에 응답파일이 생깁니다.  응답파일의 내용을 수정합니다.

디렉토리

파일명

용도

$ORACLE_HOME/install/response

db_install.rsp

소프트웨어 설치

$ORACLE_HOME/assistants/netca

netca.rsp

리스너 생성

$ORACLE_HOME/assistants/dbca

dbca.rsp

데이타베이스 생성

 

 

▶︎ db_install.rsp 수정

오라클 소프트웨어를 설치하는 응답파일입니다. 위의 파일을 열면 여러가지 옵션을 설절할 수 있습니다. 그중에서 아래의 항목만 설정을 합니다.

다음  하나 선택 가능 : INSTALL_DB_SWONLY, INSTALL_DB_AND_CONFIG 
oracle.install.option=INSTALL_DB_SWONLY

UNIX 그룹 입력

UNIX_GROUP_NAME=oinstall

Oracle Inventory 디렉토리 위치

INVENTORY_LOCATION=/u01/app/oraInventory

 

ORACLE_HOME 디렉토리 위치
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

 

ORACLE_BASE 디렉토리 위치
ORACLE_BASE=/u01/app/oracle


데이타베이스
 설치 버전 선택 - EE :Enterprise Edition, SE2 : Standard Edition 2

oracle.install.db.InstallEdition=EE 


데이타베이스
 관리자 그룹

oracle.install.db.OSDBA_GROUP=dba

 

선택사항, 데이터베이스 운영자(OSOPER) 그룹
oracle.install.db.OSOPER_GROUP=


데이터베이스
 백업  복구(OSBACKUPDBA) 그룹

oracle.install.db.OSBACKUPDBA_GROUP=dba


Dtata Guard
관리(OSDGDBA) 그룹

oracle.install.db.OSDGDBA_GROUP=dba


암호화키
 관리(OSKMDBA)

oracle.install.db.OSKMDBA_GROUP=dba

 

Real Application Cluster 관리(OSRACDBA) 그룹
oracle.install.db.OSRACDBA_GROUP=dba


true,false 
선택,  false 경우 Manually 하게 ROOT SCRIPT 실행 

oracle.install.db.rootconfig.executeRootScript=true


ROOT, SUDO 
 선택, executeRootScript 설정값이 true  경우 선택

oracle.install.db.rootconfig.configMethod=ROOT

 

설정이 완료된 응답파일을 이용하여 오라클 소프트웨어를 설치합니다.

shell> cd $ORACLE_HOME

shell> ./runInstaller -silent -responseFile $ORACLE_HOME/install/response/db_install.rsp

Launching Oracle Database Setup Wizard...

 

 

 Enter password for 'root' user: <- root 암호 입력!!

[WARNING] [INS-13014] Target environment does not meet some optional requirements.

   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2021-01-27_06-45-41AM.log

   ACTION: Identify the list of failed prerequisite checks from the log: installActions2021-01-27_06-45-41AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.

The response file for this session can be found at:

 /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_2021-01-27_06-45-41AM.rsp

 

You can find the log of this install session at:

 /tmp/InstallActions2021-01-27_06-45-41AM/installActions2021-01-27_06-45-41AM.log

Successfully Setup Software with warning(s).

Moved the install session logs to:

 /u01/app/oraInventory/logs/InstallActions2021-01-27_06-45-41AM

 

▶︎ db_install.rsp 수정

리스너를 설정하는 응답파일입니다. 위의 파일을 열면 여러가지 옵션을 설절할 수 있습니다. 리스너는 특별히 수정할 내용은 없습니다. 내용을 한번 확인해보시고

바로 실행합니다.

shell> netca -silent -responseFile $ORACLE_HOME/assistants/netca/netca.rsp

 

Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /u01/app/oracle/product/19.0.0/dbhome_1/assistants/netca/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Oracle Net Listener Startup:

    Running Listener Control:

      /u01/app/oracle/product/19.0.0/dbhome_1/bin/lsnrctl start LISTENER

    Listener Control complete.

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

 

리스너 상태를 확인합니다.

shell> lsnrctl status;

 

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 27-1 -2021 07:02:27

 

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

 

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oradb01)(PORT=1521))) 연결되었습니다

리스너의 상태

------------------------

별칭                     LISTENER

버전                     TNSLSNR for Linux: Version 19.0.0.0.0 - Production

시작 날짜                 27-1 -2021 07:00:52

업타임                   0  0 시간. 1 . 34 

트레이스 수준            off

보안                     ON: Local OS Authentication

SNMP                     OFF리스너 매개변수 파일   /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora

리스너 로그 파일         /u01/app/oracle/diag/tnslsnr/oradb01/listener/alert/log.xml

끝점 요약 청취 ...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb01)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

리스너는 서비스를 지원하지 않습니다

명령이 성공적으로 수행되었습니다

 

 

▶︎ dbca.rsp 수정

데이터베이스를 생성하는 응답파일입니다. 위의 파일을 열면 여러가지 옵션을 설절할 수 있습니다. 그중에서 아래의 항목만 설정을 합니다.

컨테이너 DB가 아닌 일반 DB생성 방법으로 생성합니다. 만약 플러그인 DB로 설치하기를 원하면 #표시를 해둔 곳을 설정합니다.

일반 DB로 설치하기를 원한다면 #표시를 입력하지 않습니다.

Global Database Name 설정
gdbName=ORCL.GLOBAL.COM

 

데이터베이스 SID 설정

sid=ORCL

 

컨테이너 DB 생성 여부. -> 만약 컨테이너를 사용하여 플러그인 DB로 사용할 경우 YES

createAsContainerDatabase=false

 

# 생성할 플러그인 데이터베이스 (Default 0)

# numberOfPDBs=1

 

# 플러그인 데이터베이스 이름

# pdbName=ORCLPDB

 

# 플러그인 데이터베이스의 로컬 UNDO 테이블스페이스 사용(Default TRUE) 

# useLocalUndoForPDBs=TRUE

 

# PDB Administrator 사용자 패스워드

# pdbAdminPassword=*******

 

생성할 데이터베이스의 템플릿(Data_Warehouse.dbc  General_Purpose.dbc 하나)

templateName=General_Purpose.dbc

 

SYS 사용자 패스워드

sysPassword=*******

 

SYSTEM 사용자 패스워드

systemPassword=*******

 

데이타파일위치(Default :  $ORACLE_BASE/oradata )

datafileDestination=/u01/app/oradata

 

저장소 타입 설정(FS, ASM / Default : FS)

storageType=FS

 

문자셋 설정(Default US7ASCII)

characterSet=AL32UTF8

 

National CharacterSet 설정(Default AL16UTF8)

nationalCharacterSet=AL16UTF16

 

데이터베이스를 등록할 리스너 이름

listeners=LISTENER

 

데이터베이스 유형 선택(MULTIPURPOSE|DATA_WAREHOUSING|OLTP)

databaseType=MULTIPURPOSE

 

샘플스키마 설치 여부 (Default False)

sampleSchema=TRUE

 

데이타베이스에 사용될 메모리, MB 단위 ->  설정하고자 하는 메모리 크기를 입력합니다.

totalMemory=4096

 

데이타베이스 생성

참고로 암호를 단순히 지정하면 아래와 같은 경고와 이유가 나옵니다. 기본적으로 암호는 8자 이상의 대소문자, 특수문자, 숫자를 포함해야 합니다.

shell> dbca -silent -createDatabase -responsefile $ORACLE_HOME/assistants/dbca/dbca.rsp

[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.

   CAUSE:

a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

b.The password entered is a keyword that Oracle does not recommend to be used as password

   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.

[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.

   CAUSE:

a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

b.The password entered is a keyword that Oracle does not recommend to be used as password

   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.

Prepare for db operation

10% complete

Copying database files

40% complete

Creating and starting Oracle instance

42% complete

46% complete

50% complete

54% complete

58% complete

60% complete

Completing Database Creation

66% complete

69% complete

70% complete

Executing Post Configuration Actions

100% complete

Database creation complete. For details check the logfiles at:

 /u01/app/oracle/cfgtoollogs/dbca/ORCL.

Database Information:

Global Database Name:ORCL.GLOBAL.COM

System Identifier(SID):ORCL

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.

 

 

데이터베이스 삭제 방법

[oracle@oradb01 dbca]$ dbca -silent -deleteDatabase -sourceDB ORCL

Enter SYS user password:

 

[WARNING] [DBT-19202] The Database Configuration Assistant will delete the Oracle instances and datafiles for your database. All information in the database will be destroyed.

Prepare for db operation

32% complete

Connecting to database

35% complete

39% complete

42% complete

45% complete

48% complete

52% complete

65% complete

Updating network configuration files

68% complete

Deleting instance and datafiles

84% complete

100% complete

Database deletion completed.

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL0.log" for further details.

'Databases > Oracle' 카테고리의 다른 글

[Oracle] Oracle 19c + CentOS7 설치(GUI)  (0) 2021.01.27
[Oracle] Index Contention  (0) 2020.10.01
[Oracle] Index Contention  (0) 2020.09.07

Designed by JB FACTORY