Oracle ASM Filter Driver(asmfd) 是oracle 12c gi 开始提供的一个内核模块位于oracle asm disk io 请求路径之中,asmfd 屏蔽任何非oracle 产生的io 写请求,降低了oracle asm 磁盘由于意外覆写导致的数据丢失风险,简化了oracle asm 磁盘权限与名称固定所需的一系列配置,用于取代asmlib 以及udev 手动编写规则文件。asmfd 也减少了asm 用于数据库io所需的文件描述符,降低了os 资源消耗。
Oracle asmfd 主要支持Linux、Solaris 2种操作系统平台,部署之前需确保操作系统以及内核版本在受支持范围之内:
这里以oracle linux 8.6、oracle database 19c为例实施asmfd:
1、首先部署好gi、db软件环境,确保更新补丁至最新。
如没有更新补丁,配置asmfd 会出现如下不支持错误:
ASMCMD-9520: AFD is not 'supported'
2、配置asm filter driver。
a、 首先确保oracle restart 或clusterware 服务处于停止状态:
oracle restart 停止has:
# /u01/app/19.3.0/grid/bin/crsctl stop has
oracle clusterware 停止crs:
# /u01/app/19.3.0/grid/bin/crsctl stop crs -all
b、以root 账号配置asmfd:
[root@zjg-dba-bidbdr ~]# export ORACLE_HOME=/u01/app/19.3.0/grid/
[root@zjg-dba-bidbdr ~]# export ORACLE_BASE=/tmp
[root@zjg-dba-bidbdr ~]# /u01/app/19.3.0/grid/bin/asmcmd afd_configure
AFD-627: AFD distribution files found.
AFD-634: Removing previous AFD installation.
AFD-635: Previous AFD components successfully removed.
AFD-9294: updating file /etc/sysconfig/oracledrivers.conf
AFD-636: Installing requested AFD software.
AFD-637: Loading installed AFD drivers.
AFD-9321: Creating udev for AFD.
AFD-9323: Creating module dependencies - this may take some time.
AFD-9154: Loading 'oracleafd.ko' driver.
AFD-649: Verifying AFD devices.
AFD-9156: Detecting control device '/dev/oracleafd/admin'.
AFD-638: AFD installation correctness verified.
Modifying resource dependencies - this may take some time.
[root@zjg-dba-bidbdr ~]# /u01/app/19.3.0/grid/bin/asmcmd afd_state
ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'zjg-dba-bidbdr'
asmfd 配置好后,会在/etc/udev/rules.d 目录下产生udev规则文件53-afd.rules,内容如下:
#
# AFD devices
KERNEL=="oracleafd/.*", OWNER="grid", GROUP="asmadmin", MODE="0770"
KERNEL=="oracleafd/*", OWNER="grid", GROUP="asmadmin", MODE="0770"
KERNEL=="oracleafd/disks/*", OWNER="grid", GROUP="asmadmin", MODE="0660"
c、如要移除asmfd,需确保has、crs 服务堆栈处于关闭状态,以root账号执行:
[root@zjg-dba-bidbdr ~]# /u01/app/19.3.0/grid/bin/acfsload stop
[root@zjg-dba-bidbdr ~]# /u01/app/19.3.0/grid/bin/asmcmd afd_deconfigure
AFD-632: Existing AFD installation detected.
AFD-634: Removing previous AFD installation.
AFD-635: Previous AFD components successfully removed.
Modifying resource dependencies - this may take some time.
d、标识asm 磁盘:
[root@zjg-dba-bidbdr ~]# /u01/app/19.3.0/grid/bin/asmcmd afd_label data1 /dev/sdb
[root@zjg-dba-bidbdr ~]# /u01/app/19.3.0/grid/bin/asmcmd afd_lslbl /dev/sdb
--------------------------------------------------------------------------------
Label Duplicate Path
================================================================================
DATA1 /dev/sdb
e、确保has、crs 服务堆栈处于启动状态,以grid 用户执行asmca 创建asm 实例以及磁盘组:
标签:AFD,Driver,Filter,oracle,grid,dba,Oracle,bidbdr,root From: https://www.cnblogs.com/oradba/p/16868818.html