通过asm来存储数据库文件,在linux下能够通过asmlib的方式来管理块设备,也能够直接使用裸设备来建立asm磁盘。在asmlib方式下,磁盘设备启动顺序和名称的改变不会影响到asm的使用。但假设直接使用裸设备会怎么样那?我们知道asm会在磁盘中存储与asm有关的元数据,通过这些元数据asm能够了解磁盘的相关信息,因此理论上裸设备名称的改变不会影响asm的正常使用。以下,通过实验来验证一下。

首先看下面。裸设备的配置文件

node1

  1. [root@node1 ~]# cat /etc/udev/rules.d/60-raw.rules
  2. # Enter raw device bindings here.
  3. #
  4. # An example would be:
  5. # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
  6. # to bind /dev/raw/raw1 to /dev/sda, or
  7. # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
  8. # to bind /dev/raw/raw2 to the device with major 8, minor 1.
  9.  
  10. ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
  11. ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
  12. ACTION=="add", KERNEL=="sdb5", RUN+="/bin/raw /dev/raw/raw3 %N"
  13. ACTION=="add", KERNEL=="sdb6", RUN+="/bin/raw /dev/raw/raw4 %N"
  14. ACTION=="add", KERNEL=="sdb7", RUN+="/bin/raw /dev/raw/raw5 %N"
  15. ACTION=="add", KERNEL=="sdb8", RUN+="/bin/raw /dev/raw/raw6 %N"
  16. ACTION=="add", KERNEL=="sdb9", RUN+="/bin/raw /dev/raw/raw7 %N"

node2:

  1. [root@node2 rules.d]# cat 60-raw.rules
  2. # Enter raw device bindings here.
  3. #
  4. # An example would be:
  5. # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
  6. # to bind /dev/raw/raw1 to /dev/sda, or
  7. # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
  8. # to bind /dev/raw/raw2 to the device with major 8, minor 1.
  9.  
  10. ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
  11. ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
  12. ACTION=="add", KERNEL=="sdb5", RUN+="/bin/raw /dev/raw/raw3 %N"
  13. ACTION=="add", KERNEL=="sdb6", RUN+="/bin/raw /dev/raw/raw4 %N"
  14. ACTION=="add", KERNEL=="sdb7", RUN+="/bin/raw /dev/raw/raw5 %N"
  15. ACTION=="add", KERNEL=="sdb8", RUN+="/bin/raw /dev/raw/raw6 %N"
  16. ACTION=="add", KERNEL=="sdb9", RUN+="/bin/raw /dev/raw/raw7 %N"

asm下的磁盘信息例如以下:

  1. [oracle@node1 ~]$ export ORACLE_SID=+ASM1
  2. [oracle@node1 ~]$ sqlplus / as sysdba
  3.  
  4. SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 12:55:25 2014
  5.  
  6. Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
  7.  
  8. Connected to:
  9. Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
  10. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  11. and Real Application Testing options
  12.  
  13. SQL> col name for a30
  14. SQL> col label for a30
  15. SQL> col path for a30
  16. SQL> set linesize 200
  17. SQL> /
  18.  
  19. NAME LABEL PATH
  20. ------------------------------ ------------------------------ ------------------------------
  21. DG1_0000 /dev/raw/raw3
  22. DG2_0000 /dev/raw/raw4
  23. DG3_0000 /dev/raw/raw5
  24. DG3_0001 /dev/raw/raw6
  25. DG4_0000 /dev/raw/raw7
  26. /dev/raw/raw2
  27. /dev/raw/raw1
  28.  
  29. 7 rows selected.
  30.  
  31. SQL> ho ssh node2
  32. Last login: Sat Aug 30 17:56:54 2014 from node1
  33. [oracle@node2 ~]$ export ORACLE_SID=+ASM2
  34. [oracle@node2 ~]$ sqlplus / as sysdba
  35.  
  36. SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 12:56:38 2014
  37.  
  38. Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
  39.  
  40. Connected to:
  41. Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
  42. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  43. and Real Application Testing options
  44.  
  45. SQL> col name for a30
  46. SQL> col label for a30
  47. SQL> col path for a30
  48. SQL> set linesize 200
  49. SQL> select name,label,path from v$asm_disk order by 1;
  50.  
  51. NAME LABEL PATH
  52. ------------------------------ ------------------------------ ------------------------------
  53. DG1_0000 /dev/raw/raw3
  54. DG2_0000 /dev/raw/raw4
  55. DG3_0000 /dev/raw/raw5
  56. DG3_0001 /dev/raw/raw6
  57. DG4_0000 /dev/raw/raw7
  58. /dev/raw/raw2
  59. /dev/raw/raw1
  60.  
  61. 7 rows selected.

创建測试表:

  1. SQL> select file_name,tablespace_name from dba_data_files;
  2.  
  3. FILE_NAME TABLESPACE_NAME
  4. -------------------------------------------- ------------------------------
  5. +DG4/easy/datafile/system.272.856543875 SYSTEM
  6. +DG4/easy/datafile/undotbs1.273.856543885 UNDOTBS1
  7. +DG4/easy/datafile/sysaux.274.856543891 SYSAUX
  8. +DG4/easy/datafile/undotbs2.276.856543901 UNDOTBS2
  9. +DG4/easy/datafile/users.277.856543905 USERS
  10.  
  11. SQL> create table t1 (id number,name varchar2(20)) tablespace users;
  12.  
  13. Table created.
  14.  
  15. SQL> insert into t1 values(1,111);
  16.  
  17. 1 row created.
  18.  
  19. SQL> insert into t1 select * from t1;
  20.  
  21. 1 row created.
  22.  
  23. SQL> /
  24.  
  25. 2 rows created.
  26.  
  27. SQL> /
  28.  
  29. 4 rows created.
  30.  
  31. SQL> /
  32.  
  33. 8 rows created.
  34.  
  35. SQL> /
  36.  
  37. 16 rows created.
  38.  
  39. SQL> /
  40.  
  41. 32 rows created.
  42.  
  43. SQL> /
  44.  
  45. 64 rows created.
  46.  
  47. SQL> commit;
  48.  
  49. Commit complete.
  50.  
  51. SQL> select count(*) from t1;
  52.  
  53. COUNT(*)
  54. ----------
  55. 128
  56.  
  57. SQL> update t1 set id=rownum,name=rownum;
  58.  
  59. 128 rows updated.
  60.  
  61. SQL> commit;
  62.  
  63. Commit complete.

改动裸设备的路径名称并重起集群

  1. [root@node1 ~]# cat /etc/udev/rules.d/60-raw.rules
  2. # Enter raw device bindings here.
  3. #
  4. # An example would be:
  5. # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
  6. # to bind /dev/raw/raw1 to /dev/sda, or
  7. # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
  8. # to bind /dev/raw/raw2 to the device with major 8, minor 1.
  9.  
  10. ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
  11. ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
  12. ACTION=="add", KERNEL=="sdb5", RUN+="/bin/raw /dev/raw/raw7 %N"
  13. ACTION=="add", KERNEL=="sdb6", RUN+="/bin/raw /dev/raw/raw6 %N"
  14. ACTION=="add", KERNEL=="sdb7", RUN+="/bin/raw /dev/raw/raw5 %N"
  15. ACTION=="add", KERNEL=="sdb8", RUN+="/bin/raw /dev/raw/raw4 %N"
  16. ACTION=="add", KERNEL=="sdb9", RUN+="/bin/raw /dev/raw/raw3 %N"
  1. [oracle@node1 ~]$ export ORACLE_SID=+ASM1
  2. [oracle@node1 ~]$ sqlplus / as sysdba
  3.  
  4. SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:13:01 2014
  5.  
  6. Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
  7.  
  8. Connected to:
  9. Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
  10. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  11. and Real Application Testing options
  12.  
  13. SQL> col name for a30
  14. SQL> col lable for a33
  15. SQL> col path for a33
  16. SQL> set linesize 222
  17. SQL> col label for a31
  18. SQL> /
  19.  
  20. NAME LABEL PATH
  21. ------------------------------ ------------------------------- ---------------------------------
  22. DG1_0000 /dev/raw/raw7
  23. DG2_0000 /dev/raw/raw6
  24. DG3_0000 /dev/raw/raw5
  25. DG3_0001 /dev/raw/raw4
  26. DG4_0000 /dev/raw/raw3
  27. /dev/raw/raw1
  28. /dev/raw/raw2
  29.  
  30. 7 rows selected.
  31.  
  32. SQL> ho ssh oracle@node2
  33. Last login: Sun Aug 31 12:56:27 2014 from node1
  34. [oracle@node2 ~]$ export ORACLE_SID=+ASM2
  35. [oracle@node2 ~]$ sqlplus / as sysdba
  36.  
  37. SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:14:31 2014
  38.  
  39. Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
  40.  
  41. Connected to:
  42. Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
  43. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  44. and Real Application Testing options
  45.  
  46. SQL> col name for a31
  47. SQL> col label for a31
  48. SQL> col path for a31
  49. SQL> set linesize 211
  50. SQL> select name,label,path from v$asm_disk order by 1;
  51.  
  52. NAME LABEL PATH
  53. ------------------------------- ------------------------------- -------------------------------
  54. DG1_0000 /dev/raw/raw3
  55. DG2_0000 /dev/raw/raw4
  56. DG3_0000 /dev/raw/raw5
  57. DG3_0001 /dev/raw/raw6
  58. DG4_0000 /dev/raw/raw7
  59. /dev/raw/raw2
  60. /dev/raw/raw1
  61.  
  62. 7 rows selected.
  63.  
  64. SQL> exit
  65. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
  66. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  67. and Real Application Testing options
  68. [oracle@node2 ~]$ export ORACLE_SID=easy2
  69. [oracle@node2 ~]$ sqlplus / as sysdba
  70.  
  71. SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:15:31 2014
  72.  
  73. Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
  74.  
  75. Connected to:
  76. Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
  77. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  78. and Real Application Testing options
  79.  
  80. SQL> select count(*) from t1;
  81.  
  82. COUNT(*)
  83. ----------
  84. 128
  85.  
  86. SQL> select min(id),max(id) from t1;
  87.  
  88. MIN(ID) MAX(ID)
  89. ---------- ----------
  90. 1 128

由此可见,裸设备路径和名称的改变不会影响asm的使用。可是,我们依旧建议保持路径名称的稳定性,方便管理。

ASM下裸设备的路径更改是否会影响数据库的执行的更多相关文章

  1. Linux平台下裸设备的绑定:

    Linux平台下裸设备的绑定: 运用RAW绑定 方法一 raw的配置(1) [root@qs-dmm-rh2 mapper]# cat /etc/rc.local #!/bin/sh # # This ...

  2. 干货分享:SQLSERVER使用裸设备

    干货分享:SQLSERVER使用裸设备 这篇文章也适合ORACLE DBA和MYSQL DBA 阅读 裸设备适用于Linux和Windows 在ORACLE和MYSQL里也是支持裸设备的!! 介绍 大 ...

  3. SUSE Linux 多路径软件+LVM+裸设备的配置

    1.先要查出光纤卡的WWN号,SUSE 10下光纤卡的WWD在/sys/class/fc_host/host5/port_name文件中,有两块卡就会有两个host*的目录 接好光纤后可以在dev下可 ...

  4. 裸设备和Oracle问答20例

    导读裸设备,也叫裸分区(原始分区),是一种没有经过格式化,不被Unix通过文件系统来读取的特殊字符设备.裸设备可以绑定一个分区,也可以绑定一个磁盘.本文收集裸设备和Oracle问答20例. 1.什么叫 ...

  5. 【测试】RAC搭建(裸设备)

    环境描述:   节点一 节点二 主机名 rac1 rac2 IP 192.168.10.11 192.168.10.12 IP-VIP 192.168.10.111 192.168.10.112 IP ...

  6. Linux平台下:块设备、裸设备、ASMlib、Udev相关关系

    对磁盘设备(裸分区)的访问方式分为两种:1.字符方式访问(裸设备):2.块方式访问 Solaris平台 : 在Solaris平台下,系统同时提供对磁盘设备的字符.块方式访问.每个磁盘有两个设备文件名: ...

  7. 使用OpenFiler来模拟存储配置RAC中ASM共享盘及多路径(multipath)的测试

    第一章 本篇总览 之前发布了一篇<Oracle_lhr_RAC 12cR1安装>,但是其中的存储并没有使用多路径,而是使用了VMware自身提供的存储.所以,年前最后一件事就是把多路径学习 ...

  8. Sun Solairs系统添加裸设备

    Sun Solaris系统添加裸设备对表空间进行扩容的大体操作步骤. 1.查看当前卷组信息 --查看当前卷组信息#vxdg list --查看当前卷组中物理磁盘的使用情况#vxdg free |gre ...

  9. AIX用裸设备给表空间添加数据文件

    近期在对生产数据库表空间进行扩容,目的是春节期间保证表空间的使用率,不会出现紧急告警信息. 1.查看表空间使用率的SQL语句 col tablespace_name for a16 col SUM_S ...

随机推荐

  1. 50个必备jQuery代码段

    0. 如何创建嵌套的过滤器: 1 2 3 4 5 //允许你减少集合中的匹配元素的过滤器, //只剩下那些与给定的选择器匹配的部分.在这种情况下, //查询删除了任何没(:not)有(:has) // ...

  2. 机器学习之路:python k近邻回归 预测波士顿房价

    python3 学习机器学习api 使用两种k近邻回归模型 分别是 平均k近邻回归 和 距离加权k近邻回归 进行预测 git: https://github.com/linyi0604/Machine ...

  3. 【set】【可持久化Trie】The 16th UESTC Programming Contest Preliminary K - Will the circle be broken

    题意:You are given an array A of N non-negative integers and an integer M. Find the number of pair(i,j ...

  4. Android之安全机制

    根据android四大框架来解说安全机制 代码安全 java不同于C/C++,java是解释性语言,存在代码被反编译的隐患: 默认混淆器为proguard,最新版本为4.7: proguard还可用来 ...

  5. hdu 2476 区间dp

    题意: 给出两个串s1和s2,一次只能将一个区间刷一次,问最少几次能让s1=s2 例如zzzzzfzzzzz,长度为11,我们就将下标看做0~10 先将0~10刷一次,变成aaaaaaaaaaa 1~ ...

  6. 【10.10校内测试】【线段树维护第k小+删除】【lca+主席树维护前驱后驱】

    贪心思想.将a排序后,对于每一个a,找到对应的删除m个后最小的b,每次更新答案即可. 如何删除才是合法并且最优的?首先,对于排了序的a,第$i$个那么之前就应该删除前$i-1$个a对应的b.剩下$m- ...

  7. ASP.NET MVC的请求处理流程

    (1)用户打开浏览器,在地址栏输入某个网址URL并回车,浏览器便开始向该URL指向的服务器发送HTTP请求(一般是GET方式).(2)服务器端的网站服务系统(IIS)接收到该请求,先检查自己是否认识该 ...

  8. mysql数据库cup飙升处理思路

    1.先top查看是那一个进程,哪个端口占用CPU多. 2.show processeslist查看是否由于大量并发,锁引起的负载问题. 3.否则,查看慢查询,找出执行时间长的sql:explain分析 ...

  9. webpack入门(1)

    webpack入门(1) 源码戳这里 ps:每个案例对应相应的demo,例如"案例1"对应"demo1" 一.webpack基本功能及简单案例 安装webpac ...

  10. 关于Vue的一些小技巧

    前言 用Vue开发一个网页并不难,但是也经常会遇到一些问题,其实大部分的问题都在文档中有所提及,再不然我们通过谷歌也能成功搜索到问题的答案,为了帮助小伙伴们提前踩坑,在遇到问题的时候,心里大概有个谱知 ...