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

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

node1

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

node2:

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

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

[oracle@node1 ~]$ export ORACLE_SID=+ASM1
[oracle@node1 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 12:55:25 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options SQL> col name for a30
SQL> col label for a30
SQL> col path for a30
SQL> set linesize 200
SQL> / NAME LABEL PATH
------------------------------ ------------------------------ ------------------------------
DG1_0000 /dev/raw/raw3
DG2_0000 /dev/raw/raw4
DG3_0000 /dev/raw/raw5
DG3_0001 /dev/raw/raw6
DG4_0000 /dev/raw/raw7
/dev/raw/raw2
/dev/raw/raw1 7 rows selected. SQL> ho ssh node2
Last login: Sat Aug 30 17:56:54 2014 from node1
[oracle@node2 ~]$ export ORACLE_SID=+ASM2
[oracle@node2 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 12:56:38 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options SQL> col name for a30
SQL> col label for a30
SQL> col path for a30
SQL> set linesize 200
SQL> select name,label,path from v$asm_disk order by 1; NAME LABEL PATH
------------------------------ ------------------------------ ------------------------------
DG1_0000 /dev/raw/raw3
DG2_0000 /dev/raw/raw4
DG3_0000 /dev/raw/raw5
DG3_0001 /dev/raw/raw6
DG4_0000 /dev/raw/raw7
/dev/raw/raw2
/dev/raw/raw1 7 rows selected.

创建測试表:

SQL> select file_name,tablespace_name from dba_data_files;

FILE_NAME				     TABLESPACE_NAME
-------------------------------------------- ------------------------------
+DG4/easy/datafile/system.272.856543875 SYSTEM
+DG4/easy/datafile/undotbs1.273.856543885 UNDOTBS1
+DG4/easy/datafile/sysaux.274.856543891 SYSAUX
+DG4/easy/datafile/undotbs2.276.856543901 UNDOTBS2
+DG4/easy/datafile/users.277.856543905 USERS SQL> create table t1 (id number,name varchar2(20)) tablespace users; Table created. SQL> insert into t1 values(1,111); 1 row created. SQL> insert into t1 select * from t1; 1 row created. SQL> / 2 rows created. SQL> / 4 rows created. SQL> / 8 rows created. SQL> / 16 rows created. SQL> / 32 rows created. SQL> / 64 rows created. SQL> commit; Commit complete. SQL> select count(*) from t1; COUNT(*)
----------
128 SQL> update t1 set id=rownum,name=rownum; 128 rows updated. SQL> commit; Commit complete.

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

[root@node1 ~]# cat /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb5", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", KERNEL=="sdb6", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdb7", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdb8", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdb9", RUN+="/bin/raw /dev/raw/raw3 %N"
[oracle@node1 ~]$ export ORACLE_SID=+ASM1
[oracle@node1 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:13:01 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options SQL> col name for a30
SQL> col lable for a33
SQL> col path for a33
SQL> set linesize 222
SQL> col label for a31
SQL> / NAME LABEL PATH
------------------------------ ------------------------------- ---------------------------------
DG1_0000 /dev/raw/raw7
DG2_0000 /dev/raw/raw6
DG3_0000 /dev/raw/raw5
DG3_0001 /dev/raw/raw4
DG4_0000 /dev/raw/raw3
/dev/raw/raw1
/dev/raw/raw2 7 rows selected. SQL> ho ssh oracle@node2
Last login: Sun Aug 31 12:56:27 2014 from node1
[oracle@node2 ~]$ export ORACLE_SID=+ASM2
[oracle@node2 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:14:31 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options SQL> col name for a31
SQL> col label for a31
SQL> col path for a31
SQL> set linesize 211
SQL> select name,label,path from v$asm_disk order by 1; NAME LABEL PATH
------------------------------- ------------------------------- -------------------------------
DG1_0000 /dev/raw/raw3
DG2_0000 /dev/raw/raw4
DG3_0000 /dev/raw/raw5
DG3_0001 /dev/raw/raw6
DG4_0000 /dev/raw/raw7
/dev/raw/raw2
/dev/raw/raw1 7 rows selected. SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[oracle@node2 ~]$ export ORACLE_SID=easy2
[oracle@node2 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:15:31 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options SQL> select count(*) from t1; COUNT(*)
----------
128 SQL> select min(id),max(id) from t1; MIN(ID) MAX(ID)
---------- ----------
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. string rune byte 的关系

    在Go当中 string底层是用byte数组存的,并且是不可以改变的. 例如 s:="Go编程" fmt.Println(len(s)) 输出结果应该是8因为中文字符是用3个字节存 ...

  2. Web2.0应用程序的7条原则

    个人看好Web的发展潜力,本文字摘自<Collective Intelligence 实战> 网络是平台 使用传统许可模式软件的公司或用户必须运行软件.定期更新至最新版本,以及扩展它来满足 ...

  3. mysql 通过cmd 在命令行创建数据库

    一.连接MYSQL 格式: mysql -h主机地址 -u用户名 -p用户密码 1. 连接到本机上的MYSQL. 首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u roo ...

  4. BZOJ.4516.[SCOI2016]幸运数字(线性基 点分治)

    题目链接 线性基可以\(O(log^2)\)暴力合并.又是树上路径问题,考虑点分治. 对于每个点i求解 LCA(u,v)==i 时的询问(u,v),只需求出这个点到其它点的线性基后,暴力合并. LCA ...

  5. windows提权exp列表

    漏洞列表 #Security Bulletin #KB #Description #Operating System CVE-2017-0213 [Windows COM Elevation of P ...

  6. Windows 0day成功验证之ETERNALBLUE

    本帖由春秋首发~作者:神风 @春秋文阁负责人 方程式又一波0day[该贴有工具]:https://bbs.ichunqiu.com/thread-21736-1-1.html 最近一段时间出现一波高潮 ...

  7. 【洛谷】2324:[SCOI2005]骑士精神【IDA*】

    P2324 [SCOI2005]骑士精神 题目描述 输入输出格式 输入格式: 第一行有一个正整数T(T<=10),表示一共有N组数据.接下来有T个5×5的矩阵,0表示白色骑士,1表示黑色骑士,* ...

  8. C++之lambda理解

    简介 在C++ Primer中,是这样定义的-一个lambda表达式表示一个可调用的代码单元,可以将其理解为一个未命名的内联函数:与任何函数类似,一个lambda具有一个返回类型,一个参数列表和一个函 ...

  9. 拆分Cocos2dx渲染部分代码

    纹理实现 思想 这个是Cocos2dx的渲染部分的最基本的实现,被我拆分到mac上,但是并不是用的EGLContext,而是搭配glfw,还有soil第三方图形库. 实现 // // main.cpp ...

  10. django: ListView解读

    [转载注明出处: http://www.cnblogs.com/yukityan/p/8039041.html ] django内置列表视图: # 导入 from django.views.gener ...