利用ASMLib创建ASM磁盘实践心得

环境:RHEL 6.5 + Oracle 11.2.0.4 RAC(2 nodes)
目的:在实验环境使用ASMLib配置共享ASM磁盘,虽然我们已经不建议使用ASMLib进行绑盘,但是无奈有客户是这样做的,而作为一名合格的乙方技术人员,我们是需要熟悉不同技术(包括这种已经不再推荐使用的技术)从而更好的为甲方服务。

1.安装ASMLib相关包
2.配置ASMLib
3.安装GI时选择ASM磁盘

1.安装ASMLib相关包

安装ASMLib一共需要3个rpm包,分别是kmod-oracleasm,oracleasmlib和oracleasm-support,注意选择合适的版本安装,比如我这里环境:
[root@linuxidcrac1 tmp]# rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
warning: oracleasm-support-2.1.8-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
  1:oracleasm-support      ########################################### [100%]
[root@linuxidcrac1 tmp]# rpm -ivh kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64.rpm
warning: kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
  1:kmod-oracleasm        ########################################### [100%]
[root@linuxidcrac1 tmp]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
  1:oracleasmlib          ########################################### [100%]
[root@linuxidcrac1 tmp]#

节点2用同样的步骤安装这三个rpm软件包,不再赘述。

2.配置ASMLib

2.1 ASMLib的配置如下:
[root@linuxidcrac1 ~]# /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 [grid]:
Default group to own the driver interface [asmadmin]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks:
[  OK  ]

--节点2同样:
[root@linuxidcrac2 ~]# /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 []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [y]: 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  ]

2.2 使用oracleasm createdisk创建ASM磁盘:
[root@linuxidcrac1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "VOL1" as an ASM disk: [  OK  ]
[root@linuxidcrac1 ~]# /etc/init.d/oracleasm deletedisk VOL1
Removing ASM disk "VOL1": [  OK  ]

--我这里环境有7块盘,ASMLib使用的盘需要分区,每块盘整个分一个区即可:
/etc/init.d/oracleasm createdisk OCR1 /dev/sdb1
/etc/init.d/oracleasm createdisk OCR2 /dev/sdc1
/etc/init.d/oracleasm createdisk OCR3 /dev/sdd1
/etc/init.d/oracleasm createdisk DATA1 /dev/sde1
/etc/init.d/oracleasm createdisk DATA2 /dev/sdf1
/etc/init.d/oracleasm createdisk DATA3 /dev/sdg1
/etc/init.d/oracleasm createdisk FRA1 /dev/sdh1

2.3 使用oracleasm scandisks扫盘然后listdisks列出
/etc/init.d/oracleasm scandisks
 /etc/init.d/oracleasm listdisks
[root@linuxidcrac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [  OK  ]
[root@linuxidcrac2 ~]# /etc/init.d/oracleasm listdisks
DATA1
DATA2
DATA3
FRA1
OCR1
OCR2
OCR3
[root@linuxidcrac2 ~]#

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/5f06fb15c499d1681237a2b97126aa8f.html