• oracle 在物理机上添加磁盘操作


    物理机上添加磁盘操作

    注意:
    1)物理机上添加磁盘操作,不涉及到start_udev的动作。
    2)磁盘分区的操作,需要谨慎进行,核准无误后再操作。


    (1)查看磁盘名称命名


    # su - grid
    $ sqlplus / as sysasm


    set linesize 180
    col name format a20
    col path format a30
    col header_status format a15
    col failgroup format a20

    select name, path, header_status, mode_status, state, failgroup, disk_number from v$asm_disk order by name;

    SQL>
    NAME PATH HEADER_STATUS MODE_STATUS STATE FAILGROUP DISK_NUMBER
    -------------------- ------------------------------ --------------- --------------------- ------------------------ -------------------- -----------
    CRSDG_0000 /dev/mapper/asmcrs1p1 MEMBER ONLINE NORMAL CRSDG_0000 0
    CRSDG_0001 /dev/mapper/asmcrs2p1 MEMBER ONLINE NORMAL CRSDG_0001 1
    CRSDG_0002 /dev/mapper/asmcrs3p1 MEMBER ONLINE NORMAL CRSDG_0002 2
    ODSDW_0000 /dev/mapper/asmdata1p1 MEMBER ONLINE NORMAL ODSDW_0000 0
    ODSDW_0001 /dev/mapper/asmdata2p1 MEMBER ONLINE NORMAL ODSDW_0001 1
    ODSDW_0002 /dev/mapper/asmdata3p1 MEMBER ONLINE NORMAL ODSDW_0002 2
    ODSDW_0003 /dev/mapper/asmdata4p1 MEMBER ONLINE NORMAL ODSDW_0003 3
    ODSDW_0004 /dev/mapper/asmdata5p1 MEMBER ONLINE NORMAL ODSDW_0004 4
    /dev/mapper/asmdata2 CANDIDATE ONLINE NORMAL 10
    /dev/mapper/asmdata3 CANDIDATE ONLINE NORMAL 11
    /dev/mapper/asmcrs2 CANDIDATE ONLINE NORMAL 12

    NAME PATH HEADER_STATUS MODE_STATUS STATE FAILGROUP DISK_NUMBER
    -------------------- ------------------------------ --------------- --------------------- ------------------------ -------------------- -----------
    /dev/mapper/asmdata4 CANDIDATE ONLINE NORMAL 13
    /dev/mapper/asmcrs1 CANDIDATE ONLINE NORMAL 14
    /dev/mapper/asmcrs3 CANDIDATE ONLINE NORMAL 15
    /dev/mapper/asmdata5 CANDIDATE ONLINE NORMAL 1
    /dev/mapper/asmdata1 CANDIDATE ONLINE NORMAL 9

    16 rows selected.

    SQL>

    /dev/mapper/asmdata5
    由上边的输出,确定新增的名字应该为asmdata6


    (2)修改alias的新增磁盘的名字

    [root@ ~]# vi /etc/multipath.conf

    multipath {
    wwid 360002ac000000000000002ea000066e3
    alias asmdata5
    }
    multipath {
    wwid 360002ac*************************
    alias asmdata6 <<< 设置新增的磁盘的名字为asmdata6
    }

    (3)重新加载mulitipathd,并查看相关的磁盘信息

    [root@ ~]# service multipathd reload


    [root@ ~]# multipath -ll |grep -A6 asm
    asmdata6 (360002ac*************************) dm-13 3PARdata,VV <<< 找到对应的asmdata6这块磁盘

    ... snip ...


    asmdata5 (360002ac000000000000002ea000066e3) dm-13 3PARdata,VV
    size=1.0T features='0' hwhandler='0' wp=rw
    `-+- policy='round-robin 0' prio=1 status=active
    |- 7:0:0:8 sdap 66:144 active ready running
    |- 8:0:0:8 sdar 66:176 active ready running
    |- 7:0:1:8 sdaq 66:160 active ready running
    `- 8:0:1:8 sdas 66:192 active ready running


    (4)核准参数文件12-dm-permissions.rules配置
    [root@ ~]# cat /etc/udev/rules.d/12-dm-permissions.rules
    ACTION!="add|change", GOTO="dm_end"
    ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"

    # PLAIN DM DEVICES
    #
    # Set permissions for a DM device named 'my_device' exactly
    # ENV{DM_NAME}=="my_device", OWNER:="root", GROUP:="root", MODE:="660"


    ENV{DM_NAME}=="asm*", OWNER:="grid", GROUP:="dba", MODE:="660"

    LABEL="dm_end"

    [root@ ~]#

    (5)对新增磁盘进行分区操作(请再次核准要操作的磁盘,失误操作将导致数据库损坏)

    # parted /dev/mapper/asmdataXXX mklabel gpt mkpart primary 0% 100%

    本示例为asmdata6,请根据实际情况,执行具体的操作命令,如下所示为对asmdata6磁盘进行分区。

    [root@ ~]# parted /dev/mapper/asmdata6 mklabel gpt mkpart primary 0% 100%

    (6)确认新增磁盘属性

    查询具体新增磁盘的属性(asmdata6和asmdata6p1)

    这里以asmdata5, asmdata5p1作为示例输出,请以实际的新增磁盘的相关属性asmdata6和asmdata6p1

    [root@ ~]# ls -l /dev/mapper/asm*
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmcrs1 -> ../dm-4
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmcrs1p1 -> ../dm-15
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmcrs2 -> ../dm-6
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmcrs2p1 -> ../dm-17
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmcrs3 -> ../dm-3
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmcrs3p1 -> ../dm-14
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmdata1 -> ../dm-9
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmdata1p1 -> ../dm-20
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmdata2 -> ../dm-8
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmdata2p1 -> ../dm-19
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmdata3 -> ../dm-7
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmdata3p1 -> ../dm-18
    lrwxrwxrwx 1 root root 7 8月 6 11:15 /dev/mapper/asmdata4 -> ../dm-5
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmdata4p1 -> ../dm-16
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmdata5 -> ../dm-13
    lrwxrwxrwx 1 root root 8 8月 6 11:15 /dev/mapper/asmdata5p1 -> ../dm-21
    [root@ ~]# ls -l /dev/dm-13 /dev/dm-21
    brw-rw---- 1 grid dba 253, 13 8月 6 11:15 /dev/dm-13 << 确认属性为grid dba
    brw-rw---- 1 grid dba 253, 21 8月 6 11:16 /dev/dm-21 << 确认属性为grid dba
    [root@ ~]#


    ##############################################################################################

    另一个物理节点(如果为RAC的系统,另一个节点的操作说明):

    注意:另一个节点不需要再执行磁盘分区命令

    (1)修改alias的新增磁盘的名字

    [root@ ~]# vi /etc/multipath.conf

    multipath {
    wwid 360002ac000000000000002ea000066e3
    alias asmdata5
    }
    multipath {
    wwid 360002ac*************************
    alias asmdata6 <<< 设置新增的磁盘的名字为asmdata6
    }

    (2)重新加载mulitipathd,并查看相关的磁盘信息

    [root@ ~]# service multipathd reload

    [root@ ~]# multipath -ll |grep -A6 asm
    asmdata6 (360002ac*************************) dm-13 3PARdata,VV <<< 找到对应的asmdata6这块磁盘

    ... snip ...


    (3)核准参数文件12-dm-permissions.rules配置

    (4)确认新增磁盘属性

     

     

  • 相关阅读:
    html头部属性全接触
    js中的window.onload和jquery中的load区别
    关机时,自动清除运行框的记录的设置方法
    MVC问题小总结,不断更新中...
    iis6 元数据库与iis6 配置的兼容 出错问题
    MVC对异步 Controller 的支持
    SQL Server2008安装报错,解决方案
    JavaScript有5个原始类型
    ASP.NET MVC中的拦截器
    F5负载均衡
  • 原文地址:https://www.cnblogs.com/dqliuq1215/p/12447594.html
Copyright © 2020-2023  润新知