Configuring Oracle 18c RAC Using NFS With ASM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Configuring Oracle 18c RAC Using NFS With ASM相关的知识,希望对你有一定的参考价值。

对于没有共享存储的环境下,可以使用基于NFS的ASM来配置RAC。这里简单描述如何在Oracle 18c RAC环境下配置基于NFS的ASM服务。

1、环境介绍

所用到的主机信息如图中所示:
技术分享图片

2、NFS Server配置

[[email protected] ~]# vi /etc/exports
/u02    *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
[[email protected] ~]# systemctl restart nfs
[[email protected] ~]# showmount -e
Export list for onas:
/u02 *

3、RAC节点挂载NFS共享

RAC节点分别编辑/etc/fstab文件,加入以下内容:

[[email protected] ~]# vi /etc/fstab
onas:/u02               /u02            nfs     rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
[[email protected] ~]# mount -a
[[email protected] ~]# vi /etc/fstab
onas:/u02               /u02            nfs     rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
[[email protected] ~]# mount -a

4、安装Grid组件

4.1 初始安装

具体的安装过程不做过多描述,只截取几张ASM部分的截图。
这里使用第二个选项“Configure ASM on NFS”,使用了此选项后,系统会自动创建共享磁盘。
技术分享图片
技术分享图片
指定OCR的位置,下一步。待Grid组件安装并配置完成后,默认会创建一块30G大小的磁盘ocrvfdgdisk0,用于OCRVFDG磁盘组,如下:

[[email protected] ~]# la /u02/asmrac/
total 33G
drwxr-xr-x 2 grid oinstall   40 Sep  4 17:05 .
drwxr-xr-x 8 root root     4.0K Sep  4 15:09 ..
-rw-rw---- 1 grid asmadmin  28G Sep  5 09:52 ocrvfdgdisk0

通过asmca图形界面查看,如下图所示:
技术分享图片

4.2 创建磁盘组

在共享目录下,创建了10块虚拟磁盘:asmdisk1~asmdisk10,分别演示使用asmca和命令行创建磁盘组。通过asmca图形界面创建data磁盘组,通过asmca命令创建fra磁盘组。
技术分享图片
技术分享图片

[[email protected] ~]$ asmca -silent -sysAsmPassword abcABC12 -asmsnmpPassword abcABC12 -createDiskGroup -diskString ‘/u02/asmrac‘ -diskGroupName fra -diskList /u02/asmrac/asmdisk6 -redundancy external -au_size 4
[INFO] [DBT-30001] Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-180905AM105833.log for details.
//添加磁盘
[[email protected] ~]$ asmca -silent -sysAsmPassword abcABC12 -asmsnmpPassword abcABC12 -addDisk -diskString ‘/u02/asmrac‘ -diskGroupName fra -diskList /u02/asmrac/asmdisk7,/u02/asmrac/asmdisk8,/u02/asmrac/asmdisk9 
[[email protected] ~]$ asmcmd lsdsk -t -G fra
Create_Date  Mount_Date  Repair_Timer  Path
05-SEP-18    05-SEP-18   0             /u02/asmrac/asmdisk6
05-SEP-18    05-SEP-18   0             /u02/asmrac/asmdisk7
05-SEP-18    05-SEP-18   0             /u02/asmrac/asmdisk8
05-SEP-18    05-SEP-18   0             /u02/asmrac/asmdisk9

5、使用ASMLib配置

5.1 创建虚拟共享磁盘

[[email protected] asmdisks]# for i in  {1..10};do dd if=/dev/zero of=/u02/asmrac/asmdisk$i bs=1024k count=10000;done
[[email protected] ~]# ll /u02/asmrac/
total 102400000
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk1
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk2
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk3
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk4
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk5
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk6
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk7
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk8
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk9
-rw-r--r-- 1 root root 10485760000 Sep  4 11:41 asmdisk10

5.2 配置ASMLib服务

在RAC各个节点分别配置asmlib服务,如下:

[email protected] ~]# 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 []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: 
Writing Oracle ASM library driver configuration: done
[[email protected] ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

5.3 创建块设备

如果使用asmlib,必须使用losetup命令创建块设备,如下:

[[email protected] ~]# for i in {1..10};do losetup /dev/loop$i /u02/asmdisks/asmdisk$i;done
[[email protected] ~]# ll /dev/loop*
brw-rw---- 1 root disk  7,   1 Sep  4 14:35 /dev/loop1
brw-rw---- 1 root disk  7,  10 Sep  4 14:35 /dev/loop10
brw-rw---- 1 root disk  7,   2 Sep  4 14:35 /dev/loop2
brw-rw---- 1 root disk  7,   3 Sep  4 14:35 /dev/loop3
brw-rw---- 1 root disk  7,   4 Sep  4 14:35 /dev/loop4
brw-rw---- 1 root disk  7,   5 Sep  4 14:35 /dev/loop5
brw-rw---- 1 root disk  7,   6 Sep  4 14:35 /dev/loop6
brw-rw---- 1 root disk  7,   7 Sep  4 14:35 /dev/loop7
brw-rw---- 1 root disk  7,   8 Sep  4 14:35 /dev/loop8
brw-rw---- 1 root disk  7,   9 Sep  4 14:35 /dev/loop9
crw-rw---- 1 root disk 10, 237 Sep  4 14:35 /dev/loop-control
[[email protected] ~]# for i in {1..10};do losetup /dev/loop$i /u02/asmdisks/asmdisk$i;done
[[email protected] ~]# ll /dev/loop*

5.4 创建ASM磁盘

[[email protected] ~]# for i in {1..10};do oracleasm createdisk vol$i /dev/loop$i;done
[[email protected] ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "VOL1"
Instantiating disk "VOL2"
Instantiating disk "VOL3"
Instantiating disk "VOL4"
Instantiating disk "VOL5"
Instantiating disk "VOL6"
Instantiating disk "VOL7"
Instantiating disk "VOL8"
Instantiating disk "VOL9"
Instantiating disk "VOL10"

5.5 使用ASM磁盘

在安装Grid组件时,在配置“Storage Option”中选择第一个选项“Configure ASM using block devices”,如下图:
技术分享图片
技术分享图片
技术分享图片

以上是关于Configuring Oracle 18c RAC Using NFS With ASM的主要内容,如果未能解决你的问题,请参考以下文章

18c 与 19c 上的 Oracle 编号问题

oracle database 18C 都来了~~~~

揭幕Oracle 18c新功能

极速体验:Oracle 18c 下载和Scalable Sequence新特性

Oracle Database 18c 配置助手失败

安装oracle 18c