1. Explain ASM architecture?

 

2. Explain the advantages of using ASM.

  • It spreads i/o across the disk uniformly.
  • Performs automatic rebalance upon disk addition and deletion
  • Capable of leveraging multipath layer.
  • Mirroring and striping capability.
  • tightly coupled with OMF
  • Reduces administration complexity.
  • Overcomes filesize limitation

3. How asm mirroring works?

 

4. Explain different RAID levels.

RAID 0 – provides striping capability.

RAID 1 – Provides mirroring capability.

RAID 0+1 – First striping, then mirrored

RAID 1+0 – First mirroring then striping – Mostly used for oracle database

RAID 5  – With additional parity

RAID 6 – With additional parity

 

5. How ASM interacts with database?

First time, when rdbms instance tries to access an asm file, It needs to establish a local asm connection.

ASMB process contacts CSS using diskgroup names and gets the connection string. Using that connection string, bequeath connection is established between asm and RDBMS instance.

The RDBMS authenticates itself to the ASM instance via operating system (OS) authentication by connecting as SYSDBA. This initial connection between the ASM instance and the RDBMS instance is known as the umbilicus, and remains active as long as the RDBMS instance has any ASM files open.

ASMB is the rdbms side process and UFG(umbilicus foreground process) is the asm side process. Both communciate through this umbilicus.

When ASM instance opens a datafile, ASM ships the  file’s extent map to rdbms instance , where it is stored in SGA.

By using that extent map , rdbms can do i/o on the asm files directly without going through asm instance

6. Can i keep disks of different sizes in a diskgroup?

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.

Oracle always recommends to use disks of same size in a diskgroup.

7. ASM power limit?

ASM_POWER_LIMIT parameter controlled 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.

8. What are some important ASM background processes?

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

GMON – This manages disk level activities like disk drop/add/offline/online.

MARK – > Mark allocation Unit, process coordinates the updates to the staleness registry

SMON – >

PING – > Monitors network latency

9. What are the parameters of asm instance?

asm_diskstrings:

asm_powerlimit

instance_name

large_pool_size

processes

 

10. There is a control_file parameter for asm instance. If i delete that what will happen?

In some version of asm , there will a control_file for asm_instance. It is a dummy control_file, which is of no use. It is meaningless.

However in latest version (19c) , This parameter is not available.

11. How can i improve the i/o performance between database instance and asm instance?

asm instance is not in the i/o path . Database perform i/o directly with asm disks, It doesnt go through asm instance. i.e there is no relation between database instance and asm instance in terms of I/O.

Database instance only get the asm extent map information(asm metadata) from asm instance.

12. What is the minimum number of asm disk groups we should have?

2 diskgroups.

13. What are the different  header status of asm disks.?

CANDIDATE – > Means 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,)

MEMBER – > Means disk is already part of a diskgroup

FORMER –  > Mean disk was formerly part of a diskgroup ,But currently not part of any diskgroup.

14. Can we add a MEMBER disk to a asm diskgroup?

15. Explain different redundancy types of asm diskgroups.

The redundancy levels are:

  • EXTERNAL redundancyOracle ASM does not provide mirroring redundancy and relies on the storage system to provide RAID functionality. Any write error causes a forced dismount of the disk group. All disks must be located to successfully mount the disk group.
  • NORMAL redundancyOracle 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. You can optionally choose three-way or unprotected mirroring.A file specified with HIGH redundancy (three-way mirroring) in a NORMAL redundancy disk group provides additional protection from a bad disk sector in one disk, plus the failure of another disk. However, this scenario does not protect against the failure of two disks.
  • HIGH redundancyOracle ASM provides three-way (triple) mirroring by default. A loss of two Oracle ASM disks in different failure groups is tolerated.

16. What is multi pathing? How asm works with multi-pathing?

Generally i/o path consists of components lke LUN ,adapter, cable, switches etc. These are configured between storage and server system.

And in High availability env, we use multiple components, Which provides us multiple i/o path options between storage and server, which helps in load balancing and failover in case of any path /component failure.

Different vendors provided multiple pathing solution such as by EMC. ( emcpower) .

Lets say the first path to disk /dev/rdsk/c12900c4

second path to disk /dev/rdsk/c1300c4,

Then emc will create a pseudo device name call /dev/rdsk/emcpower1.

ASM doesnt provide multipathing on its own. But we can incorporate 3rd party solution to asm.

So we can use asmlib to make this /dev/rdsk/emcpower1 as asmdisk and use it .

For example, if you are configuring ASMLIB with EMC’s PowerPath, you can use the following setup:

ORACLEASM_SCANEXCLUDE=sd

ORACLEASM_SCANORDER=emcpower

ORACLEASM_SCANORDER dictates the ASMLIB scan order of the devices, using the generic prefix.

ORACLEASM_SCANEXCLUDE indicates which devices should not be discovered by ASMLIB.

 

17. What is disk_repair_time in asm?

18. What Allocation unit(AU) in asm?

  • This is the fundamental unit of allocation in a diskgroup.
  • Default AU is 1 MB, can be changed to  2,4,8,16,32MB etc.
  • In exadata default AU is 4 MB.
  • This is a disk group attribute. So each diskgroup can have their own AU_SIZE attribute.

19. What is ASM extent?

Consists of one or more AU.  A asm file consists of  one or multiple asm extents .

From 11g onwards, we have variable extent size.i.e

  •  First 20,000 extent sets will have extent size equal to disk group AU_SIZE.
  • Next 20,000 extent sets will have extent size equal to 4*AU_SIZE
  • Next 20,000 and higher will have extent size equal to 16* AU_SIZE

Why variable extent size?

For each extent there is an extent map in shared pool. If the large databases use the default extent size. ( which is equal to au_size), then sga memory requirement  for ASM instance will be very high and it need to store a lot  extent maps  in memory.

With variable extent size feature , database need fewer extents to describe an asm file, and less memory to manage the extent maps in shared pool.

20. For very large databases , should we use small AU or large AU?

If the database is very big, then larger AU is recommended, Because

  • Reduced SGA size to manage the extent maps in the RDBMS instance
  •  Increased file size limits
  •  Reduced database open time, because VLDBs usually have many big datafiles( In 11g , this has been eradicated by fetching extents only on demand).

In Oracle 11g, only the first 60 extents in the extent map are sent at file-open time. The rest are sent in batches as required by the RDBMS.

21. When rebalance happens?

Changes like adding, dropping   disks, triggers rebalance operation. Rebalance operation provides even distribution of file extents and space usage across all the disks of a diskgroup. This is necessary for asm to provided balance i/o.

22. Explain in detail how rebalance works?

Let’s say a new disk has been added. Then below is the sequence of rebalance.

  • This triggers the RBAL process to create the rebalance plan and then begin coordination of the redistribution
  • RBAL calculates estimated time and work required to perform the task and then messages the ASM Rebalance (ARBx) processes to handle the request.  ASM_POWER_LIMIT decides how many number of ARBn processes will be created.
  • The Continuing Operations Directory (COD) is updated to reflect a rebalance activity. This is important, Because support the rebalance is failed in the middle , Then the other instance can use this COD to either complete or rollback the rebalance operation.
  • RBAL distributes plans to the ARBs. In general, RBAL generates a plan per file; however, larger files can be split among ARBs.
  • ARBx performs rebalance on these extents. Each extent is locked, relocated, and unlocked.

We can monitor rebalance operation from v$asm_operation.

23. Let’s say currently rebalance is running with power limit of 5. After running for 1 hour, we found that it is slow and we need to complete it quickly. Can we increase the power limit and what will be the impact on ongoing rebalance operation?

Yes, we can increase the power limit of existing rebalance operations. As soon as we increase the power limit, additional ARB processes will be created and will try to complete the rest of the rebalance operation.

What if we reduce the power limit  to 2 ?-   > In that case the rebalance will be handled by 2 ARB processes. And those extra ARB process which were already running, then will finish their extent relocation and then they are closed.

 

24. In your diskgroup, all the disks are of same size. But still when you find that disks are not balanced. What could be the reason?

  1. Either asm disk was added with rebalance power of 0(ZERO).
  2. Or Previous rebalance by aborted due to any reason. ( which was not completed after that).

 

25.  What will happen if  the sever crashed in the middle of rebalance operation?

 

26.  Difference between asmlib and asm filter driver?

 

27.  Is there any dependency between ASM and ASSM?

No there is no relation between them.

28.  Explain in detail, what happens when a asm file is CREATED by oracle database.

Suppose a database wants to create datafile inside ASM.

  1. First a file creation request is send from rdbms to asm which include info like DG_NAME,FILE_TYPE,SIZE, BLOCK size etc through Onn process
  2. ASM use this information to allocate the file( by considering the redundancy and striping details as per template information received)
  3. After allocating the file, asm sends extent map information to rdbms instance.
  4. ASM creates COD entry to track pending file creation process.
  5. RDBMS instance then initialize the file and complete the process.
  6. After asm receives the confirmation from rdbms instance, LGWR will flush the ACD records. Then DBWR will write to allocation table, file directory information.

If file creation is aborted , in the middle, then ASM will use COD data to rollback the operation.

29.  Explain in detail, what happens when a asm file is OPENED by oracle database.

When asm instance need to open an asm file

RDBMS sends an open file request with the file name to asm through o0nn process.

ASM gets the extent map information from file directory

 

30.  Explain in detail, what happens when a asm file is DELETED by oracle database.

31.  My ASM /grid version is 19c, Can I have one 19c and one 12c database in that?

32.  Explain what you know about ASM metadata?

                  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.

ASM has two main classses of metadata.

Physical Metadata

Virtual Metadata

Physical Metadata:

They are stored in a fixed locations on the disk. This fixed location is necessary for asm bootstapping. This

  •  Disk Header
  •  Allocation Table (AT)
  •  Free Space Table (FST)
  •  Partnership Status Table (PST)

Virtual Metadata:

  • File Directory – Stores information about asm files(name,size,type,striping infor, redundancy) in a diskgroup.
  • Disk Directory – Stores information about disks in a diskgroup.
  • Active Change Directory (ACD)
  • Continuing Operations Directory (COD) s Template DirectoryAlias Directory
  • Attribute Directory
  • Staleness Directory
  • Staleness Registry

33. What is allocation Table?

  • Each asm disk has a allocation table(AT), to track free and allocated space within the disk.
  • This table contains each allocation entry(ATE) for each AU(Allocation Unit).
  • ATES are grouped into allocation table block( ATB)
  • Unallocated AUs are marked as free in the Allocation Table. The free extents are kept in a linked list to facilitate quickly finding a free AU for allocation.

34. What is free space Table(FST)?

  • FST indicates which Allocation table blocks(ATB) contains free AU.
  • Whenever a disk is selected for allocation, then ASM consults FST, so that it can skip ATBs which are fully occupied.

35. What is Partnership status table ?

 

36. What is the default asm metadata block size?

Metadata block size is 4K . Note that asm metadata block size is independent of oracle database files.

 

37. What is active change directory(ACD) ?

Active change Directory

  • It is similar to redolog in database.
  • When the ASM instance needs to make an atomic change to multiple metadata blocks, a log record is written into the ASM active change directory (ACD),
  • ASM uses the ACD to perform crash recovery and instance recovery to ensure that the ASM metadata is consistent.

38.What is  Continuous operation directory(COD)?

  • This is similar to Undo in database
  • Long running operations like CREATE/DROP DISK , rebalance activities are tracking via this file.
  • If the long running processes die before completing the process. Then recovery process check this file , then either complete or rollback the task accordingly.

2 types of continuing operations:

Background:

  • Disk group rebalance is a background operation process.
  • If rebalance fails or asm instance crashes, then the surviving instance will refer this file to complete the process.

Rollback :

  • It is performed by foreground process. Foreground process performs on behalf of database instance.
  • If creation of asm file operation fails, then the partially created file need to be deleted .
  • example- Create/delete/drop file.

39.What is  Staleness registry?

  • The staleness registry tracks allocation units that became stale when the disk is offline, ( Possible only in normal or high redundancy only).
  • The staleness directory contains metadata to map the slots in staleness registry to particular disk and rdbms database.
  • When a disk goes offline, each RDBMS instance gets a slot in the staleness registry for that disk. This slot has a bit for each allocation unit in the offline disk. When an RDBMS instance I/O write is targeted for an offline disk, that instance sets the corresponding bit in the staleness registry.
  • When disk becomes online, it checks the AU, who has this bit  set and copies the mirror extents  for them.

40.Explain how extent relocation happens in asmdisks?

Relocation is the act of moving extents from one disk to another in a diskgroup, which mostly happens during rebalance operation.

Relocation happens per extent basic.

There are two scenarios:

File close:

For a given extent, if the file is closed, then asm can relocate the extents without sending any messages to other asm or rdbms instances.

File open:

  • But for a given extent, if the file is open, then the 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 messesges 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.

 

41.Explain how asm crash recovery happens?

ASM crash recovery is similar to that of database instance crash recovery.

Two virtual metadata directories are responsible for crash recovery.

Active change directory(ACD) – Which is like REDO in database

Continuous Change Directory(COD) – Which is like UNDO in database

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 goind on during instance crash.

42. Does rebalance happens periodically?

No rebalance doesn’t happen periodically.

43. Suppose User is running a create datafile command in database, But in the middle the server crashed . What will happen to create datafile command?

This will be rolled back.

44. How do you know whether rebalance is going on or not?

45. What is the use of kfed utility?

46. What is + sign in  every  ASM diskgroup?

47. What is the use of  incarnation number in asm file system?

48. Lets say you have disk group with normal redundancy. And one disk of that diskgroup became offline temporarily. And in the mean time that diskgroup received lot of transaction. So how that disk will be synced with its mirror disks.?

Using staleness registry and staleness directory.

49. Can i export(expdp) data to ASM diskgroup.

Yes we can. For that create the directory with asm path.

create directory EXPDIR as ‘+FRA/BACKUP’;

50. What is oracle ACFS and in which scenarios ACFS is useful?

51. What is Flex ASM? 

With Oracle Flex ASM, the clients can connect to remote ASM using network connection (ie ASM network ). If a server running an ASM instance fails, Oracle Clusterware will start a new ASM instance on a different server to maintain the cardinality. If a 12c database instance is using a particular ASM instance, and that instance is lost because of a server crash or ASM instance failure, then the Oracle 12c database instance will reconnect to an existing ASM instance on another node. These features are collectively called Oracle Flex ASM.

52. What are the advantages of using ASM instead of traditional  raw file system?

53. What is asm striping?

Oracle ASM separate files into stripes and spread them across all the disks of a disk group.

Why striping?

  • To balance load across disks
  • To reduce I/O Latency

Two types of striping in asm.

COARSE GRAINED:

  • In coarse grain, the stripe size is same as AU of asm diskgroup.( i.e 1 MB default)
  • It is helpful for voluminous i/o .
  •  It manages load across disks.
  • Datafile, redolog file, tempfiles are coarse grained

FINE GRAINED:

  • The stripe size is 128 KB.
  • Helpful for low latency activities.
  • Useful for files of small size with small io
  • Only controlfile is fine grained currently as controlfile size is small and it can be spead across disks.

 

54. Why control_file is fine grained?

 

55.  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.

It is a best practice to add and drop multiple disks at a time so that ASM can reorganize partnership information within ASM metadata more efficiently.

56.  What is the benefit of using asmlib?

  • It simplifies asm disk administration.
  • ASMLIB efficiently handles file descriptors and thus reduces the number of open file descriptors on the system, making it less likely to run out of global file descriptors. Also, the open and close operations are reduced, ensuring orderly cleanup of file descriptors when the storage configuration changes.

     

57.What is fast rebalance feature of oracle 11g asm?

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 messasging between the asm instances can cause a delay.

So in a situation , where user dont 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 activites 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.

 

58.What is asm proxy?

  • With introduction of Flex ASM in Oracle 12c, hard dependency between ASM and its clients has been relaxed .i.e all the nodes in a cluster no need have active asm instance.
  • In such a scenario, in order to make ACFS services available on nodes without an ASM instance, a new instance type has been introduced by Flex ASM.
  • The ASM-proxy instance which works on behalf of a real ASM instance. ASM Proxy instance fetches the metadata about ACFS volumes and file systems from an ASM instance and caches it.
  • If ASM instance is not available locally, ASM proxy instance connects to other ASM instances over the network to fetch the metadata.
  • Additionally, if the local ASM instance fails, then ASM proxy instance can failover to another surviving ASM instance on a different server resulting in uninterrupted availability of shared storage and ACFS file systems.

59. How can we check whether flex asm is enabled or not? Also If i have 5 node RAC, and I want to keep 3 ASM instanes in any of the 3 nodes out of 5., How i will do it.

ASMCMD> showclustermode
ASM cluster : Flex mode enabled
[root@dbatestbin]# ./srvctl modify asm -count 3
[root@dbatest bin]# ./srvctl config asm
ASM home: /crsapp/app/oracle/grid/19c_home
Password file: +DATA/paramfile/orapwASM
ASM listener: LISTENER
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM

60. How flex asm works? 

With Oracle Flex ASM, the clients can connect to remote ASM using network connection (ie ASM network ). If a server running an ASM instance fails, Oracle Clusterware will start a new ASM instance on a different server to maintain the cardinality. If a 12c database instance is using a particular ASM instance, and that instance is lost because of a server crash or ASM instance failure, then the Oracle 12c database instance will reconnect to an existing ASM instance on another node. These features are collectively called Oracle Flex ASM.

Flex ASM requires a separate listener called ASMLISTENER to be configured on a different port number which is not being used by any other Listener. The other important thing is that FLEX ASM requires a separate network with which the ASM instances and it’s clients communicate. You can also make use of the private network ethernet (used for inter node communication) as the network for the ASM instances and it’s clients to communicate.

61. How can we convert standard asm to flex asm?

[oracle]$ asmca -silent -convertToFlexASM -asmNetworks eth1/192.168.1.0 -asmListenerPort 1529

[root]# /crsapp/app/oracle/cfgtoollogs/asmca/scripts/converttoFlexASM.sh

 

srvctl config asm

We can change the asm cardinality i.e If we have 3 node RAC, and we want ASM to run on 2 node RAC, then

[oracle@]$ srvctl modify asm -count 2

 

Alternatively we can use the GUI method i.e using ASMCA utility.

62. Suppose the spfile location inside the gpnp profile is missing, Will the asm start during cluster startup?

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:
    1. SPFILE OR PFILE in the Oracle ASM instance homeFor 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

Note:

A PFILE or SPFILE is required if your configuration uses nondefault initialization parameters for the Oracle ASM instance.

 

63. User ran select * from EMP, where the datafile is in ASM . Explain how it will get the data from asm disks.

 

64. How you estimate how much the rebalance will take?

 

65. What are the different phases of diskgroup rebalance?

  • Planning
  • File extents relocation
  • Disk compacting

66. 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’;

 

Prior to 12c( We need to change parameter at instance level)

alter system set _disable_rebalance_compact=true ….

 

67. What is flex asm diskgroup?