通过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. properties中的编码如何生成:例如\u7AD9\u70B9这种

    在eclipse中的properties中的一种编码,例如\u7AD9\u70B9,是如何自动生成的. 这种编码方式当你要增加某个字段的时候,也要相应的添加这种编码方式下的格式,具体方法如下:

  2. windows下thrift的使用(python)

    1.下载thrift,下载地址:http://archive.apache.org/dist/thrift/0.9.3/ 2.在编写python的thrift代码时,需要先安装thrift modul ...

  3. JSTL介绍

    JSTL介绍 一.介绍 JSP标准标签库(JSTL)是一个JSP标签集合,它封装了JSP应用的通用核心功能. JSTL支持通用的.结构化的任务,比如迭代,条件判断,XML文档操作,国际化标签,SQL标 ...

  4. 2018haoi总结

    AM T1 写了40分,有50分的暴力分,只看到n=1能用费马小定理,没看到还有一个mod质数也能用费马小定理的10分. AM T2 写了10分,60分异或方程求自由元. AM T3 现在还没搞清楚题 ...

  5. hdu 4557 暴力

    题意: 作为2013年699万应届毕业生中的一员,由于宏观经济的不景气,小明在毕业当天就华丽丽地失业了! 经历了千难万苦的求职过程,小明特别能理解毕业生的就业之难,所以,他现在准备创建一家专门针对IT ...

  6. HTTPClient实现免登陆请求(带cookie请求)

    背景: 使用httpClient请求某登录型网站,模拟一个操作,一般步骤一个httpclient模式登录->httpClient模拟操作: 此时发现,每次操作都需要进行一次登录,极其浪费时间,是 ...

  7. bzoj 3653

    每个点维护一颗以深度为下标,size-1为值的线段树,保存整颗子树的信息,这样就可以查询了,但是如果为每个节点都建立这么一颗树,显然会MLE,所以考虑在DFS序上建立主席树,然后每个节点原来对应的线段 ...

  8. HDU 1754 I Hate It 线段树RMQ

    I Hate It Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=175 ...

  9. 洛谷OJ P2356 弹珠游戏 维护前缀和

    题目描述 Description MedalPluS 和他的小伙伴 NOIRP 发掘了一个骨灰级别的游戏--超级弹珠. 游戏的内容是:在一个 n*n 的矩阵里,有若干个敌人,你的弹珠可以摧毁敌人,但只 ...

  10. centos7安装apache 新手入门 图文教程

    操作系统 64位CentOS Linux release 7.2.1511 (Core) 下载apache相关软件 1.apr和apr-util,下载地址: http://apr.apache.org ...