1. 스토리지 파일 생성
공유 스토리지 구성을 위해 고정 공간이 할당된 가상 디스크 10개를 추가로 생성합니다. CRS1.vdi DATA1.vdi파일 이름 용량 타입 용도 비고 1GB Fixed / Shareable CRS 저장 영역 공유(shareable) 디스크로 사용하기 위해서 Fixed Size로 생성합니다. CRS2.vdi 1GB Fixed / Shareable CRS3.vdi 1GB Fixed / Shareable 10GB Fixed / Shareable Data 저장 영역 DATA2.vdi 10GB Fixed / Shareable DATA3.vdi 10GB Fixed / Shareable DATA4.vdi 10GB Fixed / Shareable FRA1.vdi 10GB Fixed / Shareable Fast Recovery Area FRA2.vdi 10GB Fixed / Shareable
vboxmanage createmedium --filename CRS1.vdi --size 1024 --format VDI --variant Fixed vboxmanage createmedium --filename CRS2.vdi --size 1024 --format VDI --variant Fixed vboxmanage createmedium --filename CRS3.vdi --size 1024 --format VDI --variant Fixed vboxmanage createmedium --filename DATA1.vdi --size 10240 --format VDI --variant Fixed vboxmanage createmedium --filename DATA2.vdi --size 10240 --format VDI --variant Fixed vboxmanage createmedium --filename DATA3.vdi --size 10240 --format VDI --variant Fixed vboxmanage createmedium --filename DATA4.vdi --size 10240 --format VDI --variant Fixed vboxmanage createmedium --filename FRA1.vdi --size 10240 --format VDI --variant Fixed vboxmanage createmedium --filename FRA2.vdi --size 10240 --format VDI --variant Fixed
> vboxmanage createmedium --filename CRS1.vdi --size 1024 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 05fac8f3-82bf-4d16-9bab-5c807e8e10c1 > vboxmanage createmedium --filename CRS2.vdi --size 1024 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 17390b86-52ce-4a19-91fa-ef3839b72079 > vboxmanage createmedium --filename CRS3.vdi --size 1024 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 0ec7e9d2-038d-4779-8acf-b66d0c50733b > vboxmanage createmedium --filename DATA1.vdi --size 10240 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 8b8429f8-3645-4977-a29b-532fd087c4b0 > vboxmanage createmedium --filename DATA2.vdi --size 10240 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: a05be071-77c4-4d98-816c-797cc239991e > vboxmanage createmedium --filename DATA3.vdi --size 10240 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 63f97a6f-9ad0-4108-809a-b6eca51774f3 > vboxmanage createmedium --filename DATA4.vdi --size 10240 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 6e06d04b-3d2d-4583-8ee7-43a20f877e6d > vboxmanage createmedium --filename FRA1.vdi --size 10240 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: de3e522e-b4fa-4432-8a53-741b06c8f2b3 > vboxmanage createmedium --filename FRA2.vdi --size 10240 --format VDI --variant Fixed 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 366d1a5c-9046-4cc8-b96c-d6553f4b449f
호스트 머신에서 cmd 명령어를 사용해서 창을 열고 작업을 진행합니다.
vboxmanage.exe 파일 위치에 대한 PATH 설정이 되어 있으면 경로를 입력하지 않아도 바로 아무 디렉토리에서나 실행할 수 있습니다.
2. 공유 모드 적용
vboxmanage modifymedium CRS1.vdi --type shareable vboxmanage modifymedium CRS2.vdi --type shareable vboxmanage modifymedium CRS3.vdi --type shareable vboxmanage modifymedium DATA1.vdi --type shareable vboxmanage modifymedium DATA2.vdi --type shareable vboxmanage modifymedium DATA3.vdi --type shareable vboxmanage modifymedium DATA4.vdi --type shareable vboxmanage modifymedium FRA1.vdi --type shareable vboxmanage modifymedium FRA2.vdi --type shareable
> vboxmanage modifymedium CRS1.vdi --type shareable > vboxmanage modifymedium CRS2.vdi --type shareable > vboxmanage modifymedium CRS3.vdi --type shareable > vboxmanage modifymedium DATA1.vdi --type shareable > vboxmanage modifymedium DATA2.vdi --type shareable > vboxmanage modifymedium DATA3.vdi --type shareable > vboxmanage modifymedium DATA4.vdi --type shareable > vboxmanage modifymedium FRA1.vdi --type shareable > vboxmanage modifymedium FRA2.vdi --type shareable
디스크 모드를 모두 shareable로 변경합니다.
참고로 shareable로 설정하기 위해서는 반드시 가상 디스크 드라이브를 고정 크기(Fixed)로 생성해줘야 합니다
3. VM에 추가
A) 저장소
VM에 새로 만든 공유 디스크들을 추가합니다.
VM 설정에 들어가서 ‘저장소’ 항목으로 이동한 후에 ‘SATA 컨트롤러’옆에 있는 ‘하드 디스크 추가하기’ 아이콘을 클릭합니다.
<기존 디스크 선택하기>를 클릭합니다
탐색창에서 생성한 디스크 이미지가 있는 경로로 찾아가서 추가할 디스크 파일을 선택한 후 <열기>를 클릭합니다
디스크 파일이 SATA 콘트롤러에 추가된 것을 확인할 수 있습니다.
같은 방법으로 나머지 디스크들도 모두 추가하고, 완료가 되었으면 <OK>를 클릭합니다.
4. ASM 환경 구성
A) ASMLib 설치
rpm -ivh oracleasmlib*.rpm
[root@rac1 sf_oracle]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm 경고: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 준비 중... ########################################### [100%] 1:oracleasmlib ########################################### [100%]
oracleasmlib 패키지를 설치 합니다.
설치 파일은 아래의 주소에서 다운 받을 수 있습니다.
http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html
B) ASM 환경 설정
oracleasm configure -i ### "grid", "asmadmin", "y", "엔터" 입력 oracleasm init oracleasm configure
[root@rac1 ~]# 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 []: asmadmin 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@rac1 ~]# oracleasm init [root@rac1 ~]# oracleasm configure ORACLEASM_ENABLED=true ORACLEASM_UID=grid ORACLEASM_GID=asmadmin ORACLEASM_SCANBOOT=true ORACLEASM_SCANORDER="" ORACLEASM_SCANEXCLUDE="" ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
ASM library에 대한 추가적인 환경 설정(사용자, 그룹, 부팅시 활성화, 부팅시 스캔 여부)을 해줍니다.
5. 공유 스토리지 포맷
fdisk /dev/sdb ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdc ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdd ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sde ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdf ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdg ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdh ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdi ### "n", "p", "1", "엔터", "엔터", "w" 입력 fdisk /dev/sdj ### "n", "p", "1", "엔터", "엔터", "w" 입력 ls /dev/sd*
[root@rac1 sf_oracle]# ls /dev/sd* /dev/sda /dev/sda2 /dev/sdb /dev/sdd /dev/sdf /dev/sdh /dev/sdj /dev/sda1 /dev/sda3 /dev/sdc /dev/sde /dev/sdg /dev/sdi [root@rac1 sf_oracle]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-130, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): Using default value 130 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdc Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-130, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): Using default value 130 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdd Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-130, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): Using default value 130 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sde Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 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): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdf Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 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): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdg Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 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): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdh Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 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): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdi Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 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): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# fdisk /dev/sdj Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 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): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@rac1 sf_oracle]# ls /dev/sd* /dev/sda /dev/sdb /dev/sdd /dev/sdf /dev/sdh /dev/sdj /dev/sda1 /dev/sdb1 /dev/sdd1 /dev/sdf1 /dev/sdh1 /dev/sdj1 /dev/sda2 /dev/sdc /dev/sde /dev/sdg /dev/sdi /dev/sda3 /dev/sdc1 /dev/sde1 /dev/sdg1 /dev/sdi1
VM에 연결된 디스크를 모두 포맷합니다.
디스크 전체를 모두 단일 파티션으로 포맷합니다.
6. ASM disk 생성
oracleasm createdisk CRS1 /dev/sdb1 oracleasm createdisk CRS2 /dev/sdc1 oracleasm createdisk CRS3 /dev/sdd1 oracleasm createdisk DATA1 /dev/sde1 oracleasm createdisk DATA2 /dev/sdf1 oracleasm createdisk DATA3 /dev/sdg1 oracleasm createdisk DATA4 /dev/sdh1 oracleasm createdisk FRA1 /dev/sdi1 oracleasm createdisk FRA2 /dev/sdj1 oracleasm scandisks oracleasm listdisks
[root@rac1 ~]# oracleasm createdisk CRS1 /dev/sdb1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk CRS2 /dev/sdc1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk CRS3 /dev/sdd1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk DATA1 /dev/sde1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk DATA2 /dev/sdf1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk DATA3 /dev/sdg1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk DATA4 /dev/sdh1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk FRA1 /dev/sdi1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm createdisk FRA2 /dev/sdj1 Writing disk header: done Instantiating disk: done [root@rac1 ~]# oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... [root@rac1 ~]# oracleasm listdisks CRS1 CRS2 CRS3 DATA1 DATA2 DATA3 DATA4 FRA1 FRA2
VM에 마운트된 디스크를 각각 ASM Disk로 할당해줍니다.
순서대로 마운트가 되었다면, 알파벳 순으로 디스크를 생성하면 됩니다
{}