Oracle ASM 2 Q&A
Oracle ASM 2 Q&A
Oracle ASM 2 Q&A
1
2. Explain the advantages of using ASM.
RAID 1+0 – First mirroring then striping – Mostly used for oracle database
irst time, when rdbms instance tries to access an asm file, It needs to establish a local asm
F
connection.
SMB process contacts CSS using diskgroup names and gets the connection string. Using that
A
connection string, bequeath connection is established between asm and RDBMS instance.
he RDBMS authenticates itself to the ASM instance via operating system (OS) authentication
T
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.
SMB is the rdbms side process and UFG(umbilicus foreground process) is the asm side
A
process. Both communciate through this umbilicus.
hen ASM instance opens a datafile, ASM ships the file’s extent map to rdbms instance ,
W
where it is stored in SGA.
y using that extent map , rdbms can do i/o on the asm files directly without going through asm
B
instance
hough we can keep different sized disks in a diskgroup, The extent distribution will be
T
unbalanced. And it will induce unbalanced i/o across the diskgroup.
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.
ut please note, Higher value of asm_power_limit can cause more cpu load. So always use a
B
balanced value and try to do these in non-peak hours.
RBAL – This opens all the devices upon discovery and coordinate the rebalance operation.
ARBn – These are the slave processes, that do the rebalance operation
LGWR – It manages the active change directory and flushes the ACD change records to disk.
MARK – > Mark allocation Unit, process coordinates the updates to the staleness registry
SMON – >
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.
11. How can i improve the i/o performance between database instance and asm instance?
sm instance is not in the i/o path . Database perform i/o directly with asm disks, It doesnt go
a
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.
ANDIDATE – > Means disk is available and can be added to diskgroup.( Usually in solaris
C
sparc, hpux)
ROVISIONED – > Same as candidate disk, But disk was provisioned using asmlib. ( Usually in
P
Linux,)
ORMER – > Mean disk was formerly part of a diskgroup ,But currently not part of any
F
diskgroup.
14. Can we add a MEMBER disk to a asm diskgroup?
XTERNAL redundancyOracle ASM does not provide mirroring redundancy and relies on the
E
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?
enerally i/o path consists of components lke LUN ,adapter, cable, switches etc. These are
G
configured between storage and server system.
nd in High availability env, we use multiple components, Which provides us multiple i/o path
A
options between storage and server, which helps in load balancing and failover in case of any
path /component failure.
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 .
or example, if you are configuring ASMLIB with EMC’s PowerPath, you can use the following
F
setup:
ORACLEASM_SCANEXCLUDE=sd
ORACLEASM_SCANORDER=emcpower
RACLEASM_SCANORDER dictates the ASMLIB scan order of the devices, using the generic
O
prefix.
Consists of one or more AU. A asm file consists of one or multiple asm extents .
First 20,000 extent sets will have extent size equal to disk group AU_SIZE.
ext 20,000 extent sets will have extent size equal to 4*AU_SIZE
N
Next 20,000 and higher will have extent size equal to 16* AU_SIZE
Why variable extent size?
or each extent there is an extent map in shared pool. If the large databases use the default
F
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.
ith variable extent size feature , database need fewer extents to describe an asm file, and less
W
memory to manage the extent maps in shared pool.
20. For very large databases , should we use small AU or large AU?
educed SGA size to manage the extent maps in the RDBMS instance
R
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.
Let’s say a new disk has been added. Then below is the sequence of rebalance.
his triggers the RBAL process to create the rebalance plan and then begin coordination of the
T
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.
3. Let’s say currently rebalance is running with power limit of 5. After running for 1 hour, we
2
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?
es, we can increase the power limit of existing rebalance operations. As soon as we increase
Y
the power limit, additional ARB processes will be created and will try to complete the rest of the
rebalance operation.
hat if we reduce the power limit to 2 ?- > In that case the rebalance will be handled by 2
W
ARB processes. And those extra ARB process which were already running, then will finish their
extent relocation and then they are closed.
4. In your diskgroup, all the disks are of same size. But still when you find that disks are not
2
balanced. What could be the reason?
25. What will happen if the sever crashed in the middle of rebalance operation?
28. Explain in detail, what happens when a asm file is CREATED by oracle database.
irst a file creation request is send from rdbms to asm which include info like
F
DG_NAME,FILE_TYPE,SIZE, BLOCK size etc through Onn process
ASM use this information to allocate the file( by considering the redundancy and striping details
as per template information received)
After allocating the file, asm sends extent map information to rdbms instance.
ASM creates COD entry to track pending file creation process.
RDBMS instance then initialize the file and complete the process.
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.
RDBMS sends an open file request with the file name to asm through o0nn process.
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?
SM stores metadata to describe and track diskgroup contents. All of the metadata
A
that describe the composition and contents of an ASM diskgroup are stored within the diskgroup
itself, which makes each diskgroup self- describing.
Physical Metadata
Virtual Metadata
Physical Metadata:
hey are stored in a fixed locations on the disk. This fixed location is necessary for asm
T
bootstapping. This
isk Header
D
Allocation Table (AT)
Free Space Table (FST)
Partnership Status Table (PST)
Virtual Metadata:
ile Directory – Stores information about asm files(name,size,type,striping infor, redundancy) in
F
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?
ach asm disk has a allocation table(AT), to track free and allocated space within the disk.
E
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.
etadata block size is 4K . Note that asm metadata block size is independent of oracle
M
database files.
Background:
he staleness registry tracks allocation units that became stale when the disk is offline, (
T
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?
elocation is the act of moving extents from one disk to another in a diskgroup, which mostly
R
happens during rebalance operation.
File close:
or a given extent, if the file is closed, then asm can relocate the extents without sending any
F
messages to other asm or rdbms instances.
File open:
ut for a given extent, if the file is open, then the the asm instance , which is handling this
B
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.
When we asm crash recovery Means it is asm diskgroup recovery. During recovery
irst the surviving instance applies the ACD record associated with crashed instance.Applying
F
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?
3. Suppose User is running a create datafile command in database, But in the middle the
4
server crashed . What will happen to create datafile command?
8. Lets say you have disk group with normal redundancy. And one disk of that diskgroup
4
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.?
Yes we can. For that create the directory with asm path.
ith Oracle Flex ASM, the clients can connect to remote ASM using network connection (ie
W
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?
Oracle ASM separate files into stripes and spread them across all the disks of a disk group.
Why striping?
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:
5. Suppose we need 5 disks of 1 TB each to an existing diskgroup. Should I add them one by
5
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.
sually, when we add or drop disks to a diskgroup, rebalance is initiated and communication
U
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.
o in a situation , where user dont need to access the diskgroup, then we can use this fast
S
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.
ith introduction of Flex ASM in Oracle 12c, hard dependency between ASM and its clients has
W
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.
SMCMD> showclustermode
A
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?
ith Oracle Flex ASM, the clients can connect to remote ASM using network connection (ie
W
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.
lex ASM requires a separate listener called ASMLISTENER to be configured on a different port
F
number which is not being used by any other Listener. The other important thing is that FLEX
SM requires a separate network with which the ASM instances and it’s clients communicate.
A
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.
[root]# /crsapp/app/oracle/cfgtoollogs/asmca/scripts/converttoFlexASM.sh
e can change the asm cardinality i.e If we have 3 node RAC, and we want ASM to run on 2
W
node RAC, then
Alternatively we can use the GUI method i.e using ASMCA utility.
2. Suppose the spfile location inside the gpnp profile is missing, Will the asm start during
6
cluster startup?
When an Oracle ASM instance searches for an initialization parameter file, the search order is:
he location of the initialization parameter file specified in the Grid Plug and Play (GPnP) profile
T
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 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:
PFILE or SPFILE is required if your configuration uses nondefault initialization parameters for
A
the Oracle ASM instance.
3. User ran select * from EMP, where the datafile is in ASM . Explain how it will get the data
6
from asm disks.
64. How you estimate how much the rebalance will take?
lanning
P
File extents relocation
isk compacting
D
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.
ompact phase may take some time during the rebalance operation. So if we are using flash
C
disks, then there is no need of compacting. So we can chose the disable it depending on which
oracle version you were.