본문 바로가기
스터디북

<12/12> 주말 자습 RAC 설치 및 성능고도화 1장 공부

by 파이어볼러 2015. 12. 12.

RAC설치 성능고도화 공부


[root@rac1 Server]# rpm -Uvh libaio-devel-0.3.106-5.i386.rpm

warning: libaio-devel-0.3.106-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:libaio-devel           ########################################### [100%]

[root@rac1 Server]# rpm -Uvh sysstat-7.0.2-3.el5_5.1.i386.rpm

warning: sysstat-7.0.2-3.el5_5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:sysstat                ########################################### [100%]

[root@rac1 Server]# rpm -Uvh numactl-devel-0.9.8-11.0.1.el5.i386.rpm

warning: numactl-devel-0.9.8-11.0.1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:numactl-devel          ########################################### [100%]

^[[A[root@rac1 Server]# rpm -Uvh unixODBC-2.2.11-7.1.i386.rpm

warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:unixODBC               ########################################### [100%]

[root@rac1 Server]# rpm -Uvh unixODBC-devel-2.2.11-7.1.i386.rpm

warning: unixODBC-devel-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:unixODBC-devel         ########################################### [100%]


groupadd -g 5001 oinstall

groupadd -g 5000 dba

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

passwd oracle



[root@rac1 Server]# vi /etc/sysctl.conf


fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576



[root@rac1 Server]# sysctl -p

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 2

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 4294967295

kernel.shmall = 268435456

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576


[root@rac1 Server]# 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



[root@rac1 Server]# vi /etc/pam.d/login


session      required      pam_limits.so


[root@rac1 Server]# cd

[root@rac1 ~]# vi .bash_profile


export GRID_HOME=/u01/app/11.2.0.2/grid

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


[root@rac1 ~]# su - oracle

[oracle@rac1 ~]$ vi .bash_profile


export EDITOR=vi

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_HOSTNAME=rac1

export ORACLE_UNQNAME=racdb

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/11.2.0.2/db

export GRID_HOME=/u01/app/11.2.0.2/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



[oracle@rac1 ~]$ . .bash_profile

[oracle@rac1 ~]$ exit

logout

[root@rac1 ~]# fdisk -l


Disk /dev/sda: 53.6 GB, 53687091200 bytes

255 heads, 63 sectors/track, 6527 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        2180    17406427+  83  Linux

/dev/sda3            2181        6004    30716280   83  Linux

/dev/sda4            6005        6527     4200997+   5  Extended

/dev/sda5            6005        6526     4192933+  82  Linux swap / Solaris


Disk /dev/sdb: 16.1 GB, 16106127360 bytes

255 heads, 63 sectors/track, 1958 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System

[root@rac1 ~]# fdisk /dev/sdb


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

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-1958, default 1): 1

Last cylinder or +size or +sizeM or +sizeK (1-1958, default 1958): 1958


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: 16.1 GB, 16106127360 bytes

255 heads, 63 sectors/track, 1958 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        1958    15727603+  8e  Linux LVM


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.



[root@rac1 Server]# pvcreate /dev/sdb1

  Physical volume "/dev/sdb1" successfully created


[root@rac1 Server]# vgcreate rac /dev/sdb1

  /dev/cdrom: open failed: Read-only file system

  /dev/cdrom: open failed: Read-only file system

  /dev/cdrom: open failed: Read-only file system

  Volume group "rac" successfully created


[root@rac1 Server]# lvcreate -L 300M -n ocr01 rac

  Logical volume "ocr01" created

[root@rac1 Server]# lvcreate -L 300M -n ocr02 rac

  Logical volume "ocr02" created

[root@rac1 Server]# lvcreate -L 300M -n vote01 rac

  Logical volume "vote01" created

[root@rac1 Server]# lvcreate -L 300M -n vote02 rac

  Logical volume "vote02" created

[root@rac1 Server]# lvcreate -L 300M -n vote03 rac

  Logical volume "vote03" created

[root@rac1 Server]# lvcreate -L 700M -n system rac

  Logical volume "system" created

[root@rac1 Server]# lvcreate -L 700M -n sysaux rac

  Logical volume "sysaux" created

[root@rac1 Server]# lvcreate -L 700M -n users rac

  Logical volume "users" created

[root@rac1 Server]# lvcreate -L 700M -n undotbs1 rac

  Logical volume "undotbs1" created

[root@rac1 Server]# lvcreate -L 700M -n undotbs2 rac

  Logical volume "undotbs2" created

[root@rac1 Server]# lvcreate -L 700M -n temp rac

  Logical volume "temp" created

[root@rac1 Server]# lvcreate -L 100M -n control01 rac

  Logical volume "control01" created

[root@rac1 Server]# lvcreate -L 100M -n control02 rac

  Logical volume "control02" created

[root@rac1 Server]# lvcreate -L 100M -n control03 rac

  Logical volume "control03" created

[root@rac1 Server]# lvcreate -L 200M -n redo01 rac

  Logical volume "redo01" created

[root@rac1 Server]# lvcreate -L 200M -n redo02 rac

  Logical volume "redo02" created

[root@rac1 Server]# lvcreate -L 200M -n redo03 rac

  Logical volume "redo03" created

[root@rac1 Server]# lvcreate -L 200M -n redo04 rac

  Logical volume "redo04" created

[root@rac1 Server]# lvcreate -L 200M -n redo05 rac

  Logical volume "redo05" created

[root@rac1 Server]# lvcreate -L 200M -n redo06 rac

  Logical volume "redo06" created

[root@rac1 Server]# lvcreate -L 500M -n data01 rac

  Logical volume "data01" created

[root@rac1 Server]# lvcreate -L 500M -n data02 rac

  Logical volume "data02" created

[root@rac1 Server]# lvcreate -L 500M -n data03 rac

  Logical volume "data03" created

[root@rac1 Server]# lvcreate -L 500M -n data04 rac

  Logical volume "data04" created

[root@rac1 Server]# lvcreate -L 500M -n data05 rac

  Logical volume "data05" created

[root@rac1 Server]# lvcreate -L 100M -n spfile rac

  Logical volume "spfile" created


[root@rac1 Server]# lvscan

  ACTIVE            '/dev/rac/ocr01' [300.00 MB] inherit

  ACTIVE            '/dev/rac/ocr02' [300.00 MB] inherit

  ACTIVE            '/dev/rac/vote01' [300.00 MB] inherit

  ACTIVE            '/dev/rac/vote02' [300.00 MB] inherit

  ACTIVE            '/dev/rac/vote03' [300.00 MB] inherit

  ACTIVE            '/dev/rac/system' [700.00 MB] inherit

  ACTIVE            '/dev/rac/sysaux' [700.00 MB] inherit

  ACTIVE            '/dev/rac/users' [700.00 MB] inherit

  ACTIVE            '/dev/rac/undotbs1' [700.00 MB] inherit

  ACTIVE            '/dev/rac/undotbs2' [700.00 MB] inherit

  ACTIVE            '/dev/rac/temp' [700.00 MB] inherit

  ACTIVE            '/dev/rac/control01' [100.00 MB] inherit

  ACTIVE            '/dev/rac/control02' [100.00 MB] inherit

  ACTIVE            '/dev/rac/control03' [100.00 MB] inherit

  ACTIVE            '/dev/rac/redo01' [200.00 MB] inherit

  ACTIVE            '/dev/rac/redo02' [200.00 MB] inherit

  ACTIVE            '/dev/rac/redo03' [200.00 MB] inherit

  ACTIVE            '/dev/rac/redo04' [200.00 MB] inherit

  ACTIVE            '/dev/rac/redo05' [200.00 MB] inherit

  ACTIVE            '/dev/rac/redo06' [200.00 MB] inherit

  ACTIVE            '/dev/rac/data01' [500.00 MB] inherit

  ACTIVE            '/dev/rac/data02' [500.00 MB] inherit

  ACTIVE            '/dev/rac/data03' [500.00 MB] inherit

  ACTIVE            '/dev/rac/data04' [500.00 MB] inherit

  ACTIVE            '/dev/rac/data05' [500.00 MB] inherit

  ACTIVE            '/dev/rac/spfile' [100.00 MB] inherit



[root@rac1 ~]# vi /etc/udev/rules.d/60-raw.rules


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


[root@rac1 ~]# 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/undotbs1

/dev/raw/raw10 /dev/rac/undotbs2

/dev/raw/raw11 /dev/rac/temp

/dev/raw/raw12 /dev/rac/control01

/dev/raw/raw13 /dev/rac/control02

/dev/raw/raw14 /dev/rac/control03

/dev/raw/raw15 /dev/rac/redo01

/dev/raw/raw16 /dev/rac/redo02

/dev/raw/raw17 /dev/rac/redo03

/dev/raw/raw18 /dev/rac/redo04

/dev/raw/raw19 /dev/rac/redo05

/dev/raw/raw20 /dev/rac/redo06

/dev/raw/raw21 /dev/rac/data01

/dev/raw/raw22 /dev/rac/data02

/dev/raw/raw23 /dev/rac/data03

/dev/raw/raw24 /dev/rac/data04

/dev/raw/raw25 /dev/rac/data05

/dev/raw/raw26 /dev/rac/spfile


[root@rac1 Server]# /etc/init.d/rawdevices restart

Assigning devices:

           /dev/raw/raw1  -->   /dev/rac/ocr01

/dev/raw/raw1:  bound to major 253, minor 0

           /dev/raw/raw2  -->   /dev/rac/ocr02

/dev/raw/raw2:  bound to major 253, minor 1

           /dev/raw/raw3  -->   /dev/rac/vote01

/dev/raw/raw3:  bound to major 253, minor 2

           /dev/raw/raw4  -->   /dev/rac/vote02

/dev/raw/raw4:  bound to major 253, minor 3

           /dev/raw/raw5  -->   /dev/rac/vote03

/dev/raw/raw5:  bound to major 253, minor 4

           /dev/raw/raw6  -->   /dev/rac/system

/dev/raw/raw6:  bound to major 253, minor 5

           /dev/raw/raw7  -->   /dev/rac/sysaux

/dev/raw/raw7:  bound to major 253, minor 6

           /dev/raw/raw8  -->   /dev/rac/users

/dev/raw/raw8:  bound to major 253, minor 7

           /dev/raw/raw9  -->   /dev/rac/undotbs1

/dev/raw/raw9:  bound to major 253, minor 8

           /dev/raw/raw10  -->   /dev/rac/undotbs2

/dev/raw/raw10: bound to major 253, minor 9

           /dev/raw/raw11  -->   /dev/rac/temp

/dev/raw/raw11: bound to major 253, minor 10

           /dev/raw/raw12  -->   /dev/rac/control01

/dev/raw/raw12: bound to major 253, minor 11

           /dev/raw/raw13  -->   /dev/rac/control02

/dev/raw/raw13: bound to major 253, minor 12

           /dev/raw/raw14  -->   /dev/rac/control03

/dev/raw/raw14: bound to major 253, minor 13

           /dev/raw/raw15  -->   /dev/rac/redo01

/dev/raw/raw15: bound to major 253, minor 14

           /dev/raw/raw16  -->   /dev/rac/redo02

/dev/raw/raw16: bound to major 253, minor 15

           /dev/raw/raw17  -->   /dev/rac/redo03

/dev/raw/raw17: bound to major 253, minor 16

           /dev/raw/raw18  -->   /dev/rac/redo04

/dev/raw/raw18: bound to major 253, minor 17

           /dev/raw/raw19  -->   /dev/rac/redo05

/dev/raw/raw19: bound to major 253, minor 18

           /dev/raw/raw20  -->   /dev/rac/redo06

/dev/raw/raw20: bound to major 253, minor 19

           /dev/raw/raw21  -->   /dev/rac/data01

/dev/raw/raw21: bound to major 253, minor 20

           /dev/raw/raw22  -->   /dev/rac/data02

/dev/raw/raw22: bound to major 253, minor 21

           /dev/raw/raw23  -->   /dev/rac/data03

/dev/raw/raw23: bound to major 253, minor 22

           /dev/raw/raw24  -->   /dev/rac/data04

/dev/raw/raw24: bound to major 253, minor 23

           /dev/raw/raw25  -->   /dev/rac/data05

/dev/raw/raw25: bound to major 253, minor 24

           /dev/raw/raw26  -->   /dev/rac/spfile

/dev/raw/raw26: bound to major 253, minor 25

done


[root@rac1 Server]# ls -al /dev/raw/raw*

crw-rw---- 1 oracle oinstall 162,  1 Dec  6 20:48 /dev/raw/raw1

crw-rw---- 1 oracle oinstall 162, 10 Dec  6 20:48 /dev/raw/raw10

crw-rw---- 1 oracle oinstall 162, 11 Dec  6 20:48 /dev/raw/raw11

crw-rw---- 1 oracle oinstall 162, 12 Dec  6 20:48 /dev/raw/raw12

crw-rw---- 1 oracle oinstall 162, 13 Dec  6 20:48 /dev/raw/raw13

crw-rw---- 1 oracle oinstall 162, 14 Dec  6 20:48 /dev/raw/raw14

crw-rw---- 1 oracle oinstall 162, 15 Dec  6 20:48 /dev/raw/raw15

crw-rw---- 1 oracle oinstall 162, 16 Dec  6 20:48 /dev/raw/raw16

crw-rw---- 1 oracle oinstall 162, 17 Dec  6 20:48 /dev/raw/raw17

crw-rw---- 1 oracle oinstall 162, 18 Dec  6 20:48 /dev/raw/raw18

crw-rw---- 1 oracle oinstall 162, 19 Dec  6 20:48 /dev/raw/raw19

crw-rw---- 1 oracle oinstall 162,  2 Dec  6 20:48 /dev/raw/raw2

crw-rw---- 1 oracle oinstall 162, 20 Dec  6 20:48 /dev/raw/raw20

crw-rw---- 1 oracle oinstall 162, 21 Dec  6 20:48 /dev/raw/raw21

crw-rw---- 1 oracle oinstall 162, 22 Dec  6 20:48 /dev/raw/raw22

crw-rw---- 1 oracle oinstall 162, 23 Dec  6 20:48 /dev/raw/raw23

crw-rw---- 1 oracle oinstall 162, 24 Dec  6 20:48 /dev/raw/raw24

crw-rw---- 1 oracle oinstall 162, 25 Dec  6 20:48 /dev/raw/raw25

crw-rw---- 1 oracle oinstall 162, 26 Dec  6 20:48 /dev/raw/raw26

crw-rw---- 1 oracle oinstall 162,  3 Dec  6 20:48 /dev/raw/raw3

crw-rw---- 1 oracle oinstall 162,  4 Dec  6 20:48 /dev/raw/raw4

crw-rw---- 1 oracle oinstall 162,  5 Dec  6 20:48 /dev/raw/raw5

crw-rw---- 1 oracle oinstall 162,  6 Dec  6 20:48 /dev/raw/raw6

crw-rw---- 1 oracle oinstall 162,  7 Dec  6 20:48 /dev/raw/raw7

crw-rw---- 1 oracle oinstall 162,  8 Dec  6 20:48 /dev/raw/raw8

crw-rw---- 1 oracle oinstall 162,  9 Dec  6 20:48 /dev/raw/raw9


[root@rac1 ~]# vi /etc/modprobe.conf


options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180


[root@rac1 ~]# modprobe -v hangcheck-timer

insmod /lib/modules/2.6.18-238.el5/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=30 hangcheck_margin=180


[root@rac1 ~]# vi /etc/rc.local


/sbin/modprobe -v hangcheck-timer

rdate -s 203.248.240.140


[root@rac1 ~]# vi /etc/sysconfig/ntpd


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


[root@rac1 Server]# service ntpd restart


Shutting down ntpd:                                        [  OK  ]

ntpd: Synchronizing with time server:                      [  OK  ]

Starting ntpd:                                             [  OK  ]



[root@rac1 Server]# chkconfig --level 123456 ntpd on


1. RAC1 node 종료 후 vmdk, vmx 파일 복사

2. VMware Home – Open a Virtual Machine

3. 복사한 vmx 파일 열기   

4. Edit virtual machine setting

5. Options – virtual machine name 수정 (RAC2)

6. OK

7. Power on this virtual machine

8. I copied it

9. root 계정으로 login 

10. RAC2 node 부팅 완료 후 RAC1 node 부팅


'스터디북' 카테고리의 다른 글

<12/19> 주말 자습 Oracle 11gR2 설치  (0) 2015.12.19
<12/13> 주말 자습 성능고도화 1장 및 RAC 설치  (0) 2015.12.14
<12/11> EXA DATA MACHINE - 5  (0) 2015.12.11
<12/10> EXA DATA MACHINE - 4  (0) 2015.12.10
<12/09> Love Girl  (0) 2015.12.09