By using ASM to store database files, you can use Asmlib to manage block devices under Linux, or you can build ASM disks directly with bare devices. In Asmlib mode, the disk device boot sequence and name changes do not affect the use of ASM, but what happens if you use a bare device directly? We know that ASM stores the ASM-related metadata on disk, through which ASM can understand the information about the disk, so the theory of the naked device name change does not affect the normal use of ASM. Below, experiment to verify.
First look at the following, bare device configuration file
Node1
[[email protected] ~]# cat/etc/udev/rules.d/60-raw.rules # Enter Raw device bindings here.## An example would be:# AC tion== "Add", kernel== "SDA", run+= "/bin/raw/dev/raw/raw1%N" # to Bind/dev/raw/raw1 To/dev/sda, or# action== "Add", E nv{major}== "8", env{minor}== "1", run+= "/bin/raw/dev/raw/raw2%M%M" # to BIND/DEV/RAW/RAW2 to the device with MAJOR 8, MI Nor 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:
[email protected] 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 "
The disk information under ASM is as follows:
[[email protected] ~]$ export oracle_sid=+asm1[[email protected] ~]$ sqlplus/as sysdbasql*plus:release 10.2.0.5.0-production on Sun 12:55:25 2014Copyright (c) 1982, Oracle. All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the part Itioning, real application Clusters, OLAP, Data miningand Real application testing optionssql> col name for a30sql> Col label for a30sql> Col path for a30sql> set linesize 200sql>/name label Path---------------------- --------------------------------------------------------------------Dg1_0000/dev/raw/raw3dg2_0000/dev/raw/ra W4dg3_0000/dev/raw/raw5dg3_0001/dev/raw/raw6dg4_0000/dev/raw/raw7/dev/raw/raw2/dev/raw/raw17 Rows selected. Sql> ho ssh node2 last Login:sat-17:56:54 from node1[[email protected] ~]$ export oracle_sid=+asm2[[e Mail protected] ~]$ sqlplus/as sysdbasql*pluS:release 10.2.0.5.0-production on Sun 12:56:38 2014Copyright (c) 1982, Oracle. All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the part Itioning, real application Clusters, OLAP, Data miningand Real application testing optionssql> col name for a30sql> Col label for A30sql> Col path to a30sql> set linesize 200sql> Select Name,label,path from V$asm_disk ORDER by 1 ; NAME LABEL PATH------------------------------------------------------------------------------------------DG1 _0000/dev/raw/raw3dg2_0000/dev/raw/raw4dg3_0000/dev/raw/raw5dg3_0001/dev/raw/raw6dg4_0000/de V/raw/raw7/dev/raw/raw2/dev/raw/raw17 rows selected.
To create a test table:
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 userssql> CREATE TABLE t1 (ID number,name varchar2) 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 (*)---------- 128sql> update t1 set id=rownum,name=rownum;128 rows updated. Sql> commit; Commit complete.
Modify the path name of the bare device and restart the cluster
[[email protected] ~]# cat/etc/udev/rules.d/60-raw.rules # Enter Raw device bindings here.## An example would be:# AC tion== "Add", kernel== "SDA", run+= "/bin/raw/dev/raw/raw1%N" # to Bind/dev/raw/raw1 To/dev/sda, or# action== "Add", E nv{major}== "8", env{minor}== "1", run+= "/bin/raw/dev/raw/raw2%M%M" # to BIND/DEV/RAW/RAW2 to the device with MAJOR 8, MI Nor 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"
[[email protected] ~]$ export oracle_sid=+asm1[[email protected] ~]$ sqlplus/as sysdbasql*plus:release 10.2.0.5.0-production on Sun 13:13:01 2014Copyright (c) 1982, Oracle. All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the part Itioning, real application Clusters, OLAP, Data miningand Real application testing optionssql> col name for a30sql> Col lable for a33sql> Col path to a33sql> set linesize 222sql> col label for a31sql>/name label PATH----------------------------------------------------------------------------------------------Dg1_0000/dev /raw/raw7dg2_0000/dev/raw/raw6dg3_0000/dev/raw/raw5dg3_0001/dev/raw/raw4dg4_0000/dev/raw/raw3 /dev/raw/raw1/dev/raw/raw27 rows selected. Sql> ho ssh [email protected]last login:sun 12:56:27 from node1[[email protected] ~]$ export ORA cle_sid=+asm2[[email protected] ~]$ sqlplus/as sysdbasql*plus:release 10.2.0.5.0-production on Sun 13:14:31 2014Copyrig HT (c) 1982, Oracle. All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the part Itioning, real application Clusters, OLAP, Data miningand Real application testing optionssql> col name for a31sql> Col label for A31sql> Col path to a31sql> set linesize 211sql> Select Name,label,path from V$asm_disk ORDER by 1 ; Namelabelpath---------------------------------------------------------------------------------------------dg1_ 0000/dev/raw/raw3dg2_0000/dev/raw/raw4dg3_0000/dev/raw/raw5dg3_0001/dev/raw/raw6dg4_0000/dev/raw/raw7/dev/raw/ Raw2/dev/raw/raw17 rows selected. Sql> exitdisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the Partiti Oning, real application Clusters, OLAP, Data miningand Real application Testing Options[[email protecTed] ~]$ export oracle_sid=easy2[[email protected] ~]$ sqlplus/as sysdbasql*plus:release 10.2.0.5.0-production o n Sun 13:15:31 2014Copyright (c) 1982, Oracle. All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the part Itioning, real application Clusters, OLAP, Data miningand Real Application Testing optionssql> SELECT COUNT (*) from T1; COUNT (*)----------128sql> select min (id), max (id) from T1; MIN (ID) MAX (ID)--------------------1 128
This shows that the change of the path and name of the bare device does not affect the use of ASM, however, we still recommend maintaining the stability of the path name for easy management.
Does the path change of a bare device in ASM affect the operation of the database?