Oracle ASM is widely used in the IT industry. Here I have compiled the Top 46 Oracle ASM Interview Questions to enhance my knowledge about Oracle ASM instances. This is good for basic and experienced levels. we have provided the advanced level also in it
Basic Level Oracle ASM Interview Questions
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 the 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 extension 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. Learn more on the below link
Oracle Automatic Storage Management
What is the ASM instance in Oracle?
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
- The ASM instance, which is generally named +ASM1, is started with the INSTANCE_TYPE=ASM init.ora parameter
- Do not mount the database but manage metadata required to make ASM files available for DB instances
- DB Instance access ASM files directly and contact ASM instance only for the layout of ASM files
- Requires only the init.ora file for startup
- Instance Name is +ASM or +ASM1.for RAC
- ASM instance can be started in the same database home or separate home also
What are ASM Background Processes in Oracle?
What are ASM instance initialization parameters?
How does the Oracle ASM instance work?
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 resources. 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 that 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 a 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.
What are ASM Disks?
The physical disks are known as ASM disks. Learn more about that at the below link
Oracle ASM disks
What are ASM diskgroups?
ASM disk groups, each of which comprises of several physical disks that are controlled as a single unit.Learn more about that at the below link
Oracle ASM Diskgroups
What are Failure groups
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.
ASM Failure Groups
Why should we use a separate ASM home?
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.
How many ASM instances should one have?
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).
How many diskgroups should one have?
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 of 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 disk).
What is stripping and mirroring?
Striping is spreading data across multiple disks so that IO is spread across multiple disks and hence increases the throughput. It provides read/write performance but failover support.
ASM offers two types of striping, with the choice depending on the type of database file.
(1)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.
(2)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 benefits for reading operations but overhead for writing operations. Its 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 a “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 been 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
What is ASM Rebalancing?
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;
What happens when an Oracle ASM disk group is created?
When an ASM disk group is created, a hierarchical filesystem structure is created.
How does this filesystem structure appear?
Oracle ASM disk group’s filesystem structure is similar to UNIX filesystem hierarchy or Windows filesystem hierarchy.
Where are the Oracle ASM files stored?
Oracle ASM files are stored within the Oracle ASM disk group. If we dig into the internals, oracle ASM files are stored within the Oracle ASM filesystem structures.
How are the Oracle ASM files stored within the Oracle ASM filesystem structure?
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.
What are the Oracle ASM files that are stored within the Oracle ASM file hierarchy?
Files stored in Oracle ASM diskgroup/Oracle ASM file structures include:
(2) Control files
(3) Server Parameter Files(SPFILE)
(4) Redo Log files
How can you access a database file in the ASM diskgroup under RDBMS?
Once the ASM file is created in the ASM diskgroup, a filename is generated. This file is now visible to the user via the standard RDBMS view V$DATAFILE.
What will be the syntax of ASM filenames?
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, group number for redo log files
file_number – file_number in ASM instance is used to correlate filenames in the database instance
incarnation_number – It is derived from the timestamp. IT is used to provide uniqueness
Experienced level Oracle ASM Interview Questions
What is an incarnation number?
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.
What is the use of an incarnation number in the Oracle ASM filename?
Incarnation number distinguishes between a new file that has been created using the same file number and another file that has been deleted
What is an oracle flex ASM?
Oracle Flex ASM is a feature that enables an ASM instance to run on separate physical servers from the database servers
What is the use of asmadmin?
asmadmin 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
What is the purpose of the asmoper operating system group?
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
What is the difference between asmdba and asmoper?
The users belonging to the asmdba group have sysdba database privilege at the ASM level. This is the highest administrative privilege needed for Oracle ASM. Whereas, asmoper is given sysoper privilege which is less than asmdba
How to copy files between ASM disk groups?
ASMCMD command cp can be used to copy files between ASM disk groups on the local instance as well as remote instances
What is ASM metadata and where is it present?
ASM metadata is the information that ASM uses to control the disk group. It is present within a disk group.
What is ASM metadata composed of?
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
What is the oracle ASM filter driver?
- Oracle ASM filter driver is a new feature in Oracle Database 12c Release 2 18.104.22.168. As an abbreviation, this is called Oracle ASMFD which happens to be a kernel module.
- This kernel module is included in the path of the 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
What is the ASM POWER_LIMIT?
This is the parameter that controls the number of Allocation units the ASM instance will try to rebalance at any given time. In ASM versions less than 22.214.171.124 the default value is 11 however it has been changed to unlimited in later versions.
What is a rolling upgrade?
A patch is considered rolling if it is can be applied to the cluster binaries without having to shut 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 instances open.
How does ASM provide Redundancy?
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 mechanisms like RAID, Storage arrays.
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 the full backup on the new Diskgroup.
Does the 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 the existing Diskgroup.
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.
What is the SYSASM role?
Starting from Oracle 11g, the SYSASM role can be used to administer the ASM instances. You can continue using the SYSDBA role to connect to ASM but it will generate the following warning messages at the time of startup/shutdown, create Diskgroup/add a disk, etc
WARNING: Deprecated privilege SYSDBA for command ‘STARTUP’
What is Kfed?
Answer kfed is a utility that can be used to view the ASM Disk information. The syntax for using it is
kfed read device name
ASM and Cluster Synchronization Service
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:
What processes does the rebalancing?
How to find out the databases, which are using the ASM instance?
SQL> select DB_NAME from V$ASM_CLIENT;
What are the different types of striping in ASM & their differences?
What is the best LUN size for ASM?
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
Can my RDBMS and ASM instances run different versions?
Yes. ASM can be at a higher version or at a lower version than its client databases. There are 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!
How do I back up my ASM instance?
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).
How does ASM work with multipathing software?
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 provide the following benefits:
(a) It provides 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 multipath automatically when events occur.
(e) Ensure that failed paths get revalidated as soon as possible and provide auto failback
What are the 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 straightforward – 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
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.
I hope you find Oracle ASM Interview Questions helpful and useful. Please do provide the feedback
Unix shell scripting interview questions: compilation of Unix shell scripting interview questions for success in any interviews. Examples are given for the command also
Oracle interview questions: 49 Oracle Interview questions and answers: Basics, Oracle SQL to help you in interviews
Oracle PLSQL interview questions: 25 Oracle PLSQL interview questions with detailed explanations and answers for the success in an interview
Weblogic Interview questions: Weblogic Interview questions to help you |How to access the admin console|States of the Weblogic Server|multicast and unicast
oracle apps dba interview questions: 60 awesome oracle apps dba interview questions.Must read to succeed in interviews and jobs
oracle apps technical interview questions and answers: 19 oracle apps technical interview questions and answers to succeed in your career
how to check oracle version: check out how to find the version of oracle database. what is the latest Oracle Version, what is innovation and long-term release
The following are some of the recommended courses you can buy if you want to get a step further
Given below are the links to some of the courses
Oracle DBA 11g/12c – Database Administration for Junior DBA : This course is good for the people who are starting as Junior DBA or aspire to be Oracle DBA. This will provide a good understanding of backup & recovery and General administration tasks
Oracle Database: Oracle 12C R2 RAC Administration : This course covers the installation, administration of Oracle RAC. A good course for Oracle DBA who want to upgrade his skills for Oracle RAC
Oracle Data Guard: Database Administration for Oracle 12C R2 : This course covers the installation, administration of Oracle Dataguard. A good course for Oracle DBA who want to upgrade his skills for Oracle Dataguard
Abdul Taher says
Answer to Q45:-
“Unlike the database, ASM does require a controlfile type structure”, missing the word “not”.