Oracle ASM is widely used in IT industry. Here I have compiled Top 46 Oracle ASM Interview Questions to enhance the knowledge about Oracle ASM instance
Question 1 What is ASM in Oracle?
Oracle ASM is Oracle’s volume manager specially designed for Oracle database data. It is available since Oracle database version 10g and many improvements have been made in versions 11g release 1 and 2 and 12c
ASM offers support for Oracle RAC clusters without the requirement to install 3rd party software, such as cluster aware volume managers or file systems.
ASM is shipped as part of the database server software (Enterprise and Standard editions) and does not cost extra money to run.
ASM simplifies administration of Oracle related files by allowing the administrator to reference disk groups
rather than individual disks and files, which are managed by ASM.
The ASM functionality is an extention of the Oracle Managed Files (OMF) functionality that also includes striping and mirroring to provide balanced and secure storage. The new ASM functionality can be used in combination with existing raw and cooked file systems, along with OMF and manually managed files.
Question 2 What is ASM instance in Oracle?
Answer The ASM functionality is controlled by an ASM instance. This is not a full database instance, just the memory structures and as such is very small and lightweight.
Characteristics of Oracle ASM instance
1)The ASM instance,which is generally named +ASM1, is started with the INSTANCE_TYPE=ASM init.ora parameter
2) Do not mount the database but manage metadata required to make ASM files available for DB instances
3) DB Instance access ASM files directly and contact ASM instance only for the layout of ASM files
4) Requires only the init.ora file for startup
5)Instance Name is +ASM or +ASM1.for RAC
6) ASM instance can be started in same database home or seperate home also
Question 3 What are ASM Background Processes in Oracle?
Answer RBAL – Oracle background process. In an ASM instance coordinated rebalancing operations. In a DB instance, opens and mount diskgroups from the local ASM instance.
ARBx – Oracle backgroud processes. In an ASM instance, a slave for rebalancing operations
PSPx – Oracle backgroud processes. In an ASM instance, Process Spawners
GMON – Oracle backgroud processes. In an ASM instance, diskgroup monitor.
ASMB – Oracle background process. In an DB instance, keeps a (bequeath) persistent DB connection to the local ASM instance. Provides heart-beat and ASM statistics. During a diskgroups rebalancing operation ASM communicates to the DB AU changes via this connection.
O00x – Oracle backgroud processes. Slaves used to connected from the DB to the ASM instance for ‘short operations’.
Question 4 What are ASM instance initialization parameters?
Answer INSTANCE_TYPE – Set to ASM or RDBMS depending on the instance type. The default is RDBMS.
DB_UNIQUE_NAME – Specifies a globally unique name for the database. This defaults to +ASM but must be altered if you intend to run multiple ASM instances.
ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instance. The valid values range from 1 to 11, with 1 being the default. The higher the limit the more resources are allocated resulting in faster rebalancing operations. This value is also used as the default when the POWER clause is omitted from a rebalance operation.
ASM_DISKGROUPS – The list of disk groups that should be mounted by an ASM instance during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM configuration changes are automatically reflected in this parameter.
ASM_DISKSTRING – Specifies a value that can be used to limit the disks considered for discovery. Altering the default value may improve the speed of disk group mount time and the speed of adding a disk to a disk group. Changing the parameter to a value which prevents the discovery of already mounted disks results in an error. The default value is NULL allowing all suitable disks to be considered.
What are Advantages of ASM in Oracle?
a) Provides automatic load balancing over all the available disks, thus reducing hot spots in the file system
b) Prevents fragmentation of disks, so you don’t need to manually relocate data to tune I/O performance
c) Adding disks is straight forward – ASM automatically performs online disk reorganization when you add or remove storage
d) Uses redundancy features available in intelligent storage arrays
e)The storage system can store all types of database files
f) Using disk group makes configuration easier, as files are placed into disk groups
g)ASM provides stripping and mirroring
h) ASM and non-ASM oracle files can coexist
Question 5 How Oracle ASM instance works?
Answer The ASM instance manages and communicates the map as to where each file extent resides. It also controls the process of rebalancing the placement of the extents when the storage allocation is changed ie, when the disk is added or removed from ASM. As an ASM instance uses only about 64-MB for its system global area, it requires a relatively small amount of system resource. In a RAC configuration, an ASM instance on each node in the cluster manages all disk groups for that node, in coordination with the other nodes in the cluster.
The ASM instance creates an extent map which has a pointer to each 1MB extent of the data file is located. When a database instance creates or opens a database file that is managed by ASM, the database instance messages the ASM instance and ASM returns an extent map for that file. From that point the database instance performs all I/O directly to the disks unless the location of that file is being changed. Three things might cause the extent map for a database instance to be updated: 1) Rebalancing the disk layout following an storage configuration change (adding or dropping a disk from a disk group), 2) Opening of a new database file and 3) extending an existing database file when a tablespace is enlarged.
Question 6 What is ASM Disks ?
Answer The physical disks are known as ASM disks
Question 7 What is ASM diskgroups?
Answer ASM disk groups, each of which comprise of several physical disks that are controlled as a single unit
Question 8 What is Failure groups
Answer They are defined within a disk group to support the required level of redundancy. For two-way mirroring you would expect a disk group to contain two failure groups so individual files are written to two locations.
Question 9 Why should we use separate ASM home?
Answer ASM should be installed separately from the database software in its own ORACLE_HOME directory. This will allow you the flexibility to patch and upgrade ASM and the database software independently.
Question 10 How many ASM instances should one have?
Answer Several databases can share a single ASM instance. So, although one can create multiple ASM instances on a single system, normal configurations should have one and only one ASM instance per system.
For clustered systems, create one ASM instance per node (called +ASM1, +ASM2, etc).
Question 11 How many diskgroups should one have?
Answer Generally speaking one should have only one disk group for all database files – and, optionally a second for recovery files i.e +DATA for datafile and +FRA for Recovery files
Here is an example:
CREATE DISKGROUP DATA EXTERNAL REDUNDANCY DISK ‘/dev/raw1′, ‘/dev/raw2′;
CREATE DISKGROUP FRA EXTERNAL REDUNDANCY DISK ‘/dev/raw3′, ‘/dev/raw4′;
Here is an example how you can enable automatic file management with such a setup in each database served by that ASM instance:
ALTER SYSTEM SET db_create_file_dest = ‘+DATA’ SCOPE=SPFILE;
ALTER SYSTEM SET db_recovery_file_dest = ‘+FRA’ SCOPE=SPFILE;
You may also decide to introduce additional disk groups – for example, if you decide to put historic data on low cost disks, or if you want ASM to mirror critical data across 2 storage cabinets.
Data with different storage characteristics should be stored in different disk groups. Each disk group can have different redundancy (mirroring) settings (high, normal and external), different fail-groups, etc. However, it is generally not necessary to create many disk groups with the same storage characteristics (i.e. +DATA1, +DATA2, etc. all on the same type of disks).
Question 12 What is stripping and mirroring.
Answer Striping is spreading data across multiple disks so that IO is spread across multiple disks and hence increase in throughput. It provides read/write performance but fail over support.
ASM offers two types of striping, with the choice depending on the type of database file. Coarse striping uses a stripe size of 1MB, and you can use coarse striping for every file in your database, except for the control files, online redo log files, and flashback files. Fine striping uses a stripe size of 128KB. You can use fine striping for control files, online redo log files, and flashback files.
Mirroring means redundancy. It may add performance benefit for read operations but overhead for write operations. It’s basic purpose is to provide fail over support.
There are three ASM mirroring options:
High Redundancy – In this configuration, for each primary extent, there are two mirrored extents. For Oracle Database Appliance this means, during normal operations there would be three extents (one primary and two secondary) containing the same data, thus providing “high” level of protection. Since ASM distributes the partnering extents in a way that prevents all extents to be unable due to a component failure in the IO path, this configuration can sustain at least two simultaneous disk failures on Oracle Database Appliance (which should be rare but is possible).
Normal Redundancy – In this configuration, for each primary extent, there is one mirrored (secondary) extent. This configuration protects against at least one disk failure. Note that in the event a disk fails in this configuration, although there is typically no outage or data loss, the system operates in a vulnerable state, should a second disk fail while the old failed disk replacement has not completed. Many Oracle Database Appliance customers thus prefer the High Redundancy configuration to mitigate the lack of additional protection during this time.
External Redundancy – In this configuration there are only primary extents and no mirrored extents. This option is typically used in traditional non-appliance environments when the storage sub-system may have existing redundancy such as hardware mirroring or other types of third-party mirroring in place. Oracle Database Appliance does not support External Redundancy.8. What is a diskgroup?
A disk group consists of multiple disks and is the fundamental object that ASM manages. Each disk group contains the metadata that is required for the management of space in the disk group. The ASM instance manages the metadata about the files in a Disk Group in the same way that a file system manages metadata about its files. However, the vast majority of I/O operations do not pass through the ASM instance. In a moment we will look at how file
I/O works with respect to the ASM instance.
Question 13 What is ASM Rebalancing?
Answer The rebalancing speed is controlled by the ASM_POWER_LIMIT initialization parameter. Setting it to 0 will disable disk rebalancing.
ALTER DISKGROUP DATA REBALANCE POWER 11;
ALTER DISKGROUP DATA REBALANCE POWER 5;
ALTER DISKGROUP DATA REBALANCE POWER 8;
Question 14 What happens when an Oracle ASM diskgroup is created?
Answer When an ASM diskgroup is created, a hierarchical filesystem structure is created.
Question 15 How does this filesystem structure appear?
Answer Oracle ASM disk group’s filesystem structure is similar to UNIX filesystem hierarchy or Windows filesystem hierarchy.
Question 16 Where are the Oracle ASM files stored?
Answer Oracle ASM files are stored within the Oracle ASM diskgroup. If we dig into internals, oracle ASM files are stored within the Oracle ASM filesystem structures.
Question 17 How are the Oracle ASM files stored within the Oracle ASM filesystem structure?
Answer Oracle ASM files are stored within the Oracle ASM filesystem structures as objects that RDBMS instances/Oracle database instance access. RDBMS/Oracle instance treats the Oracle ASM files as standard filesystem files.
Question 18 What are the Oracle ASM files that are stored within the Oracle ASM file hierarchy?
Answer Files stored in Oracle ASM diskgroup/Oracle ASM file structures include:
3) Server Parameter Files(SPFILE)
4) Redo Log files
Question 19 How can you access a database file in ASM diskgroup under RDBMS?
Answer Once the ASM file is created in ASM diskgroup, a filename is generated. This file is now visible to the user via the standard RDBMS view V$DATAFILE.
Question 20 What will be the syntax of ASM filenames?
Answer ASM filename syntax is given below
+diskgroup_name – Name of the diskgroup that contains this file
database_name – Name of the database that contains this file
datafile – Can be one among 20 different ASM file types
tag_name – corresponds to tablespace name for datafiles, groupnumber for redo log files
file_number – file_number in ASM instance is used to correlate filenames in database instance
incarnation_number – It is derived from the timestamp. IT is used to provide uniqueness
Question 21 What is an incarnation number?
Answer An incarnation number is a part of ASM filename syntax. It is derived from the time stamp. Once the file is created, its incarnation number doesn’t change.
Question 22 What is the use of an incarnation number in Oracle ASM filename?
Answer Incarnation number distinguishes between a new file that has been created using the same file number and another file that has been deleted
Question 23 What is an oracle flex ASM?
Answer Oracle flex ASM is a feature that enables an ASM instance to run on separate physical servers from the database servers
Question 24 What is the use of asmadmin?
Answer asadmin is the operating system group that holds users who have sysasm database privilege. This privilege is needed for operations like mounting disk group, dismounting disk group, storage administration
Question 25 What is the purpose of asmoper operating system group?
Answer asmoper operating system group is used for users that have the privilege to startup and stop the oracle ASM instance. The database privilege for these users will be sysoper for asm
Question 26 What is the difference between asmdba and asmoper?
Answer The users belonging to asmdba group have sysdba database privilege at ASM level. This is the highest administrative privilege needed for oracle ASM. Whereas, asmoper is given sysoper privilege which is less than asmdba
Question 27 How to copy files between asm disk groups?
Answer ASMCMD command cp can be used to copy files between ASM disk groups on local instance as well as remote instances
Question 28 What is ASM metadata and where is it present?
Answer ASM metadata is the information that ASM uses to control the disk group.It is present within a disk group.
Question 29 What is an ASM metadata composed of?
Answer An ASM metadata includes the following:
1) The disks that belong to a disk group
2) Amount of space available within a disk group
3) The filenames of the files within a disk group
4) The location of disk group datafile data extents
5) A redo log that records information about automatically changing data blocks
Question 30 What is oracle ASM filter driver?
Answer Oracle ASM filter driver is a new feature in Oracle database 12c release 2 126.96.36.199. As an abbreviation this is called Oracle ASMFD that happens to be a kernel module. this kernel modules is included in path of I/O path of oracle asm disks. this module is included to protect the underlying ASM disks from unnecessary typically non-oracle writes related I/O operations which in turn protects disks from being corrupt
Question 31 What it the ASM POWER_LIMIT?
Answer This is the parameter which controls the number of Allocation units the ASM instance will try to rebalance at any given time. In ASM versions less than 188.8.131.52 the default value is 11 however it has been changed to unlimited in later versions.
Question 32 What is a rolling upgrade?
Answer A patch is considered a rolling if it is can be applied to the cluster binaries without having to shutting down the database in a RAC environment. All nodes in the cluster are patched in a rolling manner, one by one, with only the node which is being patched unavailable while all other instance open.
Question 33 How does ASM provides Redundancy?
Answer When you create a disk group, you specify an ASM disk group type based on one of the following three redundancy levels:
1) 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.
2) High for 3-way mirroring. In this case the extent is mirrored across 3 disks.
3)External to not use ASM mirroring. This is used if you are using Third party Redundancy mechanism like RAID, Storage arrays.
Question 34 Can we change the Redundancy for Diskgroup after its creation?
Answer 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.
Question 35 Does ASM instance automatically rebalances and takes care of hot spots?
Answer 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.
Question 36 What is ASMLIB?
Answer 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.
Question 37 What is SYSASM role?
Answer 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
WARNING: Deprecated privilege SYSDBA for command ‘STARTUP’
Question 38 Whats is Kfed?
Answer kfed is a utility which can be used to view the ASM Disk information. Syntax for using it is
kfed read devicename
Question 39 ASM and Cluster Synchronization Service
Answer An ASM storage system requires the use of an additional specialized database instance called ASM, which will actually manage the storage for a set of Oracle databases. In order to use ASM storage for your Oracle databases, you must first ensure that you have Oracle’s Cluster Synchronization Service (CSS) running on your databases.
CSS is responsible for synchronizing ASM instances and your database instances, and it is
installed as part of your Oracle software. CSS also synchronizes recovery from an ASM instance failure. You can find out if the CSS service is running by using the following command:
Question 40 What processes does the rebalancing?
Answer RBAL, ARBn
Question 41 How to find out the databases, which are using the ASM instance?
SQL> select DB_NAME from V$ASM_CLIENT;
Question 42 What are different types of striping in ASM & their differences?
Answer Fine-grained striping
Question 43 What is the best LUN size for ASM ?
Answer There is no best size. In most cases the storage team will dictate to you based on their standardized LUN size. The ASM administrator merely has to communicate the ASM Best Practices and application characteristics to storage folks :
a)Need equally sized / performance LUNs
b) Minimum of 4 LUNs
c) The capacity requirement
d) The workload characteristic (random r/w, sequential r/w) & any response time SLA
Question 44 Can my RDBMS and ASM instances run different versions?
Answer Yes. ASM can be at a higher version or at lower version than its client databases. There’s two components of compatibility:
a) Software compatibility
b) Diskgroup compatibility attributes:
This is a diskgroup level change and not an instance level change…no rolling upgrade here!
Question 45 How do I backup my ASM instance?
Answer There is no backup for ASM instance as ASM has no files to backup Unlike the database, ASM does require a controlfile type structure or any other external metadata to bootstrap itself. All the data ASM needs to startup is on on-disk structures (disk headers and other disk group metadata).
Question 46 How does ASM work with multipathing software?
Answer Multipathing software is at a layer lower than ASM, and thus is transparent.
You may need to adjust ASM_DISKSTRING to specify only the path to the multipathing pseudo devices.
Multipathing tools provides the following benefits:
a) It provide a single block device interface for a multi-pathed LUN
b) it detects any component failures in the I/O path; e.g., fabric port, channel adapter, or HBA.
c) When a loss of path occurs, ensure that I/Os are re-routed to the available paths, with no process disruption.
d) Reconfigure the multipaths automatically when events occur.
e) Ensure that failed paths get revalidated as soon as possible and provide autofailback