DATABASE(oracleDB 11g)/RAC

[RAC]virtual box 에서 RAC 설치_3_user생성 및 환경 설정

SEUNGSAMI 2019. 6. 20. 15:18

 
 

























터미널에 아래 명령어 입력
## login as: root


groupadd dba
groupadd oinstall
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper


useradd -g oinstall -G asmoper,asmdba,asmadmin,vboxsf grid
useradd -g oinstall -G dba,oper,asmdba,vboxsf oracle
-- grid와 oracle 유저가 공유폴더에 접근할 수 있도록 한다.


passwd grid
passwd oracle


vi /root/.bash_profile
==========================================================================
umask 022
export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64
export PATH=$JAVA_HOME/bin:$PATH

export PATH=/u01/app/11.2.0/grid/bin:$PATH
==========================================================================


vi /home/oracle/.bash_profile
==========================================================================
umask 022
export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64
export PATH=$JAVA_HOME/bin:$PATH

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl1
export ORACLE_UNQNAME=orcl

export GRID_HOME=/u01/app/11.2.0/grid
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH

export NLS_DATE_FORMAT='YYYY/MM/DD HH24:MI:SS'
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

alias sql='sqlplus / as sysdba'
==========================================================================


vi /home/grid/.bash_profile
==========================================================================
umask 022
export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64
export PATH=$JAVA_HOME/bin:$PATH

export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1

export PATH=$ORACLE_HOME/bin:$PATH

alias sql='sqlplus / as sysasm'
==========================================================================




# 패키지 설치


cd /media/Enterprise\ Linux\ dvd\ 20090908/Server/


rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*



필수 패키지를 설치하기 위해 해당 rpm파일들을 공유폴더에 옮기기

이러한 rpm들을 오라클 홈페이지에서 받을 수 있다.


cd /media/sf_share
eject
rpm -Uvh oracleasm*
rpm -Uvh cvuqdisk*
rpm -Uvh flash-player-npapi-24.0.0.194-release.x86_64.rpm
rpm -Uvh jdk-8u201-linux-x64.rpm --요놈은 위의 스크린샷에는 나와있지 않다.



# 설치 경로 생성
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid:oinstall /u01/app
chmod -R 775 /u01/app/grid
chmod -R 775 /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle



vi /etc/sysctl.conf
================================================내용 추가
# for Oracle Database 11gR2
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
================================================


vi /etc/security/limits.conf
================================================================
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 4096
grid hard nofile 65536
grid soft stack 10240
================================================================


vi /etc/sysconfig/ntpd
=============================================================
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
=============================================================
-- 시간에 대한 정보를 타임서버에서 가져와서 SCN의 시간정보를 셋팅해준다.

service ntpd restart


ps -ef | grep ntp


cat >> /etc/pam.d/login <<EOF
session    required     pam_limits.so
EOF


vi /etc/hosts
=============================================================
127.0.0.1       localhost   localhost.localdomain
# Public
192.168.56.111   host01          host01.localdomain
192.168.56.112   host02          host02.localdomain
# Private
192.168.1.111   host01-priv1     host01-priv1.localdomain
192.168.1.112   host02-priv1     host02-priv1.localdomain
#192.168.2.111   host01-priv2     host01-priv2.localdomain -- 요놈들은 노드 3개
#192.168.2.112   host02-priv2     host02-priv2.localdomain -- 요놈들은 노드 3개
# Virtual
192.168.56.113   host01-vip      host01-vip.localdomain
192.168.56.114   host02-vip      host02-vip.localdomain
# SCAN
192.168.56.115   cluster01-scan  cluster01-scan.localdomain
192.168.56.116   cluster01-scan  cluster01-scan.localdomain
192.168.56.117   cluster01-scan  cluster01-scan.localdomain
=============================================================


shutdown -h now