Oracle/RAC

Oracle-RAC(RHEL4, raw device, 10g) #3 Node1, Node2 Setting

에몽이ㅋ 2012. 3. 7. 00:05

http://gyh214.tistory.com/142 와 디스크 파티션만 빼고 동일합니다.(사실 디스크 파티션도 거의 동일합니다.)

차이점은 raw device의 경우
파일 하나당 하나의 논리디스크를 할당해주는 점입니다.

13. 디스크들 파티션설정(root로 실행하세요) 

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


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): w

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.

(위와 같이 /dev/sdc,  /dev/sdd 로 작업하세요)



14. pvcreate
[root@rac1 ~]# pvcreate /dev/sdb /dev/sdc /dev/sdd
  Physical volume "/dev/sdb" successfully created
  Physical volume "/dev/sdc" successfully created
  Physical volume "/dev/sdd" successfully created


15. vgcreate
[root@rac1 ~]# vgcreate rac /dev/sdb /dev/sdc /dev/sdd
  Volume group "rac" successfully created


16. 데이터파일을 위한 논리디스크할당(루트권한으로 긁어서 실행시키세요)
lvcreate --name ocr --size 200 rac
lvcreate --name vote --size 50 rac
lvcreate --name system --size 600 rac
lvcreate --name sysaux --size 1200 rac
lvcreate --name spfile --size 50 rac
lvcreate --name passwd --size 50 rac
lvcreate --name control1 --size 200 rac
lvcreate --name control2 --size 200 rac
lvcreate --name control3 --size 200 rac
lvcreate --name redo1_1 --size 200 rac
lvcreate --name redo1_2 --size 200 rac
lvcreate --name redo2_1 --size 200 rac
lvcreate --name redo2_2 --size 200 rac
lvcreate --name temp --size 600 rac
lvcreate --name undo1 --size 600 rac
lvcreate --name undo2 --size 600 rac
lvcreate --name data --size 1000 rac
lvcreate --name users --size 250 rac
lvcreate --name example --size 200 rac 

(잘못만들었으면 지우고 다시만드세요)

[root@rac1 ~]# lvremove '/dev/rac/undo1'
Do you really want to remove active logical volume "undo1"? [y/n]: y
  Logical volume "undo1" successfully removed
[root@rac1 ~]# lvremove '/dev/rac/undo2'
Do you really want to remove active logical volume "undo2"? [y/n]: y
  Logical volume "undo2" successfully removed
[root@rac1 ~]# lvcreate --name undo1 --size 600 rac
  Logical volume "undo1" created
[root@rac1 ~]# lvcreate --name undo2 --size 600 rac
  Logical volume "undo2" created


잘 만들어졌나 확인
[root@rac1 ~]# lvscan
  ACTIVE            '/dev/rac/ocr' [200.00 MB] inherit
  ACTIVE            '/dev/rac/vote' [52.00 MB] inherit
  ACTIVE            '/dev/rac/system' [600.00 MB] inherit
  ACTIVE            '/dev/rac/sysaux' [1.17 GB] inherit
  ACTIVE            '/dev/rac/spfile' [52.00 MB] inherit
  ACTIVE            '/dev/rac/passwd' [52.00 MB] inherit
  ACTIVE            '/dev/rac/control1' [200.00 MB] inherit
  ACTIVE            '/dev/rac/control2' [200.00 MB] inherit
  ACTIVE            '/dev/rac/control3' [200.00 MB] inherit
  ACTIVE            '/dev/rac/redo1_1' [200.00 MB] inherit
  ACTIVE            '/dev/rac/redo1_2' [200.00 MB] inherit
  ACTIVE            '/dev/rac/redo2_1' [200.00 MB] inherit
  ACTIVE            '/dev/rac/redo2_2' [200.00 MB] inherit
  ACTIVE            '/dev/rac/temp' [200.00 MB] inherit
  ACTIVE            '/dev/rac/data' [1000.00 MB] inherit
  ACTIVE            '/dev/rac/users' [252.00 MB] inherit
  ACTIVE            '/dev/rac/example' [200.00 MB] inherit
  ACTIVE            '/dev/rac/undo1' [600.00 MB] inherit
  ACTIVE            '/dev/rac/undo2' [600.00 MB] inherit


17. vi /etc/sysconfig/rawdevices
/dev/raw/raw1   /dev/rac/ocr
/dev/raw/raw2   /dev/rac/vote
/dev/raw/raw3   /dev/rac/system
/dev/raw/raw4   /dev/rac/sysaux
/dev/raw/raw5   /dev/rac/spfile
/dev/raw/raw6   /dev/rac/passwd
/dev/raw/raw7   /dev/rac/control1
/dev/raw/raw8   /dev/rac/control2
/dev/raw/raw9   /dev/rac/control3
/dev/raw/raw10  /dev/rac/redo1_1
/dev/raw/raw11  /dev/rac/redo1_2
/dev/raw/raw12  /dev/rac/redo2_1
/dev/raw/raw13  /dev/rac/redo2_2
/dev/raw/raw14  /dev/rac/data
/dev/raw/raw15  /dev/rac/users
/dev/raw/raw16  /dev/rac/example
/dev/raw/raw17  /dev/rac/undo1
/dev/raw/raw18  /dev/rac/undo2
/dev/raw/raw19  /dev/rac/temp



18. /etc/init.d/rawdevices restart

19. vi /etc/udev/permissions.d/50-udev.permissions
113번줄
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660
로 변경(raw device를 oracle user도 사용할 수 있게 지정)


20.  /etc/init.d/rawdevices restart 

21. 확인
[root@rac1 ~]# ls -l /dev/raw
합계 0
crw-rw----  1 oracle dba 162,  1  3월  7 00:06 raw1
crw-rw----  1 oracle dba 162, 10  3월  7 00:06 raw10
crw-rw----  1 oracle dba 162, 11  3월  7 00:06 raw11
crw-rw----  1 oracle dba 162, 12  3월  7 00:06 raw12
crw-rw----  1 oracle dba 162, 13  3월  7 00:06 raw13
crw-rw----  1 oracle dba 162, 14  3월  7 00:06 raw14
crw-rw----  1 oracle dba 162, 15  3월  7 00:06 raw15
crw-rw----  1 oracle dba 162, 16  3월  7 00:06 raw16
crw-rw----  1 oracle dba 162, 17  3월  7 00:06 raw17
crw-rw----  1 oracle dba 162, 18  3월  7 00:06 raw18
crw-rw----  1 oracle dba 162, 19  3월  7 00:06 raw19
crw-rw----  1 oracle dba 162,  2  3월  7 00:06 raw2
crw-rw----  1 oracle dba 162,  3  3월  7 00:06 raw3
crw-rw----  1 oracle dba 162,  4  3월  7 00:06 raw4
crw-rw----  1 oracle dba 162,  5  3월  7 00:06 raw5
crw-rw----  1 oracle dba 162,  6  3월  7 00:06 raw6
crw-rw----  1 oracle dba 162,  7  3월  7 00:06 raw7
crw-rw----  1 oracle dba 162,  8  3월  7 00:06 raw8
crw-rw----  1 oracle dba 162,  9  3월  7 00:06 raw9

이후 node1 shutdown 후 node2 작업

http://gyh214.tistory.com/142 의 node 2 setting 과 동일합니다.