본문 바로가기
Oracle/설치

Oracle 19c ASM Single DB 설치하기 ch.1

by 취미툰 2020. 1. 10.
반응형

ksh-20120801-26.el7.x86_64.rpm
0.86MB
libaio-devel-0.3.109-13.el7.x86_64.rpm
0.01MB
oracleasmlib-2.0.12-1.el7.x86_64.rpm
0.02MB
oracleasm-support-2.1.11-2.el7.x86_64.rpm
0.08MB
oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
0.02MB

테스트할때 사용하려고 설치했던 ASM + Single DB 설치에 대한 내용을 정리해서 포스팅하겠습니다.

처음에 RAC One Node라고 생각하고 찾아보고 설치했는데, RAC One Node는 엄연한 RAC라서 적어도 2개의 노드가 필요하고 그 중 한개만 쓰고 유사시에 나머지 한개를 쓰는 구조의 시스템이었습니다. 저는 아예 스토리지 시스템을 ASM으로 구축하고 Single DB를 구축하였습니다.

 

사용 VM : Oracle Virtual box

OS ver OEL 7.6

메모리 4GB (19c 권장은 8GB입니다. 추후에 설치시에 위험 메세지가 나오는데 저는 무시하고 설치했습니다)

저장공간 

CRS1 - 1G

CRS2 - 1G

CRS3 - 1G

DATA - 50G

FRA - 20G

 

1.서버 정보 확인
[root@localhost ~]# uname -a
Linux localhost.localdomain 4.14.35-1818.3.3.el7uek.x86_64 #2 SMP Mon Sep 24 14:45:01 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/oracle-release
Oracle Linux Server release 7.6

 

2. 불 필요한 서비스 정리

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# systemctl stop bluetooth
[root@localhost ~]# systemctl disable bluetooth
Removed symlink /etc/systemd/system/dbus-org.bluez.service.
Removed symlink /etc/systemd/system/bluetooth.target.wants/bluetooth.service.
[root@localhost ~]# systemctl stop chronyd
[root@localhost ~]# systemctl disable chronyd
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.

 

3.패키지 확인

[root@localhost ~]# rpm -q binutils
binutils-2.27-34.base.0.1.el7.x86_64
[root@localhost ~]# rpm -q compat-libcap1
compat-libcap1-1.10-7.el7.x86_64
[root@localhost ~]# rpm -q compat-libstdc++-33
compat-libstdc++-33-3.2.3-72.el7.x86_64
[root@localhost ~]# rpm -q glibc
glibc-2.17-260.0.9.el7.x86_64
[root@localhost ~]# rpm -q glibc-devel
glibc-devel-2.17-260.0.9.el7.x86_64
[root@localhost ~]# rpm -q ksh
ksh 패키지가 설치되어 있지 않습니다
[root@localhost ~]# rpm -q libaio
libaio-0.3.109-13.el7.x86_64
[root@localhost ~]# rpm -q libaio-devel
libaio-devel 패키지가 설치되어 있지 않습니다
[root@localhost ~]# rpm -q libgcc
libgcc-4.8.5-36.0.1.el7.x86_64
[root@localhost ~]# rpm -q libstdc++
libstdc++-4.8.5-36.0.1.el7.x86_64
[root@localhost ~]# rpm -q libstdc++-devel
libstdc++-devel-4.8.5-36.0.1.el7.x86_64
[root@localhost ~]# rpm -q libX11
libX11-1.6.5-2.el7.x86_64
[root@localhost ~]# rpm -q libXau
libXau-1.0.8-2.1.el7.x86_64
[root@localhost ~]# rpm -q libxcb
libxcb-1.13-1.el7.x86_64
[root@localhost ~]# rpm -q libXi
libXi-1.7.9-1.el7.x86_64
[root@localhost ~]# rpm -q libXtst
libXtst-1.2.3-1.el7.x86_64
[root@localhost ~]# rpm -q make
make-3.82-23.el7.x86_64
[root@localhost ~]# rpm -q net-tools
net-tools-2.0-0.24.20131004git.el7.x86_64
[root@localhost ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.61.0.1.el7.x86_64
[root@localhost ~]# rpm -q smartmontools
smartmontools-6.5-1.el7.x86_64
[root@localhost ~]# rpm -q sysstat
sysstat-10.1.5-17.el7.x86_64

 

없는 패키지는 브라우저에서 검색 후 설치하였습니다.

 

4.패키지 설치

- 첨부파일로 필요패키지는 첨부하도록 하겠습니다.

[root@localhost rpm]# rpm -ivh ksh-20120801-26.el7.x86_64.rpm
경고: ksh-20120801-26.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
준비 중...                         ################################# [100%]
Updating / installing...
   1:ksh-20120801-26.el7              ################################# [100%]
[root@localhost rpm]# rpm -ivh libaio-devel-0.3.109-13.el7.x86_64.rpm
경고: libaio-devel-0.3.109-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
준비 중...                         ################################# [100%]
Updating / installing...
   1:libaio-devel-0.3.109-13.el7      ################################# [100%]

 

- asm을 사용하기 위한 패키지입니다. 설치하여줍니다.
[root@localhost rpm]# rpm -ivh oracleasm-support-2.1.11-2.el7.x86_64.rpm
경고: oracleasm-support-2.1.11-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
준비 중...                         ################################# [100%]
Updating / installing...
   1:oracleasm-support-2.1.11-2.el7   ################################# [100%]
알림: 'systemctl enable oracleasm.service'에 요청을 전송하고 있습니다.
Created symlink from /etc/systemd/system/multi-user.target.wants/oracleasm.service to /usr/lib/systemd/system/oracleasm.service.

 

-19c설치에 필요한 사항들을 rpm으로 만든것입니다. 12c부터 있습니다.

[root@localhost rpm]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
경고: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
준비 중...                         ################################# [100%]
Updating / installing...
   1:oracle-database-preinstall-19c-1.################################# [100%]
[root@localhost rpm]# rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm
경고: oracleasmlib-2.0.12-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
준비 중...                         ################################# [100%]
Updating / installing...
   1:oracleasmlib-2.0.12-1.el7        ################################# [100%]

 

5./etc/hosts 수정

 

[root@localhost ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.56.70  ysbae19c ysbae19c.localdomain

 

6.보안설정 변경

[root@localhost ~]# vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=permissive
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

 

 

6.저장공간 추가하기

서버 종료후 작업합니다.

- 오른쪽 마우스 클릭 후 설정(S)클릭

 

아래화면처럼 하드디스크를 추가해줍니다, 컨트롤러:SATA 옆의 디스크+모양의 아이콘클릭 후 새 하드디스크 할당을 클릭합니다.

VDI로 설정하고 다음을 클릭합니다.

 

고정 크기 디스크를 사용할 것이므로 고정 크기 선택 후 다음을 클릭합니다.

이름과 크기를 선택 후 만들기를 클릭합니다. 

(저는 CRS1,CRS2,CRS3,DATA,FRA 총 5개의 디스크를 추가하였습니다)

 

7.tmpfs 할당 및 마운트

[root@localhost ~]# vi /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Dec 31 23:26:01 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/ol-root     /                       xfs     defaults        0 0
UUID=e310b8b9-b62a-4076-bd22-07900d64f554 /boot                   xfs     defaults        0 0
/dev/mapper/ol-swap     swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   size=8g         0 0
~

 

[root@localhost ~]# mount -o remount /dev/shm

[root@localhost ~]# df
Filesystem          1K-blocks    Used Available Use% Mounted on
devtmpfs              1996884       0   1996884   0% /dev
tmpfs                 8388608       0   8388608   0% /dev/shm
tmpfs                 2014940    9532   2005408   1% /run
tmpfs                 2014940       0   2014940   0% /sys/fs/cgroup
/dev/mapper/ol-root  53975296 4377808  49597488   9% /
/dev/sda1              996012  215752    780260  22% /boot
tmpfs                  402992      28    402964   1% /run/user/0

 

8.그룹 및 사용자 계정 생성

[root@localhost rpm]#groupadd asmadmin
[root@localhost rpm]#groupadd asmdba
[root@localhost rpm]#groupadd asmoper

[root@localhost rpm]#usermod -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba,asmdba,asmoper oracle

[root@localhost rpm]# passwd oracle
oracle 사용자의 비밀 번호 변경 중
새  암호: oracle
잘못된 암호: 암호는 8 개의 문자 보다 짧습니다
새  암호 재입력:oracle
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

 

9.사용자 환경설정

[root@localhost rpm]# mkdir -p /u01/app/oracle
[root@localhost rpm]# chown -R oracle:oinstall /u01
[root@localhost rpm]# chmod -R 775 /u01

 

[root@localhost rpm]#su - oracle

- 프로파일 수정

[19cysbae:/home/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 EDITOR=vi
export ORACLE_HOSTNAME=ysbae19c            
export ORACLE_UNQNAME=ysbae19c 
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/19c/grid
export DB_HOME=$ORACLE_BASE/product/19c/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=ysbae19c              
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG=AMERICAN_KOREA.AL32UTF8
PS1='[$ORACLE_SID:$PWD]> '5

alias grid_env='export ORACLE_HOME=$GRID_HOME;export ORACLE_SID=+ASM1'
alias db_env='export ORACLE_HOME=$DB_HOME;export ORACLE_SID=ysbae19c'

 

root 계정에도 프로파일 추가
.bash_profile
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/19c/grid
export DB_HOME=$ORACLE_BASE/product/19c/db_1
export PATH=$PATH:$GRID_HOME/bin

 

10.ASM환경 설정 및 초기화

[root@19cysbae ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting  without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done

[root@19cysbae ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@19cysbae ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
[root@19cysbae ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

 

11.디스크 파티셔닝

-sdb,sdc,sdd,sde,sdf 총 5번 수행하면 됩니다.

 

[root@19cysbae ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb  /dev/sdc  /dev/sdd  /dev/sde  /dev/sdf
[root@19cysbae ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x2fe9d83d.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2097151, default 2048): [enter]
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151): [enter]
Using default value 2097151
Partition 1 of type Linux and of size 1023 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

 

oracleasm scandisk 등록 및 확인

[root@ysbae19c ~]# oracleasm createdisk CRS1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@ysbae19c ~]# oracleasm createdisk CRS2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@ysbae19c ~]# oracleasm createdisk CRS3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@ysbae19c ~]# oracleasm createdisk DATA /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@ysbae19c ~]# oracleasm createdisk FRA /dev/sdf1
Writing disk header: done
Instantiating disk: done
[root@ysbae19c ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@ysbae19c ~]# oracleasm listdisks
CRS1
CRS2
CRS3
DATA

FRA

 

12.GRID 설치

DB,GRID 설치파일 링크

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

 

Oracle Database 19c Download 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 Application Clusters, Oracle Real Application Clusters One Node, o

www.oracle.com

 

[+ASM1:/home/oracle]> mkdir -p $GRID_HOME
파일 전송 후  알집풀기

[+ASM1:/home/oracle]> unzip LINUX.X64_193000_grid_home.zip -d $GRID_HOME

...생략

 

[root@19cysbae rpm]# cd /u01/app/19c/grid/cv/rpm

 

[root@19cysbae rpm]# rpm -ivh cvuqdisk-1.0.10-1.rpm
준비 중...                         ################################# [100%]
Using default group oinstall to install package
Updating / installing...
   1:cvuqdisk-1.0.10-1                ################################# [100%]

 

 

 

 

 

 

반응형

댓글