Whether the path change of the bare device in ASM affects the operation of the database.

Source: Internet
Author: User

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.

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 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"
The disk information under asm is as follows:

[oracle@node1 ~]$ export ORACLE_SID=+ASM1[oracle@node1 ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 12:55:25 2014Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, 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/raw4DG3_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 Aug 30 17:56:54 2014 from node1[oracle@node2 ~]$ export ORACLE_SID=+ASM2[oracle@node2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 12:56:38 2014Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, 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> 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      /dev/raw/raw7      /dev/raw/raw2      /dev/raw/raw17 rows selected.


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(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(*)----------       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

[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 sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:13:01 2014Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, OLAP, Data Miningand Real Application Testing optionsSQL> col name for a30SQL> col lable for a33SQL> col path for 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 oracle@node2Last login: Sun Aug 31 12:56:27 2014 from node1[oracle@node2 ~]$ export ORACLE_SID=+ASM2[oracle@node2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:14:31 2014Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, OLAP, Data Miningand Real Application Testing optionsSQL> col name for a31SQL> col label for a31SQL> col path for 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 Partitioning, Real Application Clusters, OLAP, Data Miningand Real Application Testing options[oracle@node2 ~]$ export ORACLE_SID=easy2[oracle@node2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 31 13:15:31 2014Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, 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

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.





What should I do if I want to create an Oracle database on ASM in a Linux environment without an ASM disk?

I just sorted out a piece of information in this area. I 'd like to post it to you first.
Prepare the ASM Environment
ASM uses a database instance named "+ ASM" to manage the ASM disk. Therefore, you need to start the ASM instance before configuring the ASM disk. In addition, you must note that the ASM instance must be started before the database instance and run synchronously with the database instance, which is later than that of the database instance. You can use DBCA to create and delete an ASM instance. On the first interface of DBCA, select Configure Automatic Storage Management To Go To The ASM configuration interface.
Run the script as prompted to configure and start CSS (Cluster Synchronization Service). Be sure to run the script as root. The running status is as follows:
#/U01/app/oracle/product/10.2.0/db_1/bin/localconfig add
/Etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root '..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
S1
CSS is active on all nodes.
Oracle CSS service is installed and running under init (1 M)
ASM can use the bare device or ASMLib mode, because the maintenance of the bare device is more technical, this article only discusses the ASMLib mode. To prepare an ASM disk using ASMLib in Linux, you need to install the relevant software. The download link is as follows:

Www.oracle.com/..x.html
When downloading, be sure to select your own operating system and kernel version. I downloaded the following three software:
Oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
Oracleasmlib-2.0.4-1.el5.i386.rpm
Oracleasm-support-2.1.4-1.el5.i386.rpm
Note that the first software must be consistent with the version of your Linux kernel. (In fact, my kernel version is 2.6.18-155. el5, but the corresponding version cannot be found on the official website, so you have to use this 2.6.18-164. the el5 version will show you how to solve this problem later .) Next, install the software by running the rpm command.

# Rpm-ivh oracleasm *
An error may be reported when the oracleasm module is installed.

Oracle rac is usually installed in production on ASM or bare devices.

11g no longer supports bare devices. oracle is gradually forcing the use of asm. Of course, the file system always supports

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.