從 12.1.0.2開始,oracle提供了一個 afd的東西,來替代asmlib庫和 udev用於asm磁盤的處理。oracle
也就是說,從12.1.0.2開始,要配置asm,在磁盤上,能夠不用去配置 udev,或者安裝 asmlib程序了,直接使用 afd便可搞定,這個afd是隨oracle安裝程序自帶的,不須要到其餘地方去下載,關鍵是使用 afd,啓用了 filter後,root用戶使用 dd 也不能破壞 disk,這點不錯。下面咱們在19c下面來操做一下 :app
1.Log in as the root userblog
and set the environment variableget
$ORACLE_HOME to the location of the Grid homecmd
and the environment variable $ORACLE_BASE to a temporary location.it
su rootio
set ORACLE_HOME=/u01/app/19.1.0/gridasm
set ORACLE_BASE=/tmpast
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