OS환경 : Oracle Linux6.8(64bit)
DB 환경 : Oracle Database 11.2.0.4
방법 : asmca silent mode 디스크 생성, 추가, 삭제
*참고
#는 root 계정
$는 oracle 계정임
패키지 설치
1 2 | # yum install oracleasm-support* -y # rpm -Uvh /oracle/media/oracleasmlib-2.0.12-1.el6.x86_64.rpm |
디스크 포맷
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | $ fdisk /dev/sdb n p 1 엔터 엔터 w 반복 fdisk /dev/sdc fdisk /dev/sdd fdisk /dev/sde fdisk /dev/sdf fdisk /dev/sdg 확인 fdisk -l |
Oracle ASM 설정 및 시작
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # /etc/init.d/oracleasm configure 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 []: oracle Default group to own the driver interface []: oinstall 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 Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ] |
oracle, oinstall, y, y 순서대로 입력
oracleasm enable 및 시작
1 2 3 4 5 6 7 8 | # /etc/init.d/oracleasm enable Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ] # /etc/init.d/oracleasm start Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ] |
공유 디스크 생성
1 2 3 4 5 6 7 8 9 10 11 12 | # /etc/init.d/oracleasm createdisk ocr_vote01 /dev/sdb1 Marking disk "ocr_vote01" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk ocr_vote02 /dev/sdc1 Marking disk "ocr_vote02" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk ocr_vote03 /dev/sdd1 Marking disk "ocr_vote03" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk asm01 /dev/sde1 Marking disk "asm01" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk asm02 /dev/sdf1 Marking disk "asm02" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk fra01 /dev/sdg1 Marking disk "fra01" as an ASM disk: [ OK ] |
asm 디스크 스캔 및 확인
1 2 3 4 5 6 7 8 9 10 | # /etc/init.d/oracleasm scandisks Scanning the system for Oracle ASMLib disks: [ OK ] # /etc/init.d/oracleasm listdisks ASM01 ASM02 FRA01 OCR_VOTE01 OCR_VOTE02 OCR_VOTE03 |
권한부여
1 | chown -R oracle:oinstall /dev/oracleasm/ |
오라클 계정으로 진행
디스크 생성
asmca create slient 스크립트 및 실행
(ORADATA라는 디스크그룹에 ASM01, ASM02를 넣어 생성)
1 2 3 4 5 6 7 8 9 10 11 12 | $ cat asmca_create.sh asmca -silent -createDiskGroup \ -diskGroupName ORADATA \ -diskList 'ORCL:ASM01,ORCL:ASM02' \ -redundancy Nomal \ -au_size 4 -compatible.asm 11.2 \ -compatible.rdbms 11.2 \ -sysAsmPassword oracle $ sh asmca_create.sh Disk Group ORADATA created successfully. |
디스크 추가
asmca add slient 스크립트 및 실행
(ORADATA라는 디스크그룹에 FRA01이라는 디스크를추가)
1 2 3 4 5 6 7 8 9 10 11 12 | $ cat asmca_add.sh asmca -silent -addDisk \ -diskGroupName ORADATA \ -diskList 'ORCL:FRA01' \ -redundancy Normal \ -au_size 4 -compatible.asm 11.2 \ -compatible.rdbms 11.2 \ -sysAsmPassword oracle $ sh asmca_add.sh Disks added successfully to disk group ORADATA |
디스크 삭제
개별 디스크 삭제옵션(deleteDisk)은 제공하지 않고 모든 ASM 인스턴스를 삭제하는 기능(deleteASM)만 제공한다.
Delete Oracle ASM Instances
-deleteASM deletes all the Oracle ASM instances that are present.
The operation stops and an error is raised if there is a database using the Oracle ASM instance.
해석
-deleteASM 명령어 : 존재하는 모든 Oracle ASM 인스턴스를 삭제합니다.
작업이 중지되고 Oracle ASM 인스턴스를 사용하는 데이터베이스가 있으면 오류가 발생합니다.
참조 :
http://www.dbaexpert.com/blog/create-diskgroup-with-asmca-command-line/
https://docs.oracle.com/cd/E11882_01/server.112/e18951/asmca.htm
https://docs.oracle.com/cd/E11882_01/server.112/e18951/asmca.htm#CHDGHCEH'ORACLE > Admin' 카테고리의 다른 글
SELECT, UPDATE 도중 파티션 exchange 변경 시 발생하는 현상 확인 (0) | 2019.01.08 |
---|---|
오라클 bdump 로그 정리 방법 (0) | 2019.01.07 |
ASM 디스크 추가 및 삭제하기 (0) | 2018.12.27 |
오라클 reorg, hwm, shrink, move 설명 및 테스트 (6) | 2018.12.26 |
오라클 기초 정리 (4) | 2018.12.19 |