配置Oracle ASMFD

-- 参考文档:

How to configure and Create a Disk group using ASMFD (文档 ID 2053045.1)  
ASMFD: Implementing ASM Filter Driver after 12.2 GI Installation (文档 ID 2305707.1) 
https://docs.oracle.com/database/121/OSTMG/GUID-06B3337C-07A3-4B3F-B6CD-04F2916C11F6.htm

-- 操作系统版本

[grid@asm19c ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
[grid@asm19c ~]$

-- 数据库版本。Oracle restart 。

[oracle@asm19c ~]$ sqlplus /nolog

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 6 04:33:52 2020
Version 19.7.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> 

-- 查看是否支持AFD

[grid@asm19c ~]$ acfsdriverstate -orahome $ORACLE_HOME supported
ACFS-9200: Supported
[grid@asm19c ~]$

-- 检查AFD的状态,没有安装的话,需要安装配置下

# $ORACLE_HOME/bin/asmcmd afd_state
ASMCMD-9530: The AFD state is 'NOT INSTALLED'

--查看当前的配置 ,asm string是/dev/sd* ,设置asm string。

[grid@asm19c ~]$ asmcmd dsget
parameter:/dev/sd*
profile:/dev/sd*
[grid@asm19c ~]$

[grid@asm19c ~]$ asmcmd dsset /dev/sd*,'AFD:*'
[grid@asm19c ~]$ asmcmd dsget
parameter:/dev/sd*, AFD:*
profile:/dev/sd*,AFD:*

-- 停掉crs

[root@asm19c grid]# crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'asm19c'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'asm19c'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'asm19c'
CRS-2677: Stop of 'ora.DATA.dg' on 'asm19c' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'asm19c'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'asm19c' succeeded
CRS-2677: Stop of 'ora.asm' on 'asm19c' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'asm19c'
CRS-2677: Stop of 'ora.evmd' on 'asm19c' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'asm19c'
CRS-2677: Stop of 'ora.cssd' on 'asm19c' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'asm19c' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@asm19c grid]#

-- 配置ASMFD

[root@asm19c grid]# 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@asm19c grid]#

-- 启动has

[root@asm19c grid]# crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[root@asm19c grid]#

-- 确认ASMFD状态

[root@asm19c grid]# asmcmd afd_state
ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'asm19c'
[root@asm19c grid]#

-- 配置完毕后,会在$GI_HOME/bin下生成相关文件

cd $GI_HOME/bin 
ls -lrt afd*

[root@asm19c bin]# ls -lrt afd*
-rwxr-x---. 1 grid oinstall     1000 Jun 20  2016 afdroot
-rwxr-xr-x. 1 root oinstall 87510440 Apr 11 01:19 afdboot
-rwxr-xr-x. 1 root oinstall   285904 Apr 11 01:19 afdtool.bin
-rwxr-x---. 1 grid oinstall      760 Jun  5 22:56 afdload
-rwxr-xr-x. 1 root oinstall     2860 Jun  5 22:56 afdtool
-rwxr-x---. 1 grid oinstall     3084 Jun  5 22:56 afddriverstate
[root@asm19c bin]#

-- 这个时候,还没有磁盘被label

[root@asm19c grid]# asmcmd afd_lsdsk
There are no labelled devices.

-- 先将原来的ASM磁盘转换成AFD

[grid@asm19c ~]$ asmcmd afd_label sdb1 /dev/sdb1 --migrate
[grid@asm19c ~]$ su root

--查看label的磁盘

[root@asm19c grid]# asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
SDB1                        ENABLED   /dev/sdb1
[root@asm19c grid]#

--查看udev规则和afd规则

[root@asm19c rules.d]# ls
53-afd.rules  55-usm.rules  99-oracle-asm.rules
[root@asm19c rules.d]# more 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"
[root@asm19c rules.d]# 

--添加了一块磁盘,sdc,查看afd_lsdsk

[grid@asm19c ~]$ asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
SDB1                        ENABLED   /dev/sdc1
[grid@asm19c ~]$

--将sdb label到asmfd

[root@asm19c grid]# asmcmd afd_label DATAFD /dev/sdb
[root@asm19c grid]#

[root@asm19c grid]# asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
DATAFD                      ENABLED   /dev/sdb
SDB1                        ENABLED   /dev/sdc1
[root@asm19c grid]#

-- 通过操作系统或者视图查看

[oracle@asm19c ~]$ lsmod | grep oracle
oracleafd             214032  1
[oracle@asm19c ~]$

--
SQL> select path,library from v$asm_disk;

PATH                 LIBRARY
-------------------- ----------------------------------------------------------------
AFD:SDB1             AFD Library - Generic , version 3 (KABI_V3)
AFD:DATAFD           AFD Library - Generic , version 3 (KABI_V3)
/dev/sdc1            System

SQL>

[grid@asm19c ~]$ cd /dev/oracleafd/disks/
[grid@asm19c disks]$ ll
total 8
-rw-rw-r-- 1 grid oinstall  9 Jun  6 02:17 DATAFD
-rw-rw-r-- 1 grid oinstall 10 Jun  6 01:58 SDB1
[grid@asm19c disks]$ 

--/dev/sdb已经分配给了ASM,使用AFD特性,不允许Oracle外的用户操作。在fdisk的时候,报错

Command (m for help): p

Disk /dev/sdb: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x637311e8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     4194303     2096128   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

Error closing file

[root@asm19c ~]# fdisk -l | grep sd
Disk /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 sectors
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   125829119    61864960   8e  Linux LVM
Disk /dev/sdb: 2147 MB, 2147483648 bytes, 4194304 sectors
Disk /dev/sdc: 64.4 GB, 64424509440 bytes, 125829120 sectors
/dev/sdc1            2048   125829119    62913536   83  Linux
[root@asm19c ~]# 

-- 附图:

 

END

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值