Whether the path change of the bare device in ASM affects the operation of the database
Use asm to store database files. In linux, you can use asmlib to manage Block devices, or use bare devices to create an asm disk. In asmlib mode, changing the startup sequence and name of the disk device will not affect the use of asm. But what if the raw device is used directly? We know that asm will store asm-related metadata on the disk. Through the metadata asm, we can understand the disk-related information. Therefore, theoretically changing the name of the bare device will not affect the normal use of asm. Next, we will verify it through experiments.
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian
Oracle 11g from entry to proficient in PDF + CD source code
Installing Oracle 11g R2 using RHEL6 ASM
Oracle 10g manual creation of the ASM Database
Oracle 10g R2 create ASM instance Step By Step
First, check the configuration file of the bare device.
Node1
[Root @ node1 ~] # Cat/etc/udev/rules. d/60-raw.rules # Enter raw device bindings here. # An example wocould 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 wocould 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:
[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,201 0, 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 invalid 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,201 0, 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 invalid 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.
Create a test table:
SQL> select file_name, tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME partition + DG4/easy/datafile/system.272.856543875 SYSTEM + DG4/easy/datafile/export UNDOTBS1 + DG4/easy/datafile/export SYSAUX + DG4/easy/datafile/export 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.
Modify the path name of the bare device and restart the Cluster
[Root @ node1 ~] # Cat/etc/udev/rules. d/60-raw.rules # Enter raw device bindings here. # An example wocould 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,201 0, 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> colname 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 invalid 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,201 0, 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 invalid 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,201 0, 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
It can be seen that the change of the path and name of the bare device does not affect the use of asm. However, we recommend that you maintain the stability of the path name for convenient management.