1.Log in as the root user
and set the environment variable
$ORACLE_HOME to the location of the Grid home
and the environment variable $ORACLE_BASE to a temporary location.
su root
set ORACLE_HOME=/u01/app/19.1.0/grid
set ORACLE_BASE=/tmp
You set $ORACLE_BASE to a temporary location to avoid creating diagnostic or trace files in the Grid home
before the Oracle Grid Infrastructure installation.
2.Use Oracle ASM command line tool (ASMCMD) to provision the disk devices for use with Oracle ASM Filter Driver.
./u01/app/19.1.0/grid/bin/asmcmd afd_label DATA1 /dev/sdb --init
./u01/app/19.1.0/grid/bin/asmcmd afd_label DATA2 /dev/sdc --init
./u01/app/19.1.0/grid/bin/asmcmd afd_label DATA3 /dev/sdd --init
3.Verify the device has been marked for use with Oracle ASMFD.
./u01/app/19.1.0/grid/bin/asmcmd afd_lslbl /dev/sdb
./u01/app/19.1.0/grid/bin/asmcmd afd_lslbl /dev/sdc
./u01/app/19.1.0/grid/bin/asmcmd afd_lslbl /dev/sdd
4.Unset the ORACLE_BASE environment variable.
之后,我们在安装gi时,asm的磁盘,就可以选择:/dev/sdb,/dev/sdc;/dev/sdd了。
如果去查看 /dev/oracleafd,就会发现新的盘了:
[root@rac1 ~]# ls -ltr /dev/oracleafd/disks
total 28
-rw-rw-r--. 1 grid oinstall 9 Nov 5 17:19 DATA1
-rw-rw-r--. 1 grid oinstall 9 Nov 5 17:19 DATA2
-rw-rw-r--. 1 grid oinstall 9 Nov 5 17:19 DATA3