NeoKylin V7 서버에 Oracle 12c R2 Standalone 자동화 설치 및 패치 적용 가이드

개요

본 가이드는 NeoKylin Linux Advanced Server V7 환경에서 Oracle Database 12c Release 2 (12.2.0.1) Standalone 버전을 자동화 스크립트를 통해 무인 설치하는 방법을 설명합니다. 해당 스크립트는 기본 데이터베이스 설치뿐만 아니라 최신 PSU(Patch Set Update) 및 OJVM(Oracle Java Virtual Machine) 패치까지 자동으로 적용하여 보안과 안정성을 확보합니다.

사전 준비 사항

  • NeoKylin V7 운영체제 설치 완료 (GUI 환경 권장)
  • 네트워크 인터페이스 및 IP 할당 설정
  • 로컬 ISO 이미지 마운트를 통한 YUM 저장소 구성
  • Oracle 설치 소스 파일 및 최신 패치 아카이브 업로드
  • 자동화 배포 스크립트(OraAutoDeploy.sh) 준비

환경 정보 확인

설치를 진행하기 전, 현재 서버의 운영체제 버전, 네트워크 설정, 그리고 설치 미디어 및 패치 파일이 올바르게 위치해 있는지 확인합니다.

# 운영체제 버전 확인
[root@nk-server ~]# cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME="NeoKylin Linux Advanced Server V7 (Stahl)"

# 네트워크 인터페이스 확인
[root@nk-server ~]# ip -4 addr show ens160
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    inet 10.0.1.55/24 brd 10.0.1.255 scope global noprefixroute ens160

# 로컬 ISO 마운트 및 용량 확인
[root@nk-server ~]# df -hT /mnt
Filesystem     Type    Size  Used Avail Use% Mounted on
/dev/sr0       iso9660 4.2G  4.2G     0 100% /mnt

# 설치본 및 패치 파일 디렉토리 확인
[root@nk-server ~]# ls -lh /opt/ora_sw/
total 2.4G
-rwxr-xr-x 1 root root 1.2G Jan 10 09:00 LINUX.X64_122010_db_home.zip
-rwxr-xr-x 1 root root  12M Jan 10 09:00 p35926712_122010_Linux-x86-64.zip
-rwxr-xr-x 1 root root 1.1G Jan 10 09:00 p35966787_122010_Linux-x86-64.zip
-rwxr-xr-x 1 root root  45K Jan 10 09:00 OraAutoDeploy.sh

자동화 설치 스크립트 실행

미리 정의된 파라미터를 사용하여 자동화 스크립트를 실행합니다. 아래 명령어는 네트워크 인터페이스, 호스트명, 데이터베이스 이름, 문자 집합, 그리고 적용할 패치 번호 등을 인자로 전달합니다.

[root@nk-server ~]# cd /opt/ora_sw/
[root@nk-server ora_sw]# ./OraAutoDeploy.sh \
  --iface ens160 \
  --host nk-server \
  --ora-user oracle \
  --base-dir /u01/app \
  --data-dir /oradata \
  --db-name orcl \
  --sys-pass Welcome1 \
  --charset AL32UTF8 \
  --ncharset AL16UTF16 \
  --redo-size 200 \
  --psu-patch 35966787 \
  --ojvm-patch 35926712 \
  --optimize yes

설치 프로세스 로그

스크립트가 실행되면 운영체제 커널 파라미터 조정, 필수 RPM 패키지 설치, Oracle 사용자 및 그룹 생성, 소프트웨어 바이너리 압축 해제, 패치(OPatch) 적용, 그리고 최종적으로 DBCA를 통한 데이터베이스 생성까지 순차적으로 진행됩니다.

[INFO] Starting Oracle 12c R2 Automated Deployment...
[INFO] Checking OS prerequisites and disabling firewall/SELinux... Done.
[INFO] Configuring local YUM repository and installing required RPMs... Done.
[INFO] Tuning kernel parameters (sysctl.conf) and user limits (limits.conf)... Done.
[INFO] Creating Oracle user, groups, and directory structures... Done.
[INFO] Extracting Oracle Database 12.2.0.1 base software... Done.
[INFO] Applying Database Release Update (35966787) via OPatch... Done.
[INFO] Applying OJVM Release Update (35926712) via OPatch... Done.
[INFO] Executing netca to configure Oracle Listener... Done.
[INFO] Executing dbca to create database 'orcl'... Done.
[INFO] Applying post-installation database optimizations... Done.
[SUCCESS] Oracle Database 12c R2 Standalone installation completed successfully.

설치 후 검증

설치가 완료된 후, Oracle 바이너리 버전, 적용된 패치 내역, 리스너 상태, 그리고 데이터베이스 접속을 통해 정상적으로 구축되었는지 검증합니다.

1. Oracle 클라이언트 및 패치 버전 확인

[oracle@nk-server ~]$ sqlplus -v
SQL*Plus: Release 12.2.0.1.0 Production

[oracle@nk-server ~]$ opatch lspatches
35926712;OJVM RELEASE UPDATE 12.2.0.1.240116 (35926712)
35966787;Database Jan 2024 Release Update : 12.2.0.1.240116 (35966787)

OPatch succeeded.

2. Oracle Net Listener 상태 확인

[oracle@nk-server ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nk-server)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                10-JAN-2024 10:30:15
Uptime                    0 days 0 hr. 15 min. 22 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=nk-server)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

3. 데이터베이스 접속 및 인스턴스 정보 확인

[oracle@nk-server ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed Jan 10 10:45:30 2024
Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      orcl

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
orcl             OPEN

태그: NeoKylin Oracle12c ShellScript DatabaseInstallation OPatch

8월 2일 13:31에 게시됨