[Oracle - RESTART 19c install] part 1

 사전 구성

 

■ 버전 확인 (버전과 os 플랫폼마다 필요한 rpm 패키지가 다르기때문에 RESTART 문서 참고해서 필요 패키지 설치)

[root@jh ~]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

 

 

 

 테스트 시작

 

 Group , User 생성  

[root@jh ~]# groupadd dba
[root@jh ~]# useradd -g dba oracle
[root@jh ~]# useradd -g dba grid
[root@jh ~]# mkdir /oracle /grid
[root@jh ~]# chown oracle.dba /oracle
[root@jh ~]# chown grid.dba /grid
 

 

 

 필수 패키지 설치

[root@jh ~]# yum install -y \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libxcb \
libX11 \
libXau \
libXi \
libXtst \
make \
smartmontools \
sysstat \
gcc \
kmod-oracleasm \
elfutils \
fontconfig \
libXrender

 

 

 

oracleasm-support, oracleasmlib 이 두개는 따로 설치

Download URL : https://www.oracle.com/linux/downloads/linux-asmlib-rhel7-downloads.html

[root@jh ~]# rpm -ivh oracleasm-support-2.1.11-2.el7.x86_64.rpm
warning: oracleasm-support-2.1.11-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracleasm-support-2.1.11-2.el7   ################################# [100%]
Note: Forwarding request to 'systemctl enable oracleasm.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/oracleasm.service to /usr/lib/systemd/system/oracleasm.service.



[root@jh ~]# rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm
warning: oracleasmlib-2.0.12-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracleasmlib-2.0.12-1.el7        ################################# [100%]

 

 

 커널 셋팅

[root@jh ~]# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 1526784                   //mem total 나누기 4096(page size default)
kernel.shmmax = 2147483648            //mem total 나누기 2
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576



[root@jh ~]# sysctl -p


[root@jh ~]# vi /etc/security/limits.conf 
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240              =>grid 추가

 

 

 

 bash_profile 수정 (oracle)

[root@jh ~]# su - oracle
[root@oracle]# vi ~/.bash_profile


#User specific enviroment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export PS1='[$ORACLE_SID]\u@\h:$PWD# '
export ORACLE_BASE=/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
export ORACLE_UNQNAME=orcl
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch



[root@oracle]# mkdir -p $ORACLE_HOME

 

 

 

 bash_profile 수정 (grid)

[root@jh ~]# su - grid
[root@grid]# vi ~/.bash_profile

##User specific enviroment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export PS1='[$ORACLE_SID]\u@\h:$PWD# '
export ORACLE_BASE=/grid/base
export ORACLE_HOME=/grid/crs/product/19c/dbhome_1     
export ORACLE_SID=+ASM
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch



[root@grid]# mkdir -p $ORACLE_HOME

 

 

 

1. 하나의 하드 디스크를 통으로 data용도로 사용 하거나 reco용도로 사용 할 시 -> 하드 디스크를 마운트해주고 ASM으로 변환 해주기만 하면 됩니다.

 

2. 하나의 하드 디스크를 data용도 부분, reco 용도 부분으로 나눌 시 논리적 디스크로 변환 후 ASM으로 변환.

※ 저는 하나의 하드 디스크에 여러 부분을 논리적으로 나눌 예정입니다.
디스크 파티션 분할
[root@jh ~]#fdisk -l                   //추가된 하드 디스크 확인
[root@jh ~]# fdisk /dev/sdb        //디스크 분할
n
p
1
enter

 

 

 PV 생성 (phsical volume 생성)

[root@jh ~]# pvcreate /dev/sdb1                          //pv 볼륨 생성
  Physical volume "/dev/sdb1" successfully created.


[root@jh ~]# pvdisplay                                        //pv 생성 확인
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               rhel
  PV Size               119.51 GiB / not usable 3.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              30594
  Free PE               1
  Allocated PE          30593
  PV UUID               do5dDg-azy8-u23B-vyNO-2uZ1-mHU7-wqy2Pf
  "/dev/sdb1" is a new physical volume of "<200.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name               
  PV Size               <200.00 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               elbUrw-x95O-tSs5-fRIG-pr2X-E9Sg-uwik2I
 
 
 
 

 VG 생성

[root@jh ~]# vgcreate ASM /dev/sdb1      //ASM이란 이름으로 vg 생성
  Volume group "ASM" successfully created


[root@jh ~]# vgdisplay ASM
  --- Volume group ---
  VG Name               ASM
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <200.00 GiB
  PE Size               4.00 MiB
  Total PE              51199
  Alloc PE / Size       0 / 0   
  Free  PE / Size       51199 / <200.00 GiB
  VG UUID               E03kp0-QbQZ-lyM2-cz4w-P3tw-VyBU-uRxOln

 

 

 LV 볼륨 생성 (Logical volume 생성)

[root@jh ~]# lvcreate -L 50G -n DATA1 ASM            =>  DATA라는 디스크 그룹에 DATA1과 DATA2를 각각 50G씩 할당
  Logical Volume "DATA1" already exists in volume group "ASM"

[root@jh ~]# lvcreate -L 50G -n DATA2 ASM
  Logical Volume "DATA2" already exists in volume group "ASM"


[root@jh ~]# lvcreate -L 99G -n RECO ASM        => RECO 디스크 그룹엔 99G 할당       하드디스크 추가해준게 200G라 각 디스크 그룹별로 나눠서 할당
  Logical Volume "RECO" already exists in volume group "ASM"


[root@jh ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/rhel/swap
  LV Name                swap
  VG Name                rhel
  LV UUID                NqDAwM-7NZn-hmQA-aC6h-vM4O-5NDU-NuVoKE
  LV Write Access        read/write
  LV Creation host, time localhost, 2020-02-11 12:49:27 +0900
  LV Status              available
  # open                 2
  LV Size                6.05 GiB
  Current LE             1550
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1
   
  --- Logical volume ---
  LV Path                /dev/rhel/oracle
  LV Name                oracle
  VG Name                rhel
  LV UUID                c6GrFp-TFrF-b0wd-MQK3-1otw-ImIA-BW3SRM
  LV Write Access        read/write
  LV Creation host, time localhost, 2020-02-11 12:49:28 +0900
  LV Status              available
  # open                 1
  LV Size                40.00 GiB
  Current LE             10240
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:2
   
  --- Logical volume ---
  LV Path                /dev/rhel/grid
  LV Name                grid
  VG Name                rhel
  LV UUID                CBENIH-7i2p-t8BG-fpOm-OahR-woKy-NCxw5F
  LV Write Access        read/write
  LV Creation host, time localhost, 2020-02-11 12:49:31 +0900
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:3
   
  --- Logical volume ---
  LV Path                /dev/rhel/root
  LV Name                root
  VG Name                rhel
  LV UUID                OA7IEY-vt3z-AMJf-ZTOy-bOC1-8K0h-ceUkkv
  LV Write Access        read/write
  LV Creation host, time localhost, 2020-02-11 12:49:37 +0900
  LV Status              available
  # open                 1
  LV Size                <23.45 GiB
  Current LE             6003
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/ASM/DATA1
  LV Name                DATA1
  VG Name                ASM
  LV UUID                JcKSRC-X06v-zJ4t-w4h3-Lyrk-WPgA-DdJC0v
  LV Write Access        read/write
  LV Creation host, time jh, 2021-06-14 11:40:08 +0900
  LV Status              available
  # open                 0
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:4
   
  --- Logical volume ---
  LV Path                /dev/ASM/DATA2
  LV Name                DATA2
  VG Name                ASM
  LV UUID                nkgF8N-0k3C-fCrc-sTch-6XT0-J4p5-1Q4TgD
  LV Write Access        read/write
  LV Creation host, time jh, 2021-06-14 11:40:11 +0900
  LV Status              available
  # open                 0
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:5
   
  --- Logical volume ---
  LV Path                /dev/ASM/RECO
  LV Name                RECO
  VG Name                ASM
  LV UUID                rsIIki-XEKJ-RQIf-o3dQ-0rfn-8gyO-0YgPgd
  LV Write Access        read/write
  LV Creation host, time jh, 2021-06-14 11:40:20 +0900
  LV Status              available
  # open                 0
  LV Size                99.00 GiB
  Current LE             25344
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:6
 
 
 
 

 oracle asm 설치(root 유저)

[root@jh ~]# 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 <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

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




[root@jh ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=dba
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

 

 

 

 asm 시작

[root@jh ~]# oracleasm init


[root@jh ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes


[root@jh ~]# oracleasm createdisk DATA1 /dev/ASM/DATA1
Writing disk header: done
Instantiating disk: done


[root@jh ~]# oracleasm createdisk DATA2 /dev/ASM/DATA2
Writing disk header: done
Instantiating disk: done


[root@jh ~]# oracleasm createdisk RECO /dev/ASM/RECO
Writing disk header: done
Instantiating disk: done


[root@jh ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...




※ [root@jh ~]# oracleasm listdisks              -> RAC 환경이라면 두 노드가 같이 떠야합니다.  
DATA1
DATA2
RECO

 

 

 

 Oracle 설치 파일 복사

[root@jh 19c]# cp LINUX.X64_193000_grid_home.zip  /grid                  => grid 설치파일은 /grid에
[root@jh 19c]# cp LINUX.X64_193000_db_home.zip  /oracle                  => oracle 설치파일은 /oracle에

 

 

 

oracle , grid 설치는 다음편에 쓰도록 하겠습니다.