Oracle ASM Interview Questions and Answers
Oracle ASM Interview Questions and Answers
a. Oracle ASM
b. OCFS – Windows
c. OCFS2 (Oracle Cluster File System) – Linux
d. NFS
We may optionally use third-party cluster file system or cluster-aware volume manager that is certified
for Oracle RAC. Oracle highly recommends using ASM as the storage solution for RAC.
Oracle Managed Files (OMF) simplifies the creation of databases as Oracle does all OS operations and file
naming. It has several advantages.
4. What is ASM?
Automatic Storage Management (ASM) is a new feature that has be introduced in Oracle 10g to simplify
the storage of Oracle datafiles, control files and log files. 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.
Oracle Automatic Storage Management (ASM) integrates with Oracle Managed Files (OMF) by integrating
the OMF hierarchical structure and removing the need for file manageability.
If we have named datafiles, controlfiles, and redolog files manually, then OMF is not enabled.
For best practices using ASM, every database should implement the Oracle Managed File (OMF) feature.
OMF can be enabled by setting the DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST parameters.
OMF will allow simpler file naming and also provides better file handling. For example, if a tablespace is
dropped, ASM will delete the file automatically only if it is an OMF datafile. If OMF is not used, then the
DBA must drop the file manually by connecting to the ASM instance.
Yes
7. What are the reasons ASM is better than file system for an Oracle database?
ASM disks are block devices that are accessed using direct I/O. This bypasses a lot of moving parts
that you will typically find in a cooked file system. Raw/direct disk I/O is faster than doing I/O via
a kernel file system driver.
Oracle Automatic Storage Management (ASM) uses striping and mirroring to balance I/O load across
disks in a disk group:
Stripping
Writes data in a round-robin fashion across disks to balance I/O load. This minimizes I/O latency for small
I/O operations.
Mirroring
Mirrors data based on file extents to ensure that file extents are equally distributed across disks.
Oracle Automatic Storage Management (ASM) mirroring is the process of keeping redundant copies of
data on multiple disks to prevent data loss in case of disk failure:
How it works
ASM mirroring is done at the extent level, typically 1 MB, and can be configured for two or three-way
mirroring.
Mirroring protects data integrity by ensuring that there is always a copy of the data on a different disk in
case one of the disks fails.
When ASM allocates an extent for a Normal Redundancy Diskgroup, it creates a primary copy and a
secondary copy. The secondary copy is placed on a disk in a different Failure Group than the primary
copy.
Striping is mainly performed to balance the load across the disks and to reduce the I/O latency.
Coarse Grained – Stripe size is same as of AU size of diskgroup. Datafiles, redologs and
temp files are coarse grained.
Fine Grained – The stripe size is 128KB and is useful for files of small size. Control file is
fine grained.
An ASM instance is a component of Oracle's Automatic Storage Management (ASM) feature that
manages disk groups and metadata for Oracle ASM files. ASM instances are built on the same technology
as Oracle Database instances and have similar System Global Area (SGA) and background processes.
The following tasks are done by ASM instance:
1. Manages metadata.
2. Allocates space.
3. Provides file layout information.
4. Controls disk groups.
Multiple ASM instances can be configured in a same server. However, normal configuration keeps only
one to one relationship with an ASM instance and RDBMS instance.
ASM instance are started and stopped in a similar way to normal database instances. The options for
the STARTUP command are:
NORMAL - The ASM instance waits for all connected ASM instances and SQL sessions to exit
then shuts down.
IMMEDIATE - The ASM instance waits for any SQL transactions to complete then shuts down. It
doesn't wait for sessions to exit.
TRANSACTIONAL - Same as IMMEDIATE.
ABORT - The ASM instance shuts down instantly.
The Storage administrator will identify a set of disks and create the appropriate LUNs from the storage
array and finally present them to the host. The ASM disk could be any of these
1. Raw disk partition - A disk partition can be the entire disk drive or a section of a disk drive.
2. Logical Unit Numbers (LUN) - A LUN is a disk presented to a computer system by a storage
array. Oracle recommends that you use hardware RAID functionality to create LUNs. Storage
hardware RAID 0+1 or RAID5, and other RAID configurations, can be provided to Oracle ASM as
Oracle ASM disks.
3. Raw logical volume (LVM) - A logical volume is supported in less complicated configurations
where a logical volume is mapped to a LUN, or a logical volume uses disks or raw partitions.
Logical volume configurations are not recommended by Oracle because they create a duplication
of functionality.
Disk discovery is the mechanism used to find the operating system names for disks Oracle ASM can
access.
This mechanism finds all the disks that comprise a disk group to be mounted, the disks an administrator
wants to add to a disk group, or the disks the administrator might consider adding to a disk group.
When an Oracle ASM instance is initialized, Oracle ASM discovers and examines the contents of
all of the disks that are in the paths that you designated with values in
the ASM_DISKSTRING initialization parameter.
After Oracle ASM successfully discovers a disk, the disk appears in the V$ASM_DISK view with the
respective status of the disk header like MEMBER, CANDIDATE, PROVISIONED, FORMER.
a. External redundancy – Oracle ASM doesn’t provide mirroring redundancy and relies on the
storage system to provide RAID functionality.
b. Normal redundancy – Oracle ASM provides two-way mirroring by default, which means that all
files are mirrored so that there are two copies of every extent. A loss of one oracle ASM disk is
tolerated.
c. High redundancy – Oracle ASM provides three-way mirroring by default. A loss of two oracle
ASM disks in different failure group is tolerated.
CANDIDATE – Disk is available and can be added to diskgroup. (Usually in Solaris sparc, hpux)
PROVISIONED – Same as candidate disk, but disk was provisioned using ASMLib. (Usually in Linux,)
FORMER – Mean disk was formerly part of a diskgroup, but currently not part of any diskgroup.
Failure groups are used to store mirror copies of data. 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 so that it is in a different failure group than the primary copy. Each copy is on
a disk in a different failure group so that the simultaneous failure of all disks in a failure group does not
result in data loss.
There are always failure groups even if they are not explicitly created. If you do not specify a failure group
for a disk, then Oracle automatically creates a new failure group containing just that disk.
Though we can keep different sized disks in a diskgroup, the extent distribution will be unbalanced. And
it will induce unbalanced I/O across the diskgroup.
Minimum only one diskgroup is needed for all database files. However, best practice is to keep another
diskgroup for recovery files.
Example: Keep +DATA diskgroup for database files and +FRA for recovery files.
24. Can we change the diskgroup redundancy after creating the diskgroups?
No, once a diskgroup is created, its redundancy cannot be changed. The only way to change the
redundancy is to create a new diskgroup with required redundancy and move the datafiles on it using
RMAN restore or DBMS_FILE_TRANSFER.
But despite the read/write errors, the header_status column value may still be shown as "MEMBER".
Disk scrubbing checks logical data corruptions and repairs them automatically in normal and high
redundancy disks groups. The scrubbing process repairs logical corruptions using the mirror disks. Disk
scrubbing can be combined with disk group rebalance to reduce I/O resources.” This feature is available
in ASM version 12c.
SQL> ALTER DISKGROUP data SCRUB DISK DATA_0005 REPAIR POWER HIGH FORCE;
The optional REPAIR option automatically repairs disk corruptions. If the REPAIR option is not specified,
then the SCRUB option only checks and reports logical corruptions of the specified target.
The optional POWER value can be set to AUTO, LOW, HIGH, or MAX. If the POWER option is not
specified, the power value defaults to AUTO and the power adjusts to the optimum level for the system.
If the optional WAIT option is specified, the command returns after the scrubbing operation has
completed. If the WAIT option is not specified, the scrubbing operation is added into the scrubbing queue
and the command returns immediately.
If the optional FORCE option is specified, the command is processed even if the system I/O load is high
or scrubbing has been disabled internally at the system level.
The scrubbing process is visible in the fields of the V$ASM_OPERATION view while the scrubbing process
is running.
Oracle ASM Dynamic Volume Manager provides volume management services and a standard disk
device driver interface to clients.
You can store additional files except from database files on the ASM Disks such as binary files, trace
files, log files etc.
To create a volume: ALTER DISKGROUP data ADD VOLUME volume1 SIZE 5G;
Let’s explain the answer with an example for the easy understanding.
Consider Normal Redundancy diskgroup DATA1 with 2 failgroups called MIRROR1 and MIRROR2. Each
failgroup has 3 x disks (let's say 512GB).
Now assume that Disk2 in Failgroup1 fails.
Disk 2 in failgroup MIRROR1 fails. The MIRROR1 failgroup is not available as a result. DB operations
continue unaware of the problem as MIRROR2 is online and working fine.
The dba cannot fix disk 2 within the meantime for repair period of ASM. ASM forces disk 2 out the
MIRROR1 failgroup by force dropping it. MIRROR1 has now 2 disk remaining.
ASM starts a rebalance process to stripe the contents of the MIRROR1 failgroup across 2 disks - as oppose
to 3 disks. If the space in use fits on 2 disks the rebalance operation will succeed. MIRROR1 will become
online and available. But it will only be able to carry 1TB of data, as oppose to MIRROR2 with it 3 disks
and 1.5TB capacity.
If the space used cannot be striped across the remaining disks in MIRROR1, the rebalance will fail due to
insufficient capacity and the failgroup will remain offline.
In either scenario, the recommended action is to add a new 512GB disk to MIRROR1, reverting it back to
a 3 disk failgroup, and then rebalance the failgroup.
30. What are the steps to copy datafiles from one diskgroup to another diskgroup using RMAN?
Below steps shows the datafile movement from +DATA diskgroup to +NEWDATA
d. Switch the datafile to the new copy. Following command will point the controlfile to the
newly created copy of the datafile.
a. create diskgroup
c. Alter a diskgroup
ALTER DISKGROUP data ADD DISK '/dev/oracleasm/disks/DISK6'; - adding a new disk to diskgroup
ALTER DISKGROUP data DROP DISK DATA_5; - dropping a disk from the diskgroup
ALTER DISKGROUP DATA REBALANCE POWER 8; - Manual rebalance of the data in the diskgroup.
ALTER DISKGROUP data MOUNT; - Mount a specific diskgroup
ALTER DISKGROUP data DISMOUNT; - Unmount a specific diskgroup
ALTER DISKGROUP ALL MOUNT; - Mount all diskgroups
ALTER DISKGROUP ALL DISMOUNT; -Unmount all diskgroups
ALTER DISKGROUP data CHECK ALL; - Verify the internal consistency of disk group metadata
ALTER DISKGROUP data RESIZE DISKS IN FAILGROUP failure_group_1 SIZE 1024G; - Resize all disks
in a failure group.
ALTER DISKGROUP data RESIZE DISK DATA_0006 SIZE 100G; - Resize a specific diskgroup
ALTER DISKGROUP data RESIZE ALL SIZE 100G; - Resize all disks in a diskgroup.
32. Suppose we need 5 disks of 1 TB each to an existing diskgroup. Should I add them one by one or
add all the 5 disk at a time? Which method will create less overhead?
I t is a best practice to add and drop multiple disks at a time so that ASM can reorganize partnership
35. How to decide the right Allocation Unit for ASM diskgroup?
AU size of between 1 MB and 4 MB for mostly OLTP workloads, and an 8 MB or larger AU size for OLAP
workloads.
For very large databases, a 16 MB or larger AU size should be considered for diskgroups where most of
the data will be stored.
ASM Extent consists of one or more AU. The initial extent size is the same as the disk group allocation
unit (AU) size. After that, the extent size increases by a factor of 4 or 16 at certain thresholds.
It is important to remember that when using ASM mirroring, ASM mirrors by ASM extent, not disk or
diskgroup.
Extent size always equals the disk group AU size for the first 20000 extent sets (0 - 19999).
Extent size equals 4*AU size for the next 20000 extent sets (20000 - 39999).
Extent size equals 16*AU size for the next 20000 and higher extent sets (40000+).
For each extent there’s an extent map present in the shared pool. If a large database uses the default
extent size, which is equal to AU_SIZE, then sga memory requirement for ASM instance will be very high
and it needs to store a lot extent maps in memory. With variable extent size feature, database needs fewer
extents to describe an ASM file, and less memory to manage the extent maps in the shared pool.
38. What is a quorum failure group?
A quorum failure group is a special type of failure group that is used to store the Oracle Clusterware
voting files. The quorum failure group is used to ensure that a quorum of the specified failure groups is
available. When Oracle ASM mounts a disk group that contains Oracle Clusterware files, the quorum
failure group is used to determine if the disk group can be mounted in the event of the loss of one or
more failure groups. Disks in the quorum failure group do not contain user data, therefore a quorum
failure group is not considered when determining redundancy requirements in respect to storing user
data.
Diskgroup dynamic rebalancing is a feature in Oracle ASM that automatically redistributes data across
disks in a disk group. This is done in the background, with minimal impact on the database performance.
Consider that a new disk has been added to an ASM diskgroup. Rebalance operation will occur as in
sequence below.
a. RBAL process will create a rebalance plan and begin coordination of the redistribution.
b. RBAL calculates the estimated time and work required to perform the rebalance and inform ARBx
process to handle the request. ASM_POWER_LIMIT parameter decides how many ARBx processes
to be spawned.
c. Continues Operations Directory (COD) is updated with the details of the ongoing rebalance. This
is needed when rebalance gets failed in the middle, then other instance can take over and decide
either to complete or rollback the rebalance operation.
d. RBAL distributes the plans for each files to the ARBs and it perform rebalance on the respective
extents by locking, relocating and unlocking.
Usually, when we add or drop disks to a diskgroup, rebalance is initiated and communication started
between all the active ASM instances. And if rebalance operation is big one, then these messaging
between the asm instances can cause a delay.
So in a situation, where user don’t need to access the diskgroup, then we can use this fast rebalance
feature. Means rebalance will be performed by only one asm instance.
Note – The asm diskgroup will be accessible to oracle database during this phase.
Steps for fast rebalance in 2 node RAC:
1. Dismount the diskgroup from all the asm nodes.
2. Mount the diskgroup only one node asm instance with restrict( ALTER DISKGROUP DATA
MOUNT restrict)
3. Do storage activities like add/drop disk ( this will start the rebalance)
4. Once rebalance is completed. Dismount the diskgroup from that one node. And MOUNT the
diskgroup on all nodes of cluster.
Yes, we can increase the power limit of existing rebalance operation. As soon as a request is placed,
additional ARB processes will be spawned and completes the rebalance operation.
What if we reduce the number of processes? Yes, that’s also possible. Only needed processes will keep
running and other ARB processes will be closed after completing their task.
43. What is this compact phase in asm rebalance? Is it really necessary and can we disable it?
In compact phase, the data is moved to outer layer of the asm disks. Because outer region or the hot
track has good bandwidth and greater speed.
Compact phase may take some time during the rebalance operation. So if we are using flash disks,
then there is no need of compacting. So we can chose the disable it depending on which oracle
version you were.
Oracle 12c onward :( we can alter at diskgroup level)
ALTER DISKGROUP <dg> SET ATTRIBUTE ‘_rebalance_compact’=’FALSE’;
To clarify more, all disks are of same size but it is found that disks are not balanced.
This could be due to following reasons.
Either ASM disk was added with rebalance power of zero.
Previous rebalance operation was aborted due to some error and is not completed afterwards.
In Oracle Automatic Storage Management (ASM), COD stands for Continuing Operation Directory. It's
similar to an undo tablespace and is responsible for maintaining the state of active ASM operations.
1. Background operation
By default, when a disk in an ASM disk group fails the disk will be taken offline automatically. The disk
will be dropped some 3.6 hours later. As a result, you have only 3.6 hours by default to respond to a disk
outage. If you correct the problem and the physical disk media is not corrupted, then ASM fast disk resync
will quickly re-synchronize the disk when it comes back online, correcting the problem very quickly.
ASM_POWER_LIMIT parameter controls the throughput and speed of the rebalance operation.
In 12c the values varies from 1-1024. Value of 0 will disable the automatic rebalance operation.
If asm_power_limit is 10, then 10 ARBn processes will be created to do the rebalance job. But please note,
higher value of asm_power_limit can cause more CPU load. So always use a balanced value and try to do
these in non-peak hours.
ASM stores metadata to describe and track diskgroup contents. All of the metadata that describe the
composition and contents of an ASM diskgroup are stored within the diskgroup itself, which makes each
diskgroup self-describing.
1. Physical Metadata (They’re stored in fixed locations of disk, needed for ASM bootstrapping)
Disk Header
Allocation Table (AT) – (Each disk has an AT to track free and allocated space)
Free Space Table (FST) – ( Tracks free AU in Allocation Table Block)
Partnership Status Table (PST) -
2. Virtual Metadata
File Directory
Disk Directory
Active Change Directory – Same as redolog in database. When ASM needs to
change multiple metadata blocks, a log record is written into ACD.
Continuing Operations Directory (COD)
Attribute Directory
Staleness Directory – Contains metadata to map the slots in staleness registry to
disk.
Staleness Registry – Tracks AU that become stale when the disk is offline.
ASM diskgroup metadata backup is performed using md_backup command. If no diskgroup specified
ASM md_backup backs up all the mounted diskgroup metadata.
Backup
Restore
Note: - md_backup does not take the backup of data and therefore md_restore does not restore the data.
It just takes the diskgroup metadata backup so incase if you lose your diskgroup you can rebuild its
structure from scratch. Once you have built the diskgroup you can restore the data in diskgroup using
RMAN/Import etc. depending the backup solution you use to backup your database.
Templates are collections of file attribute values, used to set mirroring and striping attributes of each type
of database file (datafile, control file, redo log file, and so on) created in ASM disk groups.
Relocation is the act of moving extents from one disk to another disk in a diskgroup, which mostly
happens during rebalance operation. Relocation happens per extent basis.
File close
For a given extent, if the file is closed, then ASM can relocate the extents without sending any message
to other ASM or RDBMS instance.
File open
But for a given extent, if the file is open, then the asm instance, which is handling this relocation,
will first send a message to all the asm instances that it is planning to relocate the extent. The asm
instances will again send messages to rdbms instance using umbilicius.
Now rdbms will delay the write to this extent until relocation is completed. (Though chances are
small that, the rdbms is writing to the extent, which is getting relocated at the same time).
Now asm will do the actual relocation. And at this time, if any rdbms instance wants to read that
extent, they can read from the old location also. But if write request comes, then they need to wait
till relocation is completed.
Once relocation is done, asm will release the old AU extents to free pool.
ASM crash recovery is similar to that of database instance crash recovery. Two virtual metadata directories
are responsible for crash recovery.
When we asm crash recovery Means it is asm diskgroup recovery. During recovery
First the surviving instance applies the ACD record associated with crashed instance. Applying
ACD records ensure that the asm cache is in consistent mode.
After ACD recovery is completed, COD recovery happens if any long running operation like file
creation or disk addition was going on during instance crash.
kfed
A utility that can read, repair, and examine ASM disk headers and metadata. It can be used to diagnose
issues when ASM disk groups can't be mounted. KFED can be found in $GRID_HOME/bin/kfed.
A utility that can be used to perform disk discovery during installation. It can also be used to check the
redundancy of ASM disk groups.
Flex ASM is a feature introduced in Oracle 12c onwards to remove the dependency of one to one
relationship with RDBMS and ASM instance on the same node.
In detail, prior to 12c, it was mandate that one both RDBMS and ASM instance should run on the same
node and if the ASM instance goes down, database will also be down. When it comes to 12c and flex
ASM is introduced, even if the ASM instance on a node is down, RDBMS instance will switch it’s connection
to the ASM instance running on the another node of the cluster without any interruptions.
The following image also illustrates that it is not mandate to run both ASM and RDBMS instances on the
same node.
asmcmd showclustermode
(Or)
crsctl get cluster mode status
Query to check the status of ASM running on each nodes and how many clients are connected.
When multiple databases share the same diskgroup, there may be chances that not all attributes applies
to all databases. For example, 1 PROD, 1 TEST, 1 DEV databases might be using the diskgroup and
rebalance power_limit for prod will be high and it can be low for TEST and DEV. Setting different values
are not possible normally. Hence Oracle has introduced the concept Flex diskgroup wherein file groups
and quota groups are created. The following images shows the difference.
A flex disk group requires a minimum of three failure groups and the redundancy setting of a flex disk
group is set to FLEX REDUNDANCY. The flex disk group can tolerate two failures which is the same as a
HIGH redundancy disk group.
File group
An Oracle ASM file group is a group of files that share the same set of properties and characteristics.
Quota group
A quota group defines the quota allocated to a group of Oracle ASM File Groups. A file group belongs to
only one quota group.
An Oracle ASM extended disk group has all the features of a flex disk group, with a specific design to be
highly available in an extended (stretch) cluster environment, which contains nodes that span multiple
physically separated sites.
57. What are the steps to create ASM flex diskgroup and add a database to it?
SQL > ALTER DISKGROUP DiskGroup_1 ADD FILEGROUP FileGroup_PDB1 DATABASE PDB1 SET
'quota_group' = 'QuotaGroup_QGRP1';
58. What are the best practices to consider when using ASM disks?
In most cases you will only need two disk groups (DATA and FRA), where DATA holds all database
related files and FRA holds the fast recovery area, including multiplexed copies on online redo
logs and control files. Typically, the FRA disk group will be twice the size of the DATA disk group,
since it must hold all backups.
Oracle recommend a minimum of 4 LUNs per disk group, with LUNs using hardware RAID and
external redundancy if possible.
All LUNs within a disk group should be the same size and have the same performance
characteristics.
LUNs should be made up from disks dedicated to Oracle, not shared with other applications.
When an ASM instance is started, it registers with CSS (Cluster Synchronization Daemon) running as
cssd.bin. This is part of Oracle Clusterware, but the occsd.bin runs in a single instance configuration as
well.
RDBMS contacts CSS and get passed the connect string for the ASM instance. RDBMS’s ASMB then
connects as SYSDBA to the ASM instance using OS authentication.
60. Where do I run my database listener from; i.e., ASM HOME or DB HOME?
It is recommended to run the listener from the ASM HOME. This is particularly important for RAC env,
since the listener is a node-level resource. In this config, you can create additional [user] listeners from
the database homes as needed.
61. How a datafile read requests are sent to ASM by RDBMS instance?
RDBMS maintains a series of connections to ASM instance via ONN background process (ONN process
opens a connection between the database instance and the ASM for metadata operations).
a. RDBMS sends a request to open a file via ONN background process to the ASM instance.
b. ASM instance then sends an extent map to the RDBMS instance.
c. RDBMS instance use the extent map to perform I/O direct to the file.
Note: Always keep in mind that I/O requests from RDBMS do not go via ASM instance, but straight to the
devices using the extent map. ASM instance only looks after the metadata that describes disk groups and
extent allocations.
62. How a file creation requests are sent to ASM by RDBMS instance?
1. RDBMS sends a request to the ASM instance to create a file via ONN background process. This
request contains the information on the size of the file to create, the type and the disk group name
where to create the file in.
2. The ASM instance then uses this information to allocate the appropriate number of extents on the
correct disks.
3. After allocating the extents for the file ASM sends the extent map information back to the RDBMS
instance and creates an entry in its Continuing Operations Directory (COD) metadata file.
4. Once the RDBMS has the extent map it can issue the I/O to initialize the file.
5. After this I/O has completed, the RDBMS instance messages the ASM instance that the creation of
the file has completed successfully. The ASM instance then updates its metadata files to reflect the
change.
6. Should the RDBMS decide to abort the file creation, then ASM can use the COD to roll back the
creation of the file, which includes freeing the space that was allocated for the new file.
63. How can we improve the I/O performance between the ASM instance and RDBMS instance?
As database perform I/O directly with the ASM disks, it doesn’t go through the ASM instance. In fact, in
terms of input and output operation, no relationship is there between RDBMS and ASM instances.
Yes. ASM can be at a higher version or at lower version than its client databases.
RBAL – This opens all the devices upon discovery and coordinate the rebalance operation.
ARBn – These are the slave processes that do the rebalance operation
DBWR – Writes ASM instance metadata changes in sga buffer to DISK.
LGWR – It manages the active change directory and flushes the ACD change records to disk.
PMON – This manages process and process death.
MARK – Mark allocation Unit, process coordinates the updates to the staleness registry
SMON – System Monitor process
When an Oracle ASM instance searches for an initialization parameter file, the search order is:
1. The location of the initialization parameter file specified in the Grid Plug and Play (GPnP)
profile
2. If the location has not been set in the GPnP profile, then the search order changes to:
SPFILE OR PFILE in the Oracle ASM instance home. For example, the SPFILE for Oracle
ASM has the following default path in the Oracle Grid Infrastructure home in a Linux
environment:$GRID_HOME/dbs/spfile+ASM.ora
ASMLib, short for "Automatic Storage Management Library," is a support library provided by Oracle for
managing Oracle ASM (Automatic Storage Management) on Linux systems. It simplifies the
administration and management of Oracle ASM disk groups and volumes by providing a set of utilities
and kernel modules.
ASMLib is typically used in Oracle Database environments to interact with ASM disks and is specifically
designed to work with Oracle ASM. All ASMLib installations require the oracleasmlib and oracleasm-
support packages appropriate for their machine.
69. What are the steps to configure ASMLib and creation of disks?
1. Creation of user and group for ASM.
2. Add raw disks to the server (It should be shared between all nodes in the cluster in case of RAC). OS
administrator must perform step1 and step2.
3. List the disks
fdisk -l
(or)
lsblk
Sample output:
4. Create partitions for the disks.
fdisk /dev/sdb
lsblk – to see the disks after creating partitions
5. Install ASMLib packages
yum install -y oracleasm
yum install -y oracleasm-support
yum install oracleasmlib
6. Configure Oracle ASMLib
/usr/sbin/oracleasm configure -i
/usr/sbin/oracleasm init
/usr/sbin/oracleasm status
7. Now create ASM disks
/usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
/usr/sbin/oracleasm scandisks
/usr/sbin/oracleasm listdisks
8. List oracleasm disks
ls -ltra /dev/oracleasm/disks/*
70. What is the security compromise of using ASMLib and its solution?
The ASM disks were owned by GI homeowner and both the owner and any users belonging to an
operating system group designated as the OSASM group could read from and write to ASM disks
using OS commands like strings, echo, dd etc. This led to compromising the security of data as well
as accidental corruption of the data in the ASM disks and ASM disks themselves.
As a solution, Oracle has introduced ASMFD (ASM Filter Driver) from 12.1.0.2 version onwards.
71. What is Oracle ASMFD (ASM Filter Driver)?
Oracle ASMFD is a kernel module that resides in the I/O path of the Oracle ASM disks. ASMFD uses
the filter driver to validate write I/O requests to Oracle ASM disks. Any write I/O requests that are not
issued by Oracle software (e.g. using dd command) are not committed to ASM disks. Thus, it helps to
prevent users, including those with administrative privileges, from inadvertently overwriting Oracle
ASM disks, thereby preventing corruption of the data stored on ASM disk(s) within the disk group(s).
72. What are the steps to configure ASMFD?
1. Verify if ASMFD is configured.
asmcmd afd_lsdsk – It shows an error Failed to load AFD library if AFD is not installed.
asmcmd afd_state - The AFD state is 'NOT INSTALLED' and filtering is 'DEFAULT' on host
SELECT SYS_CONTEXT('SYS_ASMFD_PROPERTIES', 'AFD_STATE') FROM DUAL;
2. asmcmd afd_configure
3. asmcmd afd_state
Output: The AFD state is 'LOADED' and filtering is 'DEFAULT' on host 'host01.example.com'.
73. What are the high-level steps to migrate the diskgroups from ASMLib to ASMFD?
1. Check the list of available disks (oracleasm)
oracleasm listdisks
2. Locate the physical path of disks configured in oracleasm.
3. Check which disks are not part of any of the diskgroups.
4. Consider we have two diskgroups, DATA and TEST. Let’s check out which disks are part of this
diskgroup.
asmcmd dsget
5. Check the configuration of ASM
6. Update the ASM Disk discovery path to enable ASMFD lookup
7. Bring down the clusterware stack
8. Configure ASMFD
a. asmcmd afd_configure
b. asmcmd afd_state
c. vi /etc/oracleafd.conf (mention the diskstring parameter like
afd_diskstring='/dev/xvd*1' )
d. asmcmd afd_filter -e (to enable the filter)
9. Migrate all the ASMLib disks.
$ORACLE_HOME/bin/asmcmd afd_lsdsk
ls -ltr /dev/oracleafd/disks/
74. What are the high-level steps to migrate a database from filesystem to ASM?
rman target /
rman target/
rman target/
RMAN>run
{
set newname for tempfile '/u01/app/oracle/oradata/ORCL/temp01.dbf' to '+DATA';
switch tempfile all;
}
75. What are the high-level steps to upgrade grid from 12c to 19c?