반응형

  vi /etc/ssh/sshd_config

Permitrootlogin yes 주석 해제

/etc/hosts 파일 수정

1. vi 편집기로 /etc/hosts 파일 수정

# vi /etc/hosts

2. 아래와 같이 내용 편집

127.0.0.1 localhost.localdomain localhost

# Public

192.168.40.11    rac1

192.168.40.12    rac2

# Private192.168.2.120    rac1-priv

192.168.2.130    rac2-priv

# VIP

192.168.40.21    rac1-vip

192.168.40.22    rac2-vip

192.168.40.23    rac-scan

앞서 설정한 Pulic Private, VIP IP를 설정해준다.

참고로 여기에 적힌 IPVMware마다 다르니 참고할 것!!

# service network restart

- 필요 없는 서비스 중지 ( 부팅 속도가 빨라질 수 있음)

chkconfig --level 123456 xinetd off

chkconfig --level 123456 sendmail off

chkconfig --level 123456 cups off

chkconfig --level 123456 cups-config-daemon off

chkconfig --level 123456 smartd off

chkconfig --level 123456 iptables off

 

- 오라클 계정 생성

groupadd -g 5000 dba

groupadd -g 5001 oinstall

useradd -g oinstall -G dba -d /home/oracle oracle

passwd oracle

 

- 공유 메모리 설정

# vi /etc/sysctl.conf

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.wmem_max = 1048576

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

fs.file-max = 6815744

fs.aio-max-nr = 1048576

 

# sysctl -p // sysctl.conf 에 있는 설정을 로드한다.

 

- 공유 자원 설정

# vi /etc/security/limits.conf

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

 

- /etc/pam.d/login 파일 내용 추가 

session required pam_limits.so

 

- /etc/modprobe.conf 파일 내용 추가

# vi /etc/modprobe.conf

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

 

 

/etc/rc.local 파일 내용 추가

# vi /etc/rc.local

/sbin/modprobe hangcheck-timer rdate -s 203.248.240.140

 

/etc/sysconfig/ntpd파일 내용 추가

# vi /etc/sysconfig/ntpd

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

=> 2번째 줄 -x 옵션 추가 후 저장

 

 

# service ntpd restart

# chkconfig --level 123456 ntpd on

 

[root@rac1 Server]# pwd

/media/OL5.9 i386 dvd 20130111/Server

**** 위에 경로가 없을 시 리눅스 셧다운 후 iso 다시 마운트 하고 재부팅 시 생성 됨

# rpm -Uvh libaio-devel-0.3.106-5.i386.rpm

# rpm -Uvh numactl-devel-0.9.8-12.0.3.el5_6.i386.rpm

# rpm -Uvh unixODBC-*

 

- rac1 환경 변수 설정

[root@rac1 ~]# vi .bash_profile

export GRID_HOME=/oracle11/11g/grid

export PATH=$PATH:$HOME/bin:$GRID_HOME/bin

 

[root@rac1 ~]#  vi /home/oracle/.bash_profile

export PATH

export EDITOR=vi

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_HOSTNAME=rac1

export ORACLE_UNQNAME=racdb

export ORACLE_BASE=/oracle11/oracle

export ORACLE_HOME=$ORACLE_BASE/11g/db

export GRID_HOME=/oracle11/11g/grid

export ORACLE_SID=racdb1

export ORACLE_TERM=xterm

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

 

Disk 설정

# fdisk /dev/sdb

n - p - 1 - 엔터 - 엔터 - t - 8e - p - w 순 으로 입력

The number of cylinders for this disk is set to 1305.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1305, default 1): 엔터

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): 엔터

Using default value 1305

Command (m for help): t

Selected partition 1

Hex code (type L to list codes): 8e

Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sdb1 1 1305 10482381 8e Linux LVM

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

#

 

# pvcreate rac /dev/sdb1

#vgcreate rac /dev/sdb1

 

- Logical Volume 생성

pvcreate rac /dev/sdb1

vgcreate rac /dev/sdb1

lvcreate -L 300M -n ocr01 rac

lvcreate -L 300M -n ocr02 rac

lvcreate -L 300M -n vote01 rac

lvcreate -L 300M -n vote02 rac

lvcreate -L 300M -n vote03 rac

lvcreate -L 700M -n system rac

lvcreate -L 700M -n sysaux rac

lvcreate -L 700M -n users rac

lvcreate -L 700M -n undotbs1 rac

lvcreate -L 700M -n undotbs2 rac

lvcreate -L 700M -n temp rac

lvcreate -L 100M -n control01 rac

lvcreate -L 100M -n control02 rac

lvcreate -L 100M -n control03 rac

lvcreate -L 200M -n redo01 rac

lvcreate -L 200M -n redo02 rac

lvcreate -L 200M -n redo03 rac

lvcreate -L 200M -n redo04 rac

lvcreate -L 200M -n redo05 rac

lvcreate -L 200M -n redo06 rac

lvcreate -L 100M -n spfile rac

 

■ 생성 확인

# lvscan

 

- Raw Device Rule 구성

# vi /etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="raw*", OWNER=="oracle", GROUP=="dba", MODE=="0660"

 

- Raw Device Mapping

# vi /etc/sysconfig/rawdevices

/dev/raw/raw1 /dev/rac/ocr01

/dev/raw/raw2 /dev/rac/ocr02

/dev/raw/raw3 /dev/rac/vote01

/dev/raw/raw4 /dev/rac/vote02

/dev/raw/raw5 /dev/rac/vote03

/dev/raw/raw6 /dev/rac/system

/dev/raw/raw7 /dev/rac/sysaux

/dev/raw/raw8 /dev/rac/users

/dev/raw/raw9 /dev/rac/temp

/dev/raw/raw10 /dev/rac/undotbs1

/dev/raw/raw11 /dev/rac/undotbs2

/dev/raw/raw12 /dev/rac/redo01

/dev/raw/raw13 /dev/rac/redo02

/dev/raw/raw14 /dev/rac/redo03

/dev/raw/raw15 /dev/rac/redo04

/dev/raw/raw16 /dev/rac/redo05

/dev/raw/raw17 /dev/rac/redo06

/dev/raw/raw18 /dev/rac/control01

/dev/raw/raw19 /dev/rac/control02

/dev/raw/raw20 /dev/rac/control03

/dev/raw/raw21 /dev/rac/spfile

 

- Raw Device 재시작

# /etc/init.d/rawdevices restart

 

 

- Raw Device 권한 확인

ls -al /dev/raw/raw*

폴더 복사

1. 윈도우의 내컴퓨터 실행

2. C:\VM\Rac1 폴더 이동 // 나의 VMware 파일 경로

3. 아래 2개의 파일을 복사 (Ctrl + C) // 파일 아이콘 및 유형으로 확인할 것

Rac 설치 준비를 해둔 VMware 파일을 이용하여 Rac 두번째 노드를 손쉽게 구성하기 위해서 복사를 한다.

이 과정을 대신에 직접 Rac2 노드를 생성해도 된다.

 

폴더 이동

1. C:\VM 폴더에 Rac2 폴더 생성

2. C:\VM\Rac2 폴더에 복사한 파일 붙여넣기 (Ctrl + V)

3. 파일이름 변경 (Rac1 -> Rac2)

VMware 설정 파일 변경

1. 이름을 변경한 Rac2 파일중 Configuration 파일을 메모장으로 오픈 (용량이 가장 적은 파일)

2. 검색 기능 (Ctrl + F) 을 이용하여 Rac1 을 검색 후 모두 Rac2 로 바꿔줌

3. 저장 후 종료

4. 변경 완료 된 설정 파일 실행 (더블 클릭)

파일은 복사해 왔지만 VMware 의 설정은 모두 Rac1 로 되어있을 것이기 때문에 이를 Rac2 로 변경해주는 것이다.

 

Rac2 VMware 에 추가

1. VMware 가 실행되면서 Rac2 가 추가됨

2. Rac2 실행

 

복사한 Node 2 초기 설정 변경

복사 유,

I copied it 클릭

 

 

rac2 환경설정

# neat

# service network restart

 

# vi .bash_profile

export GRID_HOME=/oracle11/11g/grid

export PATH=$PATH:$HOME/bin:$GRID_HOME/bin

추가

 

# vi /home/oracle/.bash_profile

export ORACLE_HOSTNAME=rac2

export ORACLE_SID=racdb2

수정

 

설치파일 복사 및 RAC 설치 전 기본 환경설정

- (rac1) 파일 이동 후 압축 풀기

cd /home/oracle

unzip *.zip

 

- 설치파일 설치 디렉토리 소유권 oracle 계정으로 이전

(rac1,2전부 수행)

# chown -R oracle.dba /home/oracle

# chown -R oracle.dba /oracle11

 

- (rac1) cvuqdisk RPM 설치

[root@rac1 ~]# cd /home/oracle/grid/rpm

[root@rac1 rpm]# ls

cvuqdisk-1.0.7-1.rpm

[root@rac1 rpm]# export CVUQDISK_GRP=dba

[root@rac1 rpm]# rpm -Uvh cvuqdisk-1.0.7-1.rpm

- (rac1) scp를 이용하여 rac2노드에 cvudisk 복사

[root@rac1 rpm]# scp cvuqdisk-1.0.7-1.rpm rac2:~/

 

- (rac2) cvuqdisk-1.0.7-1.rpm 설치

[root@rac2 ~]# export CVUQDISK_GRP=dba

[root@rac2 ~]# rpm -Uvh cvuqdisk-1.0.7-1.rpm

 

- (rac1) Grid Infrastructure 설치

rac1oracle 계정 rac2root계정으로 로그인

[root@rac1 rpm]# su - oracle

[oracle@rac1 ~]$ cd /home/oracle/grid/

[oracle@rac1 grid]$ . runInstaller

 

rac1, rac2 위의 쉘을 root계정으로 수행 후 OK

ignore All 체크 후 Next

65%에서 한동안 멈춤 당황하지 말 것.

script 실행 순서 :

rac1 - 1sh

rac1 - 2sh

rac2 - 1sh

rac2 - 2sh2sh돌릴 때 입력키는 그냥 Enter

** 절대 동시에 실행 시키지 말 것 !! 순서 지켜 실행시킬 것!!

원래 뜨는 에러이니 당황하지 말 것

 

 

[root@rac1 oracle]# crs_stat -t

 

 이 화면 나온다면 crs 설치 완료

'Study Note > Database' 카테고리의 다른 글

Oracle Architecture  (0) 2016.01.27
Oracle RAC(Real Application Clusters)  (0) 2016.01.27
Oracle 11g RAC 설치 on OEL - 4  (0) 2016.01.25
Oracle 11g RAC 설치 on OEL - 2  (0) 2016.01.25
Oracle 11g RAC 설치 on OEL - 1  (0) 2016.01.25

+ Recent posts