Automatic Storage Management (ASM) FAQ

We have tried to consolidate list of Frequently Asked Questions (FAQ) on ASM. Please feel free to ask any other question or contribute to this FAQ by using comment section

Frequently Asked Question on ASM

1) What is ASM?

Automatic storage Management (ASM) is a new type of filesystem which was introduced with Oracle 10g. ASM is recommended filesystem for RAC and Single instance ASM for storing database files. This provides direct I/O to the file and performance is comparable with that provided by RAW Devices. Oracle creates a separate instance for this purpose.

2) How do we identify if we are connected to Normal Instance or ASM instance?

Issue following command to identify this

<span style="font-size: small; font-family: arial,helvetica,sans-serif;">
SQL&gt; show parameter instance_type</span>

<span style="font-size: small; font-family: arial,helvetica,sans-serif;">NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_type string asm</span>

In case you are connected to ASM instance, it will display value as asm, otherwise it will display value as RDBMS.

3) What are Diskgroups and Failuregroups?

Diskgroup is a terminology used for logical structure which holds the database files. Each Diskgroup consists of Disks/Raw devices where the files are actually stored. Any ASM file is completely contained within a single disk group. However, a disk group might contain files belonging to several databases and a single database can use files from multiple disk groups.

Failuregroups are used when using Normal/High Redundancy. They contain the mirrored ASM extents and must be containing different disks and preferably on separate disk controller.

4)Can ASM be used as replacement for RAID?

ASM is supposed to stripe the data and also mirror the data (if Using Normal, High Redundancy). So this can be used as a alternative for RAID 0+1 solutions

5) How does ASM provides Redundancy?

When you create a disk group, you specify an ASM disk group type based on one of the following three redundancy levels:

  • Normal for 2-way mirroring - When ASM allocates an extent for a normal redundancy file, ASM allocates a primary copy and a secondary copy. ASM chooses the disk on which to store the secondary copy in a different failure group other than the primary copy.
  • High for 3-way mirroring. In this case the extent is mirrored across 3 disks.
  • External to not use ASM mirroring. This is used if you are using Third party Redundancy mechanism like RAID, Storage arrays.

6) Can we change the Redundancy for Diskgroup after its creation.

No, we cannot modify the redundancy for Diskgroup once it has been created. To alter it we will be required to create a new Diskgroup and move the files to it. This can also be done by restoring full backup on the new Diskgroup. Following metalink note describes the steps

Note.438580.1 - How To Move The Database To Different Diskgroup (Change Diskgroup Redundancy)

7) I am unable to open the ASM instance. What is the reason?

ASM instance does not have open stage. It has got only two options

  • Nomount- This starts the ASM instance
  • Mount- At this stage, Diskgroup defined in ASM_DISKGROUPS parameter are mounted

When you try to open the ASM instance , you get following error

<span style="font-size: small; font-family: arial,helvetica,sans-serif;">SQL&gt; alter database open;
alter database open
*
ERROR at line 1:
ORA-15000: command disallowed by current instance type</span>

8)Can ASM instance and database (rdbms) be on different servers?

ASM instance and Database (rdbms) have to be present on same server. Otherwise it will not work.


9)
Can we see the files stored in the ASM instance using standard unix commands.

No, you cannot see the files using standard unix commands like ls. You need to use utility called asmcmd to do this. This is present in 10.2 and above.e.g
/home/oracle>asmcmd
Asmcmd>

You can use help command to see the options.

<span style="font-size: small; font-family: arial,helvetica,sans-serif;">Note: - You can use asmcmd for 10.1 database also. For this you can copy the </span><span style="font-size: small; font-family: arial,helvetica,sans-serif;">asmcmdcore and asmcmd file from 10.2 ORACLE_HOME to 10.1 ORACLE_HOME. Else you can download the files from Metalink </span><span style="font-size: small; font-family: arial,helvetica,sans-serif;"><strong>Note:332853.1</strong></span>

10) What kind of files can be stored on ASM Diskgroup.

You can store the following file types in ASM disk groups:

  • Control files
  • Datafiles, temporary datafiles, and datafile copies
  • SPFILEs
  • Online redo logs, archive logs, and Flashback logs
  • RMAN backups
  • Disaster recovery configurations
  • Change tracking bitmaps
  • Data Pump dumpsets

Note: Oracle executables and ASCII files, such as alert logs and trace files, cannot be stored in ASM disk groups.

11)Can we use ASM for storing Voting Disk/OCR in a RAC instance?

No. You cannot use ASM for storing the voting disk and OCR. It is due to the fact that Clusterware starts before ASM instance and it should be able to access these files which is not possible if you are storing it on ASM. You will have to use raw devices or OCFS or any other shared storage.

12)Does ASM instance automatically rebalances and takes care of hot spots?

No. This is a myth and ASM does not do it. It will initiate automatic rebalance only when a new disk is added to Diskgroup or we drop a disk from existing Diskgroup.

13) What is ASMLIB?


ASMLIB is the support library for the ASM. ASMLIB allows an Oracle database using ASM more efficient and capable access to diskgroups. The purpose of ASMLIB, is to provide an alternative interface to identify and access block devices. Additionally, the ASMLIB API enables storage and operating system vendors to supply extended storage-related features. You can read more about ASMLIB in

Note: 359266.1 - FAQ ASMLIB CONFIGURE, VERIFY, TROUBLESHOOT

ASMLIB for linux can be downloaded from following link

http://www.oracle.com/technology/tech/linux/asmlib/index.html

14) What is SYSASM role?
Starting from Oracle 11g, SYSASM role can be used to administer the ASM instances. You can continue using SYSDBA role to connect to ASM but it will generate following warning messages at time of startup/shutdown, create Diskgroup/add disk ,etc

<span style="font-size: small; font-family: arial,helvetica,sans-serif;">Alert entry
WARNING: Deprecated privilege SYSDBA for command 'STARTUP'</span>

15) How can we copy the files from/to ASM?

You can use RMAN or DBMS_FILE_TRANSFER.COPY_FILE procedure to copy the files to/from ASM from/to Filesystem. Starting from Oracle 11g, you can use cp command in asmcmd to perform the same between ASM Diskgroups and also to OS Filesystem.

16) Can we use BCV to clone the ASM Diskgroup on same host?

Diskgroup Cloning is not supported on the same host using BCV. You have no other option to use except RMAN DUPLICATE. You can find more detail on BCV and ASM in below whitepaper

http://www.oracle.com/technology/products/database/asm/pdf/asm-on-emc-5_3.pdf

17) Can we edit the ASM Disk header to change the Diskgroup Name?

No. This cannot be done. Please find details in

http://askdba.org/weblog/?p=128

18) Whats is Kfed?

kfed is a utility which can be used to view the ASM Disk information. Syntax for using it is

kfed read devicename

Read more about kfed here.

19) Can we use block devices for ASM Disks?

Yes. Starting from Oracle Database 10.2 block devices can be used directly for ASM Disks in Linux. This is not true for other Unix based systems where block devices are not supported yet.

Along with this it is recommended to use a Device mapping functionality so that disk mapping is preserved after disk failure. This is important when you have devices as /dev/sda,/dev/sdb,/dev/sdc and due to some reason the devices are not detected at next reboot (say /dev/sdb), the system will map the incorrect device (i.e /dev/sdc will be marked as /dev/sdb). You can use following methods for preserving disk names

-udev – the role of udev is to provide device persistency and naming consistency.This is especially important for the Oracle Cluster Registry (OCR) and Voting disks required by Oracle Clusterware.

-ASMLIB – ASMLIB will provide device management specifically for ASM disk devices.

Refer to following Whitepaper for more details

http://www.oracle.com/technology/products/database/asm/pdf/device-mapper-udev-crs-asm%20rh4.pdf

20)Is it mandatory to use disks of same size and characteristics for Diskgroups?

No, it is not mandatory to use the disks of same size and characteristics for Diskgroups though it is a Recommended Practice.

Same size disk for Failuregroups in Normal/High redundancy will prevent issues like ORA-15041 as the file extents needs to be mirrored across the disks. Also as Oracle distributes data based on capacity, so larger disk will have more data stored in it and which will result in higher I/O to disk and eventually can lead to sub-optimal performance.

Moreover having disks of different characteristic like varying disk speed can impact the performance.

When managing disks with different size and performance capabilities, best practice is to group them into disk groups according to their characteristics. So you can use higher speed disks for your database files while other disks can be part of Diskgroup used for Flash Recovery Area.

21)Do we need to install ASM and Oracle Database Software in different ORACLE_HOME?

No. Again installing ASM and Oracle Database Software in different ORACLE_HOME is not mandatory but a best practice. This is useful in cases when we need to have multiple databases using same ASM instance and you need to patch only one of them. E.g You need to apply a CBO patch to one of 10.2 database while your other 10.1 database using different installation does not require it. In this case having a ASM_HOME separate from 10.2 ORACLE_HOME will allow your 10.1 database to keep running. Thus this approach is useful for High Availability.

22)What is the maximum size of Disk supported by ASM?

ASM supports disks upto 2Tb, so you need to ensure that lun size should be less then 2Tb. 10.2.0.4 and 11g database will give error if you try to create a diskgroup with ASM disks having disk size >2Tb.

23)I have created Oracle database using DBCA and having a different home for ASM and Oracle Database. I see that listener is running from ASM_HOME. Is it correct?

This is fine. When using different home for ASM, you need to run the listener from ASM_HOME instead of ORACLE_HOME.

Additional Links for Further Reading

http://www.oracle.com/technology/products/database/asm/index.html http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/toc.htm

http://www.oracle.com/technology/products/database/asm/pdf/device-mapper-udev-crs-asm%20rh4.pdf
Note:359266.1 - FAQ ASMLIB CONFIGURE,VERIFY, TROUBLESHOOT
Note 266028.1 - ASM Using Files Instead of Real Devices on Linux
Note.438580.1 - How To Move The Database To Different Diskgroup (Change Diskgroup Redundancy)

14 thoughts on “Automatic Storage Management (ASM) FAQ

  1. Hi Amit, It always good to see updates on your Blog…well i have a doubt. Is Clusterware required for ASM, to make use of it in Single Instance Database.
    Thanks
    Ravi

  2. Ravi,

    Clusterware is not required for ASM to work in a Single Instance Database. When you install ASM, you would be required to run “localconfig add” on Unix systems. This will create a service called Cluster Syncronization Service (CSS) which will take care of ASM instance. There is no need for CRS,EVMD and OPROCD.

    Hope this clears your doubt. Else let me know!

    Cheers
    Amit

  3. Hi, I have the following question about a RAC and ASM : when I try to create a new database using dbca on an IBM cluster with 10gR1, I get the following errors:
    ORA-01501 create database failed
    ORA-00200 controlfile could not be created
    ORA-00202 controlfile : ‘+PRODFLASHRECOVERY/rdq/control01.ctl’
    ORA-15001 disk group “PRODFLASHRECOVERY” does not exist or is not mounted
    ORA-15055 unable to connect to ASM instance
    ORA-12545 connect failed because target host or object does not exist

    The asm instance is up and running, the name of the diskgroup is selected from the alternative presented by dbca

    Any ideas?
    Thanks a lot
    Roberto

  4. Hi Roberto,

    Did you check Metalink Note:332046.1

    If above note does not work, then can you give output of following

    SQL> select INST_ID,GROUP_NUMBER,NAME,STATE from GV$ASM_DISKGROUP;

    Also check Alert.log for any other errors

    Cheers
    Amit

  5. Roberto,

    As you said that the ASM instance is mounted and running, i think this is the cause of the problem.

    In DataBase versions earlier than 10.1.0.5 this issue can come because of the fact that the ASM diskgroups are already mounted.

    If you are at some earlier version than 10.1.0.5 than try to upgrade to 10.1.0.5 (PatchSet) and again redo the process.

    Cheers !!

  6. Hello,

    I have problem with asmdisk detection after reboot.

    This is started after putting the udev rule to set disk timeout to 60 sec.

    Udev rule:
    BUS=”scsi”, PROGRAM=”/sbin/scsi_timeout.sh”
    Script content:
    #!/bin/sh
    for i in /sys/block/sd*/device;do
    echo 60 > $i/timeout
    done
    ============
    OS: RHEL 4, 2.6.9-55.0.6.ELsmp
    =============
    Oracle version: 10.2
    ===========

    If we remove the rule and reboot the server it is working fine.
    Any idea?

  7. Hi,

    I’m looking for a Procedure how to migrate ASM (RAW-Devices) from an old SAN-Storage to a new one.
    We have 2 Nodes Rac (11gr1) deployed on sun solaris sparc 64 with two hba cards, and 5 databases on each node including +ASM1 and +ASM2 instances.
    To get near Informations:

    $ kfod disks=all
    ——————————————————————————–
    Disk Size Path User Group
    ================================================================================
    1: 102394 Mb /dev/rdsk/emcpower10b oracle dba
    2: 102394 Mb /dev/rdsk/emcpower11b oracle dba
    3: 499 Mb /dev/rdsk/emcpower1b oracle oinstall
    4: 6143 Mb /dev/rdsk/emcpower2b oracle dba
    5: 102394 Mb /dev/rdsk/emcpower3b oracle dba
    6: 102394 Mb /dev/rdsk/emcpower4b oracle dba
    7: 102394 Mb /dev/rdsk/emcpower5b oracle dba
    8: 6143 Mb /dev/rdsk/emcpower7b oracle dba
    9: 61436 Mb /dev/rdsk/emcpower8b oracle dba
    10: 102394 Mb /dev/rdsk/emcpower9b oracle dba
    ——————————————————————————–
    ORACLE_SID ORACLE_HOME
    ================================================================================
    +ASM2 /opt/oracle/product/11gr1/db_1
    +ASM1 /opt/oracle/product/11gr1/db_1

    $ kfod asm_diskstring=discoverystring
    ——————————————————————————–
    ORACLE_SID ORACLE_HOME
    ================================================================================
    +ASM2 /opt/oracle/product/11gr1/db_1
    +ASM1 /opt/oracle/product/11gr1/db_1

    $ crs_stat -t
    Name Typ Ziel Status Host
    ————————————————————
    ora….11.inst application ONLINE ONLINE lbd-db1
    ora….12.inst application ONLINE ONLINE lbd-db2
    ora.LBD01.db application ONLINE ONLINE lbd-db2
    ora….21.inst application ONLINE ONLINE lbd-db1
    ora….22.inst application ONLINE ONLINE lbd-db2
    ora.LBD02.db application ONLINE ONLINE lbd-db1
    ora….31.inst application ONLINE ONLINE lbd-db1
    ora….32.inst application ONLINE ONLINE lbd-db2
    ora.LBD03.db application ONLINE ONLINE lbd-db2
    ora….01.inst application ONLINE ONLINE lbd-db1
    ora….02.inst application ONLINE ONLINE lbd-db2
    ora.LBD10.db application ONLINE ONLINE lbd-db2
    ora….SM1.asm application ONLINE ONLINE lbd-db1
    ora….B1.lsnr application ONLINE ONLINE lbd-db1
    ora….db1.gsd application ONLINE ONLINE lbd-db1
    ora….db1.ons application ONLINE ONLINE lbd-db1
    ora….db1.vip application ONLINE ONLINE lbd-db1
    ora….SM2.asm application ONLINE ONLINE lbd-db2
    ora….B2.lsnr application ONLINE ONLINE lbd-db2
    ora….db2.gsd application ONLINE ONLINE lbd-db2
    ora….db2.ons application ONLINE ONLINE lbd-db2
    ora….db2.vip application ONLINE ONLINE lbd-db2

    SYS@+ASM1 > select GROUP_NUMBER, DISK_NUMBER, NAME, TOTAL_MB, PATH, FAILGROUP from v$asm_disk order by 1,2,3,4,5;
    GROUP DISK NAME TOTAL_MB PATH FAILGROUP
    ———- ———- ————— ———- —————————— ————
    0 7 0 /dev/rdsk/emcpower1b
    1 0 DATA_0000 102394 /dev/rdsk/emcpower10b DATA_0000
    1 1 DATA_0001 102394 /dev/rdsk/emcpower11b DATA_0001
    1 2 DATA_0002 102394 /dev/rdsk/emcpower3b DATA_0002
    1 3 DATA_0003 102394 /dev/rdsk/emcpower4b DATA_0003
    1 4 DATA_0004 102394 /dev/rdsk/emcpower5b DATA_0004
    1 5 DATA_0005 102394 /dev/rdsk/emcpower9b DATA_0005
    2 0 LOG1_0000 6143 /dev/rdsk/emcpower2b LOG1_0000
    3 0 LOG2_0000 6143 /dev/rdsk/emcpower7b LOG2_0000
    4 0 RECOVLBD_0000 61436 /dev/rdsk/emcpower8b RECOVLBD_0000

    Have you got any idea to do that, or could you give me a link to get Infos about the case.

    Thanks and regards
    Niroobakhsh
    from Germany

  8. Hi Niroobakhsh,

    Fastest way of migrating ASM storage would be to create new volumes of same size on new storage. Shutdown the databases and ASM instance and replicate the old disks to new disks. Make the new disks available on server (remove the reference of old one) and ensure the disk permissions are correct. Then simply start ASM instance and mount diskgroup.

    Cheers
    Amit

  9. HI,
    i am newbie….

    please guide me!

    My manager asked me to configure ASM in 11g with single instance database!
    with Normal redundancy with two disks as one disgroup(mirror)
    he asked me two copies of data wil be there in two disks respectively…
    he wants to write data to one disk and read data from one disk and he suggested me that…. using preferred Mirror Read 11g we can achieve this!

    guide me…is there any document for this….

    please ……..

  10. Hi Pawan,

    We cannot force the writes to a specific disk. At least I am not aware of any such thing.
    Oracle will write the primary-copy to any disk in a normal redundancy environment.
    The default behavior is to read from the primary-copy, which can be alterted by the parameter that you have mentioned.
    If we assume that all the data is written simultaneously to one disk, there are chances of performance degradation as the same disk controller will be active at one time to do I/Os.

    – Saurabh Sood

Leave a Reply