ASM磁盘从UDEV方式迁移到ASMFD方式

Oracle ASM Filter Driver (Oracle ASMFD)是位于Oracle ASM磁盘IO路径上的一个内核模块,Oracle ASM使用ASMFD来验证对Oracle ASM磁盘的写IO请求,Oracle ASM Filter Driver会拒绝任何无效的IO请求。此操作消除了意外覆盖Oracle ASM磁盘头的情况。例如,Oracle ASM Filter Driver过滤掉所有可能导致意外覆盖的非Oracle IO。

 

默认情况下,Oracle ASM Filter Driver (Oracle ASMFD)与Oracle Grid Infrastructure安装一起安装。如果现有的磁盘组未使用ASMFD,则需要将现有的ASM磁盘组中的磁盘进行标识,并且将其迁移到ASMFD (ASM Filter Driver)。

 

本示例将磁盘组从传统的udev方式切换成AFD方式。

 

1、以GRID用户运行如下命令,生成ASM磁盘与ASM磁盘组的对应关系。

SQL> set lines 200

SQL> col path for a30

SQL> col name for a30

SQL> col header_status for a30

SQL> select name, path,header_status from v$asm_disk order by 1;

 

NAME                           PATH                           HEADER_STATUS

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

DG_DATA_0000                   /dev/oracleasm/disks/mpathj    MEMBER

DG_DATA_0001                   /dev/oracleasm/disks/mpathk    MEMBER

DG_DATA_0002                   /dev/oracleasm/disks/mpathl    MEMBER

DG_GRID_0000                   /dev/oracleasm/disks/mpathh    MEMBER

DG_GRID_0001                   /dev/oracleasm/disks/mpathi    MEMBER

 

SQL>

 

2、以GRID用户运行如下命令,获取现有ASM磁盘的搜索路径。

[grid@19crac1 ~]$ asmcmd dsget

parameter:/dev/oracleasm/disks/*

profile:/dev/oracleasm/disks/*

[grid@19crac1 ~]$

 

3、以GRID用户运行如下命令,更新ASM磁盘的搜索路径,使Oracle ASMFD能够发现用于迁移的设备。

[grid@19crac1 ~]$ asmcmd dsset '/dev/oracleasm/disks/*','AFD:*'

[grid@19crac1 ~]$

[grid@19crac1 ~]$ asmcmd dsget

parameter:/dev/oracleasm/disks/*, AFD:*

profile:/dev/oracleasm/disks/*,AFD:*

[grid@19crac1 ~]$

 

4、停止当前节点的CRS集群。

[root@19crac1 ~]# crsctl stop crs -f

 

5、以ROOT用户,在当前节点配置Oracle ASMFD。

[root@19crac1 ~]# asmcmd afd_configure

ASMCMD-9521: AFD is already configured

 

6、验证Oracle ASMFD的状态。

[root@19crac1 ~]# asmcmd afd_state

ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host '19crac1.oracle.com'

[root@19crac1 ~]#

 

7、以ROOT用户,借助步骤1中收集的数据,迁移所有UDEV磁盘。

[root@19crac1 disks]# asmcmd afd_label DG_DATA_0001 /dev/oracleasm/disks/mpathk --migrate

[root@19crac1 disks]# asmcmd afd_label DG_DATA_0000 /dev/oracleasm/disks/mpathj --migrate

[root@19crac1 disks]# asmcmd afd_label DG_DATA_0002 /dev/oracleasm/disks/mpathl --migrate

[root@19crac1 disks]# asmcmd afd_label DG_GRID_0000 /dev/oracleasm/disks/mpathh --migrate

[root@19crac1 disks]# asmcmd afd_label DG_GRID_0001 /dev/oracleasm/disks/mpathi --migrate

 

8、验证所有磁盘都已迁移到ASMFD。

[root@19crac1 disks]# asmcmd afd_lsdsk

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

Label                     Filtering   Path

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

DG_DATA_0000                ENABLED   /dev/oracleasm/disks/mpathj

DG_DATA_0001                ENABLED   /dev/oracleasm/disks/mpathk

DG_DATA_0002                ENABLED   /dev/oracleasm/disks/mpathl

DG_GRID_0000                ENABLED   /dev/oracleasm/disks/mpathh

DG_GRID_0001                ENABLED   /dev/oracleasm/disks/mpathi

[root@19crac1 disks]#

 

9、重启ACFS和AFD,再次验证所有磁盘都已迁移到ASMFD。

[root@19crac1 disks]# acfsload stop

[root@19crac1 disks]# afdload stop

[root@19crac1 disks]# acfsload start

[root@19crac1 disks]# afdload start

[root@19crac1 disks]# asmcmd afd_lsdsk

 

10、在其他的计算节点上执行上面的步骤(除了步骤7外)。

 

11、以GRID用户运行如下命令,更新ASM磁盘的搜索路径,将来ASM只识别ASMFD设备。

[grid@19crac1 ~]$ asmcmd dsset 'AFD:*'

 

 

12、重启CRS集群,检验已经切换到AFD方式。

 

SQL> set lines 200

SQL> col path for a30

SQL> col name for a30

SQL> col header_status for a30

SQL> select name, path,header_status from v$asm_disk order by 1;

 

NAME                           PATH                           HEADER_STATUS

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

DG_DATA_0000                   AFD:DG_DATA_0000               MEMBER

DG_DATA_0001                   AFD:DG_DATA_0001               MEMBER

DG_DATA_0002                   AFD:DG_DATA_0002               MEMBER

DG_GRID_0000                   AFD:DG_GRID_0000               MEMBER

DG_GRID_0001                   AFD:DG_GRID_0001               MEMBER

 

SQL>

posted @ 2023-08-01 16:09  石云华  阅读(154)  评论(0编辑  收藏  举报