Oracle 12C AFD instruction

In Oracle 12c (12.1.0.2 to be exact) we can find a cool new feature: Oracle ASM Filter Driver.
Quoting after the documentiation:

Oracle ASM Filter Driver (Oracle ASMFD) is a kernel module that resides in the I/O path of the Oracle ASM disks. Oracle ASM uses the filter driver to validate write I/O requests to Oracle ASM disks.

The Oracle ASMFD simplifies the configuration and management of disk devices by eliminating the need to rebind disk devices used with Oracle ASM each time the system is restarted.

The Oracle ASM Filter Driver rejects any I/O requests that are invalid. This action eliminates accidental overwrites of Oracle ASM disks that would cause corruption in the disks and files within the disk group. For example, the Oracle ASM Filter Driver filters out all non-Oracle I/Os which could cause accidental overwrites.

After installation of Oracle Grid Infrastructure, you can optionally configure Oracle ASMFD for your system. If ASMLIB is configured for an existing Oracle ASM installation, then you must explicitly migrate the existing ASMLIB configuration to Oracle ASMFD.

So let’s find out how it works ?

I have Oracle 12.1.0.2 installed on OEL 6.5 with UEK3. Since I’m using ASMLib, I have to migrate to AFD, using the asmcmd tool:

– First of all, I have to shutdown the HAS services:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

[root@skiper ~]# crsctl stop has

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'skiper'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'skiper'

CRS-2673: Attempting to stop 'ora.DATA.dg' on 'skiper'

CRS-2677: Stop of 'ora.DATA.dg' on 'skiper' succeeded

CRS-2673: Attempting to stop 'ora.asm' on 'skiper'

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'skiper' succeeded

CRS-2677: Stop of 'ora.asm' on 'skiper' succeeded

CRS-2673: Attempting to stop 'ora.evmd' on 'skiper'

CRS-2677: Stop of 'ora.evmd' on 'skiper' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on 'skiper'

CRS-2677: Stop of 'ora.cssd' on 'skiper' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'skiper' has completed

CRS-4133: Oracle High Availability Services has been stopped.

– Then I have to use the asmcmd tool as the root user to enable the AFD driver:

1

2

3

4

5

6

7

8

9

10

11

12

13

[root@skiper ~]# asmcmd afd_configure

Connected to an idle instance.

AFD-627: AFD distribution files found.

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.

ASMCMD-9524: AFD configuration failed 'ERROR: OHASD start failed'

You can ignore the last error and start the HAS services manualy ?

After this configuration we will find the new udev rules:

1

2

3

4

5

6

[root@skiper ~]# cat /etc/udev/rules.d/53-afd.rules

#

# AFD devices

KERNEL=="oracleafd/.*", OWNER="oracle", GROUP="dba", MODE="0770"

KERNEL=="oracleafd/*", OWNER="oracle", GROUP="dba", MODE="0770"

KERNEL=="oracleafd/disks/*", OWNER="oracle", GROUP="dba", MODE="0660"

And the prefix of the ASM devices will change to "AFD:*"

1

2

3

4

5

6

7

8

9

[oracle@skiper ~]$ asmcmd

ASMCMD> lsdsk

Path

AFD:DATA

ASMCMD> afd_lsdsk

--------------------------------------------------------------------------------

Label                     Filtering   Path

================================================================================

DATA                       DISABLED   /dev/sdb1

OK. So now let’s try to start the actual filtering and do some tests with my favourite tool: "dd" ?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

ASMCMD> afd_filter -e

ASMCMD> afd_lsdsk

--------------------------------------------------------------------------------

Label                     Filtering   Path

================================================================================

DATA                        ENABLED   /dev/sdb1

 

[root@skiper ~]# dd if=/dev/zero of=/dev/sdb1 bs=1M count=1024

1024+0 records in

1024+0 records out

1073741824 bytes (1.1 GB) copied, 4.43353 s, 242 MB/s

 

[root@skiper ~]# tail -10 /var/log/messages

Sep 23 22:04:31 skiper kernel: F 4299051.469/140923200431 flush-8:16[13961]  afd_mkrequest_fn: write IO on ASM managed device (major=8/minor=17)  not supported i=1 start=1361920 seccnt=1  pstart=63  pend=25157790

As you can see, the AFD has prohibited overwriting the device, that is a part of the ASM diskgroup. So it’s pretty cool.
The bad news is, that after enabling this feature I got a lot of "kernel panic" situations ?

So to sum up: great feature and I will be happy using it in production… but maybe in R2.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值