百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 优雅编程 > 正文

从Oracle ASMLIB/udev 迁移到ASM Filter Driver

sinye56 2024-10-03 00:40 8 浏览 0 评论

1.查询并设置当前的ASM磁盘以及发现路径
[root@dbserver ~]# su - grid
[grid@dbserver ~]$ asmcmd dsget
parameter:/dev/asm*
profile:/dev/asm*
[grid@dbserver ~]$ asmcmd dsset '/dev/asm*','AFD:*'
[grid@dbserver ~]$ asmcmd dsget
parameter:/dev/asm*, AFD:*
profile:/dev/asm*,AFD:*


2.停止GI服务
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/crsctl stop has -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'dbserver'
CRS-2673: Attempting to stop 'ora.orcl.db' on 'dbserver'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'dbserver'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'dbserver' succeeded
CRS-2677: Stop of 'ora.orcl.db' on 'dbserver' succeeded
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'dbserver'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'dbserver'
CRS-2677: Stop of 'ora.DATA.dg' on 'dbserver' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'dbserver' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'dbserver'
CRS-2677: Stop of 'ora.asm' on 'dbserver' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'dbserver'
CRS-2677: Stop of 'ora.evmd' on 'dbserver' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'dbserver'
CRS-2677: Stop of 'ora.cssd' on 'dbserver' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'dbserver' has completed
CRS-4133: Oracle High Availability Services has been stopped.


3.卸载ASMLIB软件
# systemctl disable oracleasm
# oracleasm exit
3 yum remove oracleasm-support


4.配置AFD
[root@dbserver ~]# /u01/app/19.10.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.


5.查看状态
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_state
ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'dbserver‘


--如果上述的状态为disabled,则使用下面的命令启用
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_filter -e


6.修改/etc/oracleafd.conf
[root@dbserver ~]# vim /etc/oracleafd.conf


afd_diskstring='/dev/asm/data*‘


加上上面这行


7.迁移所有ASM磁盘


[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data1 /dev/asm/data1 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data1 /dev/asm/data2 –migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data3 /dev/asm/data3 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data4 /dev/asm/data4 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data5 /dev/asm/data5 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data6 /dev/asm/data6 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data7 /dev/asm/data7 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data8 /dev/asm/data8 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data9 /dev/asm/data9 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_label data10 /dev/asm/data10 --migrate
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label Filtering Path
================================================================================
DATA1 ENABLED /dev/asm/data1
DATA10 ENABLED /dev/asm/data10
DATA2 ENABLED /dev/asm/data2
DATA3 ENABLED /dev/asm/data3
DATA4 ENABLED /dev/asm/data4
DATA5 ENABLED /dev/asm/data5
DATA6 ENABLED /dev/asm/data6
DATA7 ENABLED /dev/asm/data7
DATA8 ENABLED /dev/asm/data8
DATA9 ENABLED /dev/asm/data9
8.启动GI
[root@dbserver ~]# /u01/app/19.10.0/grid/bin/crsctl start has
CRS-4123: Oracle High Availability Services has been started.


9.修改新的ASM磁盘发现路径,只包含AFD


[root@dbserver ~]# su - grid
[grid@dbserver ~]$ asmcmd dsget
parameter:/dev/asm*, AFD:*
profile:/dev/asm*,AFD:*
[grid@dbserver ~]$ asmcmd dsset 'AFD:*'
[grid@dbserver ~]$ asmcmd dsget
parameter:AFD:*
profile:AFD:*


10.列出ASM磁盘


[grid@dbserver ~]$ asmcmd lsdsk
Path
AFD:DATA1
AFD:DATA10
AFD:DATA2
AFD:DATA3
AFD:DATA4
AFD:DATA5
AFD:DATA6
AFD:DATA7
AFD:DATA8
AFD:DATA9


11.执行下面的SQL进行验证
[grid@dbserver ~]$ sqlplus /nolog
SQL> conn / as sysasm
SQL> set linesize 300
SQL> col path for a20
SQL> col library for a45
SQL> col name for a15
SQL> select inst_id,group_number grp_num,name,state,header_status header,mount_status mount,path, library
2 from gv$asm_disk order by inst_id,group_number,name;
INST_ID GRP_NUM NAME STATE HEADER MOUNT PATH LIBRARY
---------- ---------- --------------- -------- ------------ ------- -------------------- ---------------------------------------------
1 1 DATA_0000 NORMAL MEMBER CACHED AFD:DATA1 AFD Library - Generic , version 3 (KABI_V3)
1 1 DATA_0001 NORMAL MEMBER CACHED AFD:DATA2 AFD Library - Generic , version 3 (KABI_V3)
1 1 DATA_0002 NORMAL MEMBER CACHED AFD:DATA3 AFD Library - Generic , version 3 (KABI_V3)
1 1 DATA_0003 NORMAL MEMBER CACHED AFD:DATA4 AFD Library - Generic , version 3 (KABI_V3)
1 1 DATA_0004 NORMAL MEMBER CACHED AFD:DATA5 AFD Library - Generic , version 3 (KABI_V3)
1 1 DATA_0005 NORMAL MEMBER CACHED AFD:DATA6 AFD Library - Generic , version 3 (KABI_V3)
1 1 DATA_0006 NORMAL MEMBER CACHED AFD:DATA7 AFD Library - Generic , version 3 (KABI_V3)
1 2 FRA_0000 NORMAL MEMBER CACHED AFD:DATA10 AFD Library - Generic , version 3 (KABI_V3)
1 2 FRA_0001 NORMAL MEMBER CACHED AFD:DATA8 AFD Library - Generic , version 3 (KABI_V3)
1 2 FRA_0002 NORMAL MEMBER CACHED AFD:DATA9 AFD Library - Generic , version 3 (KABI_V3)


10 rows selected.

相关推荐

Linux两种光驱自动挂载的方法

环境:CentOS6.4西昆云服务器方式一修改fstab文件/etc/fstab是系统保存文件系统信息?静态文件,每一行描述一个文件系统;系统每次启动会读取此文件信息以确定需要挂载哪些文件系统。参...

linux系统运维,挂载和分区概念太难?在虚机下操作一次全掌握

虚拟机的好处就是可以模拟和学习生产环境的一切操作,假如我们还不熟悉磁盘操作,那先在虚机环境下多操作几次。这次来练习下硬盘扩容操作。虚拟机环境:centos8vm11linux设备命名规则在linux中...

Linux 挂载 NFS 外部存储 (mount 和 /etc/fstab)

mount:手工挂载,下次重启需再重新挂载,操作命令:mount-tnfs-ooptionsserver:/remote/export/local/directory上面命令中,本地目录...

在Linux中如何设置自动挂载特定文件系统(示例)

Linux...

Linux环境中的绑定挂载(bind mount)

简介:Linux中的mount命令是一个特殊的指令,主要用于挂载文件目录。而绑定挂载(bindmount)命令更为特别。mount的bind选项将第一个目录克隆到第二个。一个目录中的改变将会在...

Linux挂载CIFS共享 临时挂载 1. 首先

如何解决服务器存储空间不足的问题?大家好,欢迎回来。在上一期视频中,我为大家介绍了如何利用Linux挂载来扩容服务器存储空间。这一期视频,我将以Linux为例,教大家如何进行扩容。群辉使用的是Linu...

Linux 硬盘挂载(服务器重启自动挂载)

1、先查看目前机器上有几块硬盘,及已挂载磁盘:fdisk-l能够查看到当前主机上已连接上的磁盘,以及已经分割的磁盘分区。(下面以/dev/vdb磁盘进行分区、挂载为例,挂载点设置为/data)df...

linux 挂载磁盘

在Linux中挂载硬盘的步骤如下:...

笨小猪教您Linux磁盘挂载

本教程针对Linux系统比较熟悉或者想学习Linux基础的用户朋友,本教程操作起来比较傻瓜式,跟着步骤就会操作,本文使用的工具是XShell同时多多注意空格(文中会有提示)。【问答】什么是磁盘挂载?答...

Linux 磁盘挂载和docker安装命令

本篇给大家介绍Linux磁盘挂载和docker安装的相关内容,Linux服务器的操作是一个手熟的过程,一些不常用的命令隔断时间就忘记了,熟话说好记性不如烂笔头,还需在平时的工作中多练习记录。...

Linux设置开机自动挂载分区

有时候,我们在安装完Linux系统之后,可能在使用过程中添加硬盘或者分区进行使用,这时候就需要手动把磁盘分区挂载到某个路径,但是开机之后就会消失,需要重新挂载,非常麻烦,那么我们应该如何设置开机自动挂...

在linux挂载一个新硬盘的完整步骤

以下是在Linux中挂载新原始磁盘的完整步骤,包括分区、创建文件系统以及使用UUID在/etc/fstab中启动时挂载磁盘:将新的原始磁盘连接到Linux系统并打开电源。运行以下命令,...

Linux系统如何挂载exFAT分区

简介:Linux系统中不能像Windows系统那样自动识别加载新设备,需要手动识别,手动加载。Linux中一切皆文件。文件通过一个很大的文件树来组织,文件树的根目录是:/,从根目开始录逐级展开。这些文...

Linux系统挂载硬盘

fdisk-l查看可挂载的磁盘都有哪些df-h查看已经挂载的磁盘...

WSL2发布,如何在Win10中挂载Linux文件系统

WSL2是最新版本的架构,它为Windows子系统提供支持,使其能够在Windows上运行ELF64Linux二进制文件。通过最近的更新,它允许使用Linux文件系统访问存储在硬盘中的文件。如果你...

取消回复欢迎 发表评论: