ASM下裸设备的路径更改是否会影响数据库的执行
通过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下裸设备的路径更改是否会影响数据库的执行的更多相关文章
- Linux平台下裸设备的绑定:
Linux平台下裸设备的绑定: 运用RAW绑定 方法一 raw的配置(1) [root@qs-dmm-rh2 mapper]# cat /etc/rc.local #!/bin/sh # # This ...
- 干货分享:SQLSERVER使用裸设备
干货分享:SQLSERVER使用裸设备 这篇文章也适合ORACLE DBA和MYSQL DBA 阅读 裸设备适用于Linux和Windows 在ORACLE和MYSQL里也是支持裸设备的!! 介绍 大 ...
- SUSE Linux 多路径软件+LVM+裸设备的配置
1.先要查出光纤卡的WWN号,SUSE 10下光纤卡的WWD在/sys/class/fc_host/host5/port_name文件中,有两块卡就会有两个host*的目录 接好光纤后可以在dev下可 ...
- 裸设备和Oracle问答20例
导读裸设备,也叫裸分区(原始分区),是一种没有经过格式化,不被Unix通过文件系统来读取的特殊字符设备.裸设备可以绑定一个分区,也可以绑定一个磁盘.本文收集裸设备和Oracle问答20例. 1.什么叫 ...
- 【测试】RAC搭建(裸设备)
环境描述: 节点一 节点二 主机名 rac1 rac2 IP 192.168.10.11 192.168.10.12 IP-VIP 192.168.10.111 192.168.10.112 IP ...
- Linux平台下:块设备、裸设备、ASMlib、Udev相关关系
对磁盘设备(裸分区)的访问方式分为两种:1.字符方式访问(裸设备):2.块方式访问 Solaris平台 : 在Solaris平台下,系统同时提供对磁盘设备的字符.块方式访问.每个磁盘有两个设备文件名: ...
- 使用OpenFiler来模拟存储配置RAC中ASM共享盘及多路径(multipath)的测试
第一章 本篇总览 之前发布了一篇<Oracle_lhr_RAC 12cR1安装>,但是其中的存储并没有使用多路径,而是使用了VMware自身提供的存储.所以,年前最后一件事就是把多路径学习 ...
- Sun Solairs系统添加裸设备
Sun Solaris系统添加裸设备对表空间进行扩容的大体操作步骤. 1.查看当前卷组信息 --查看当前卷组信息#vxdg list --查看当前卷组中物理磁盘的使用情况#vxdg free |gre ...
- AIX用裸设备给表空间添加数据文件
近期在对生产数据库表空间进行扩容,目的是春节期间保证表空间的使用率,不会出现紧急告警信息. 1.查看表空间使用率的SQL语句 col tablespace_name for a16 col SUM_S ...
随机推荐
- 50个必备jQuery代码段
0. 如何创建嵌套的过滤器: 1 2 3 4 5 //允许你减少集合中的匹配元素的过滤器, //只剩下那些与给定的选择器匹配的部分.在这种情况下, //查询删除了任何没(:not)有(:has) // ...
- 机器学习之路:python k近邻回归 预测波士顿房价
python3 学习机器学习api 使用两种k近邻回归模型 分别是 平均k近邻回归 和 距离加权k近邻回归 进行预测 git: https://github.com/linyi0604/Machine ...
- 【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 ...
- Android之安全机制
根据android四大框架来解说安全机制 代码安全 java不同于C/C++,java是解释性语言,存在代码被反编译的隐患: 默认混淆器为proguard,最新版本为4.7: proguard还可用来 ...
- hdu 2476 区间dp
题意: 给出两个串s1和s2,一次只能将一个区间刷一次,问最少几次能让s1=s2 例如zzzzzfzzzzz,长度为11,我们就将下标看做0~10 先将0~10刷一次,变成aaaaaaaaaaa 1~ ...
- 【10.10校内测试】【线段树维护第k小+删除】【lca+主席树维护前驱后驱】
贪心思想.将a排序后,对于每一个a,找到对应的删除m个后最小的b,每次更新答案即可. 如何删除才是合法并且最优的?首先,对于排了序的a,第$i$个那么之前就应该删除前$i-1$个a对应的b.剩下$m- ...
- ASP.NET MVC的请求处理流程
(1)用户打开浏览器,在地址栏输入某个网址URL并回车,浏览器便开始向该URL指向的服务器发送HTTP请求(一般是GET方式).(2)服务器端的网站服务系统(IIS)接收到该请求,先检查自己是否认识该 ...
- mysql数据库cup飙升处理思路
1.先top查看是那一个进程,哪个端口占用CPU多. 2.show processeslist查看是否由于大量并发,锁引起的负载问题. 3.否则,查看慢查询,找出执行时间长的sql:explain分析 ...
- webpack入门(1)
webpack入门(1) 源码戳这里 ps:每个案例对应相应的demo,例如"案例1"对应"demo1" 一.webpack基本功能及简单案例 安装webpac ...
- 关于Vue的一些小技巧
前言 用Vue开发一个网页并不难,但是也经常会遇到一些问题,其实大部分的问题都在文档中有所提及,再不然我们通过谷歌也能成功搜索到问题的答案,为了帮助小伙伴们提前踩坑,在遇到问题的时候,心里大概有个谱知 ...