Immersion In Data

Oracle

[Oracle Linux 7.7] Oracle 19c 설치(GUI)

sungjunminn 2023. 6. 1. 15:28

OS 환경 : Oracle Linux 7.7 (64bit)

DB 환경 : Oracle Database 19.7.0.0

 

1. 사전 확인 사항

https://www.oracle.com/kr/database/technologies/oracle19c-linux-downloads.html

 

Oracle Database 19c Download for Linux x86-64 | Oracle 대한민국

Oracle Database 19c Grid Infrastructure (19.3) for Linux x86-64 Contains the Grid Infrastructure Software including Oracle Clusterware, Automated Storage Management (ASM), and ASM Cluster File System. Download and install prior to installing Oracle Real Ap

www.oracle.com

위 링크로 접속하여 LINUX.X64_193000_db_home.zip 파일을 다운 받습니다. 

 

  • /etc/hosts 설정
# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.137.50 oel7  --추가

 

  • /etc/hostname 확인
# vi /etc/hostname
oel7

 

 

2. 설치 전 사전 설정

  • network 자동 설정
# yum -y install oracle-database-preinstall-19c

 

 

  • /etc/sysctl.conf에 내용 추가(자동 설정 후 수동 설정 파일 확인)
# vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

 

  • 잘 입력되었는지 확인
# /sbin/sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

 

  • oracle-database-preinstall-19c.conf 파일 생성 후 내용 추가
# vi /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

 

  • 유저 및 그룹 수정
# usermod -g dba -G dba oracle

 

  • 패스워드 설정
# passwd oracle

 

  • selinux permissive 설정
# vi /etc/selinux/config
SELINUX=permissive

 

  • 방화벽 해제
# systemctl stop firewalld
# systemctl disable firewalld

 

  • 설치 경로 생성
# mkdir -p /ORA19/app/oracle/product/19.0.0/db_1/
# mkdir -p /ORA19/app/oradata
# chown -R oracle:oinstall /ORA19
# chmod -R 775 /ORA19

 

  • 서버의 /ORA19/app/oracle/product/19.0.0/db_1/ 경로에 Oracle Database 설치 미디어 업로드 후 권한 부여
# ls -al /ORA19/app/oracle/product/19.0.0/db_1/
-rw-r--r--.  1 oracle oinstall 3059705302 May 26 15:24 LINUX.X64_193000_db_home.zip
# chown oracle:oinstall LINUX.X64_193000_db_home.zip

 

  • oracle 유저로 접속 후 .bash_profile에 아래 내용 추가 
# su - oracle
$ vi .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=oel7
export ORACLE_UNQNAME=oracle19
export ORACLE_BASE=/ORA19/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1
export ORA_INVENTORY=/ORA19/oraInventory
export ORACLE_SID=oracle19
export DATA_DIR=/ORA19/app/oradata
export PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin:/sbin:/usr/ccs/bin:/usr/ucb:$ORACLE_HOME/OPatch:$GRID_HOME/bin

 

  • .bash_profile 적용
source /home/oracle/.bash_profile
echo /home/oracle/.bash_profile

 

  • 오라클 설치 파일 압축 해제
$ cd $ORACLE_HOME
$ unzip LINUX.X64_193000_db_home.zip

 

 

3. Oracle Software 설치

※ vmware 로그아웃 - 설치하려고 하는 유저(oracle)로 재 로그인 

  • 오라클 설치
$ ./runInstaller

 

  • Set Up Software Only 선택

 

  • Single instance database installation 선택

 

  • Enterprise Edition 선택

 

  • Oracle base 경로 설정

 

  • oraInventory 경로 선택

 

  • 그룹 권한 선택

 

  • ./runInstaller 실행 후 자동으로 root 스크립트 실행을 위한 root 패스워드 입력 

 

  • Install 선택

 

  • 설치 중

 

  • root 스크립트를 돌리기 전 확인 경고 메시지 Yes 선택

 

  • db 소프트웨어 설치 완료 Close 선택

 

리스너 설정

cd $ORACLE_HOME
cd bin
./netca

 

  • Listener configuration 선택

 

  • Add 선택

 

  • 리스너 이름 설정

 

  • 프로토콜 설정

 

  • Use the standard port number of 1521 선택

 

  • No 선택

 

  • 리스너 설정 완료

 

  • Finish 선택

 

OPatch 최신 파일 업로드

  • 기존 OPatch 버전 확인
$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.17
 
OPatch succeeded.

 

  • 최신 OPatch 파일 업로드(/app/media 경로에 p6880880_190000_Linux-x86-64.zip 미디어 업로드)

https://support.oracle.com/knowledge/Oracle%20Database%20Products/274526_1.html

 

How To Download And Install The Latest OPatch(6880880) Version

 

support.oracle.com

 

$ su - oracle
$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_old
$ unzip /app/media/p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME/
$ ls -al $ORACLE_HOME | grep OPatch
drwxr-x---  14 oracle dba       4096 Apr 19 00:43 OPatch
drwxr-x---. 14 oracle dba       4096 Jun  1 23:34 OPatch_old

 

  • OPatch 버전 확인
$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.37
 
OPatch succeeded.

 

DB 업데이트 

  • 기존 패치 내역 확인
$ $ORACLE_HOME/OPatch/opatch lspatches -oh $ORACLE_HOME
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)
 
OPatch succeeded.

OCW와 DB 업데이트가 있음

 

  • OPatch 패치 파일 다운로드 후 압축 풀기(/app/media 경로에 p33806152_190000_Linux-x86-64.zip 미디어 업로드)
mkdir $ORACLE_HOME/patch
unzip /app/media/p33806152_190000_Linux-x86-64.zip -d $ORACLE_HOME/patch

 

  • DB 업데이트 폴더로 이동 후 OPatch apply 실행
$ cd $ORACLE_HOME/patch/33806152
$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.37
Copyright (c) 2023, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /app/oracle/product/19/db_1
Central Inventory : /app/oraInventory
   from           : /app/oracle/product/19/db_1/oraInst.loc
OPatch version    : 12.2.0.1.37
OUI version       : 12.2.0.7.0
Log file location : /app/oracle/product/19/db_1/cfgtoollogs/opatch/opatch2020-04-24_00-08-12AM_1.log
 
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   30869156  
 
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
 
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/app/oracle/product/19/db_1')
 
 
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '30869156' to OH '/app/oracle/product/19/db_1'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.oraolap.mgmt, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.options.olap.awm, 19.0.0.0.0 ] , [ oracle.sqlj, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.assistants.asm, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.xdk.parser.java.jaxb2, 19.0.0.0.0 ] , [ oracle.assistants.usm, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the Oracle Home or a higher version is found.
 
Patching component oracle.rdbms.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms, 19.0.0.0.0...
 
Patching component oracle.rdbms.util, 19.0.0.0.0...
 
Patching component oracle.assistants.acf, 19.0.0.0.0...
 
Patching component oracle.assistants.deconfig, 19.0.0.0.0...
 
Patching component oracle.assistants.server, 19.0.0.0.0...
 
Patching component oracle.buildtools.rsf, 19.0.0.0.0...
 
Patching component oracle.ctx, 19.0.0.0.0...
 
Patching component oracle.ldap.rsf, 19.0.0.0.0...
 
Patching component oracle.network.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...
 
Patching component oracle.sdo, 19.0.0.0.0...
 
Patching component oracle.sqlplus, 19.0.0.0.0...
 
Patching component oracle.dbjava.ic, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...
 
Patching component oracle.dbjava.jdbc, 19.0.0.0.0...
 
Patching component oracle.dbdev, 19.0.0.0.0...
 
Patching component oracle.network.client, 19.0.0.0.0...
 
Patching component oracle.xdk.parser.java, 19.0.0.0.0...
 
Patching component oracle.rdbms.deconfig, 19.0.0.0.0...
 
Patching component oracle.oracore.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.lbac, 19.0.0.0.0...
 
Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.ldap.security.osdt, 19.0.0.0.0...
 
Patching component oracle.ons, 19.0.0.0.0...
 
Patching component oracle.sdo.locator, 19.0.0.0.0...
 
Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...
 
Patching component oracle.marvel, 19.0.0.0.0...
 
Patching component oracle.rdbms.install.common, 19.0.0.0.0...
 
Patching component oracle.install.deinstalltool, 19.0.0.0.0...
 
Patching component oracle.xdk.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.oci, 19.0.0.0.0...
 
Patching component oracle.rdbms.drdaas, 19.0.0.0.0...
 
Patching component oracle.precomp.rsf, 19.0.0.0.0...
 
Patching component oracle.javavm.client, 19.0.0.0.0...
 
Patching component oracle.precomp.common.core, 19.0.0.0.0...
 
Patching component oracle.xdk, 19.0.0.0.0...
 
Patching component oracle.sqlplus.ic, 19.0.0.0.0...
 
Patching component oracle.odbc, 19.0.0.0.0...
 
Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...
 
Patching component oracle.ldap.owm, 19.0.0.0.0...
 
Patching component oracle.bali.ice, 11.1.1.7.0...
 
Patching component oracle.ctx.rsf, 19.0.0.0.0...
 
Patching component oracle.ovm, 19.0.0.0.0...
 
Patching component oracle.rdbms.rman, 19.0.0.0.0...
 
Patching component oracle.dbjava.ucp, 19.0.0.0.0...
 
Patching component oracle.rdbms.dv, 19.0.0.0.0...
 
Patching component oracle.duma, 19.0.0.0.0...
 
Patching component oracle.network.listener, 19.0.0.0.0...
 
Patching component oracle.oraolap, 19.0.0.0.0...
 
Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...
 
Patching component oracle.rdbms.scheduler, 19.0.0.0.0...
 
Patching component oracle.rdbms.crs, 19.0.0.0.0...
 
Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.precomp.common, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.core, 19.0.0.0.0...
 
Patching component oracle.perlint, 5.28.1.0.0...
 
Patching component oracle.precomp.lang, 19.0.0.0.0...
 
Patching component oracle.jdk, 1.8.0.201.0...
Patch 30869156 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [30869156].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /app/oracle/product/19/db_1/cfgtoollogs/opatch/opatch2020-04-24_00-08-12AM_1.log
 
OPatch succeeded.

 

  • 업데이트 결과 확인
$ $ORACLE_HOME/OPatch/opatch lspatches -oh $ORACLE_HOME
30869156;Database Release Update : 19.15.0.0.200419 (33806152)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
 
OPatch succeeded.

 

 

db 생성

  • db 생성
$ dbca

 

 

  • dbca 실행
cd $ORACLE_HOME
cd bin
./dbca

 

  • Create a database 선택

 

  • Advanced configuration 선택

 

  • Custom Database 선택

 

  • oracle SID 입력

 

  • Use following for the database storage attributes 선택

 

  • Next 선택

 

  • 리스너 선택(리스너가 Down 되어 있다면 기동시켜줌)

 

  • 모두 체크 해제

 

  • Next 선택

 

  • Choose from the list of character sets는 KO16MSWIN949 선택

 

  • Connection mode는 Dedicated server mode 선택

 

  • Sample schemas는 선택 안함

 

  • EM 체크 해제

 

  • sys 계정 패스워드 설정

 

  • Create database 선택

 

  • Finish 선택

 

  • db 인스턴스 생성중

 

  • db 인스턴스 생성 완료

 

  • db 설치 후 확인
$ cd $ORACLE_HOME/bin
$ ./sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 1 15:24:45 2023
Version 19.15.0.0.0
 
Copyright (c) 1982, 2022, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.15.0.0.0

SQL> select instance_name, version, status from v$instance;
 
INSTANCE_NAME     VERSION       STATUS
---------------- ----------------- ------------
oracle19         19.0.0.0.0       OPEN