Sei sulla pagina 1di 11

-- ====================== Start ASM By Sathish Lodan

What is required in real life Environment?


1. Storage should offer me - a file bigger than disk.
Small Office and Home Office(SOHO) :- We typical use disk as a disk or somebody
would partition a disk and then use each partition as disk.
2. IO throughput should be the best.
We can partition a disk into multiple and use but the IO read write will be the
same.
It will not changed when you partition a disk into multiple.
3 . For critical data we want disk fault tolerance.
Oracle Database 11gR2 Automatic Storage Management(ASM) Part 1
The Real infrastructure demans following featurs
1. Disk Fault Tolerance
When a disk holding your database data file fails an outage is evident.
Although backups can be used to get the lost file restores on a fresh di
sk it still cause costly downtime.
Instead the disk sub-system should offer resiliance against failure and
the disk failure should be transparent
This is often achived via RAID(Redundant Array of Independent Disks)
RAID makes the individual disk failure transparent to the application us
ing the data on the disk.
Multiple RAID levels can be used depending on what we want to achieve.
RAID-0 : Stripping
pating disks in the RAID-0 Group.

: Splits the data across all the partici

: It offers excellent IO
Performance and scalability but does not provide fault torelance
: A failure of a single
disk in RAID-0 Group fails the entrie group - ALl data is eventually lost
: RAID-0 offers excellen
t economy (Cost per storage byte) is less .
: Can be used for non-cr
itical archive data which can be restored fro, backups and during the
Downtime is not a matt
er of much concern.
RAID-1 : Disk Mirroring : Can be used with 2 disks which acts as a mirro
r. what-ever data you store on it is written
Twice on both the disk
s in RAID-1 Group. So, If you lost a disk the data is still available from the o
ther disk.
: Normally used for inst
alling OS.
: Is very expensive (Cos
t Per storage byte doubles). Not feasiable for huge data stores.
: Heavy writes are simpl
y doubled although the writes on both the disks can be parallelized.
Two problems RAID-0 Does not offers disk fault torelance but it offers t
he best economy factor.
RAID-1 Does not offers economy factor but it of
fers the best disk fault torelance.
RAID-5 Data Stripping with distributed parity :- Requires a minimum of 3

Disks.
: Considering the cost a
nd the fault torelance its a golden mean between RAID-0 and RAID-1.
: Along with the data the RAID controller computed and writes the parity on the participating disks.
: This often results in
slow IO Performance during writes - all the disks would bre busy all the times Some of them wou
ld receive data others would receive parity, All the disks would spining all the
time.
: This is not suitable f
or data which undergoes frequent modification (eg :- Redo logs and OLTP data)
: Can be used for archiv
e data which need to held on the disk and is mostly read-only in nature, Read da
ta and rarelly modify.
RAID-10 :- Express as RAID-0+RAID-1 or RAID-1+RAID-0: The only differenc
e is what we do first and what we on next.
* Is it the stipping hap
pens first followed by mirroring of those stripes.
* Is it the mirroring ha
ppens first followed by the stripes of those mirrrores.
Offers the common benefi
t for database RAID-0 and RAID-1.
Oracle recommends for da
tabase RAID-10
With fault tolerance comes the investmenr in RAID controller which offer
s resilence against disk failures.
RAID are rule/algorithm driven and not content driven.
Eg : Assume you want to store : Very important, moderatellyImportance an
d LessImportant data on RAID-1.
: Then all the data would be redundantly written to both the disks in
RAID-1.
: You cannont segregate data which you want to mirror and the data wh
ich you don't want to mirror.
ASM Allows you to assemble multiple disks into a more cohesive unit c
alled - ASM Diskgroup.
An ASM Diskgroup can have disks which are not protected by RAID. An A
SM Diskgroup at creation time can
Select the desire fault tolerance : External, Normal or High offering
almost same benefites like RAID.
In case of ASM we call it as redundancy,There are three types of redu
ndancy happense.
External :Normal
RAID-1 :- The content in this diskgroup get mirrored, T
EMP and DATAFILE from index tablespaces also get mirrored.
These files are not that much
important, if i lost it.So Fault tolerance is not important for these files.
High
:You however Additionally get control over which files you want to ena
ble fault tolerance and which you would like to

Disadvantages of RAID :- We need a same capacity of two disks (One wi


th 100gb and another with 160 gb).
In this case low

er size would be my driving disks, So I will not able to utilize fully 160gb siz
e.
In this case if
we create a disk group in ASM with two disks (One with 100gb and another with 16
0 gb).
in ASM it would
be the physical diks this is an luns in the real life.
Luns are customi
sable.
2. Flexibility in handling the storage
At any given point in time you should be ablie to add/remove/res
ize the storage disk.
This is often achived using : Volume manager.
Volumn Manager allows you to club multiple independent disks (PV
- Physical Volumn) into a logical container(Volumn group VG).
Once you have in VG - you can create multiple LVs. These LVs can
then be mounted and consumed.
Adding/Removing a disk is an online, seamless and transprant ope
ration.
When ever you don't have the volumn managment built into your OS
- you may still implement it with
some third party volumn manager-like verita volumn manager.
ASM offers VM like capabilities.
In ASM we can attach multiple diks and create a disk group in it
.
In that diskgroup it has own fault tolerance level(redundancy fa
ctor).
It offers you the RAID+Volumn management
While adding or removing disk in a diskgroup the data in the ASM
diskgroup is unchanged, seamless and transprant operation without extra cost.
3. Improved IO throughput for IO intensive databases.
As a thumb rule - one would except 100MB/s of IO throughput for every Xe
on CPU core.
FOr example if your having Multi core system then,
This thumb rule will applicable for IO intensive databases, not for the
computation intensive this rule will not apply.
2 CPU * 6 Cores = 122 Cores* 100MB/s = 1.2 GB/s
Improved IO Through can be achived by using ultiple disks (Disk array) a
nd preferable the outer tracks of those disks.
IO throughputs may achived SSD or fusion cards.
Timeinstand -- which is in memory database.
ASM stripes data on all the participating disks in the diskgroup in case
of external redundancy.
ASM stripes data on all the participating disks in the failure group in
case of Nornmal/High Redundancy.
4. Avoiding manual intervention in tunning the IO load

In a system with classic file systems - you keep on adding data to the m
ounts.
Later you experience that some mounts are experiencing High IO while oth
ers have moderate and low IO.
The mount points are in Hot/warm/cold
Hot :- Read and writing data into the disks frequentlly, In such cases w
e can move the some of the files from hot to cold disks.
Goal is to balance the IO if the disks, and to keep all the disks in the
warm catagory.
In such cases you have to migrate/move files from disks with High IO to
disks with low IO
While moving data from the HOT to COLD disks (Eg:- Moving tablespace / d
atafile) we need to take into offline,
then give the OS command to mount the new datafile, data will be unavail
able for a moment.
This often means data would be unavailable for some time.
In ASM We can solve this problem :When we add a new disk to ASM diskgroup - ASM automatically triggers IO
Rebalancing Operation.
After a couple of time when we check the disk usage in the ASM diskgroup
it shows the equally occupaid space in the diskgroup.
IO Rebalancing is Online and seamless In ASM.
Database doesnot know that what are the data has moved from disk1 to new
disk.
5. Shared Disk with easy of management in cluster environments.
A cluster is a collection of computing nodes(Servers/Computers) and requ
ires the same data to be accessible
from any of those nodes. Necessary memory fusion(cache coherence) would
be taken care by the software.
but you still need data to be shared without the added complexity of usi
ng RAW devices.
This can be addressed by using :- Cluster file systems(CFS)
AIX :- GPFS
LINUX :- GFS/OCFS2
Veritas :- CFS
Windows :- MSMC
ASM :- Presents the same diskgroup to all the nodes in the cluster.
In addition to sharing the ASM diskgroup, ASM now-a-days support via ADV
M feature - ASM volumns.
AN ASM Volume can then be formatted with a regular file system(to be use
d if you want one node mount-point)
and with(ACFS) if you want to create a cluster mount-point.
6. Facility to take instant backups(Snapshots)
ASM Starting from 11gR2 introduced snapshots of ASM volumns.
A Snapshot is a read-only point in time copy of data.
A traditional backup involves copying the principal to some backup locat
ion.
The time it takes to copy is directly propotional to the data being copi
ed.
Also, you end-up spending same amount of disk space for backups as Princ
ipal.
Snapshots offer backups in no-time and without spending the disk space e
qual to the size of principal.

ASM Archicture
Automatic Storage Management(ASM) Product is distributed as part of grid
infrastructure product suite.
ASM Comprises of :
a. ASM Instance : Like any other database instance is a collection of me
mory and background processes.
b. ASM Diskgroup : Is a collection of disks/partitions/Luns Which may or
may not be protected by RAID.
The ASM Instance facilitates
ASM Diskgroup creation/ Deletion
Adding/Removing Disks in a diskgroup
Managing ASM Diskgroup's meta-data Which is kept in the ASM disk
s. Without this meta-data ASM instance
Cannot operate upon the diskgroups.
Creation of Continuning Operations Directory (COD) When a databa
se insatnce request file creation on a disk group
Maintaining the active change directiot(ACD).
IO Rebalancing when a new diskis added to a diskgroup or when an existin
g disk is removed from a diskgroup
- Mounting of diskgroups during instance startup
Creation of ASM volumns inside ASM diskgroup
Recovery of ASM diskgroup data in case of ASM instance crash usi
ng ASM transient logs.
ASM Instance like any other instance requires a parameter file (PFILE/SP
FILE) During Startup.
The Parameters are however very limited

-- ====================== End ASM By Sathish Lodan


Oracle ASM Interview Questions and Answers
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 be
en made in versions 11g release 1 and 2.
ASM offers support for Oracle RAC clusters without the requirement to install 3r
d party software, such as cluster aware volume managers or filesystems.
ASM is shipped as part of the database server software (Enterprise and Standard
editions) and does not cost extra money to run.
ASM simplifies administration of Oracle related files by allowing the administra
tor to reference disk groups
rather than individual disks and files, which are managed by ASM.
The ASM functionality is an extention of the Oracle Managed Files (OMF) function
ality that also includes striping and mirroring to provide balanced
and secure storage. The new ASM functionality can be used in combination with ex
isting raw and cooked file systems, along with OMF and manually managed files.
Advantages of ASM in Oracle?

Provides automatic load balancing over all the available disks, thus reducing ho
t spots in the file system
Prevents fragmentation of disks, so you don't need to manually relocate data to
tune I/O performance
Adding disks is straight forward - ASM automatically performs online disk reorga
nization when you add or remove storage
Uses redundancy features available in intelligent storage arrays
The storage system can store all types of database files
Using disk group makes configuration easier, as files are placed into disk group
s
ASM provides stripping and mirroring (fine and coarse gain - see below)
ASM and non-ASM oracle files can coexist
Striping ASM spreads data evenly across all disks in a disk group to optimize perf
ormance and utilization. This even distribution of database files eliminates the
need for regular monitoring and I/O performance tuning.
For example, if there are six disks in a disk group, pieces of each ASM file are
written to all six disks. These pieces come in 1 MB chunks known as extents. Wh
en a database file is created, it is striped (divided into extents and distribut
ed) across the six disks, and allocated disk space on all six disks grows evenly
. When reading the file, file extents are read from all six disks in parallel, g
reatly increasing performance.
Mirroring ASM can increase availability by optionally mirroring any file. ASM mirr
ors at the file level, unlike operating system mirroring, which mirrors at the d
isk level. Mirroring means keeping redundant copies, or mirrored copies, of each
extent of the file, to help avoid data loss caused by disk failures. The mirror
ed copy of each file extent is always kept on a different disk from the original
copy. If a disk fails, ASM can continue to access affected files by accessing m
irrored copies on the surviving disks in the disk group.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and
3-way mirroring, where each file extent gets two mirrored copies.
Online storage reconfiguration and dynamic rebalancing ASM permits you to add or r
emove disks from your disk storage system while the database is operating. When
you add a disk, ASM automatically redistributes the data so that it is evenly sp
read across all disks in the disk group, including the new disk. This redistribu
tion is known as rebalancing. It is done in the background and with minimal impa
ct to database performance. When you request to remove a disk, ASM first rebalan
ces by evenly relocating all file extents from the disk being removed to the oth
er disks in the disk group.
Managed file creation
bling files stored in
lly assigns filenames
en they are no longer

and deletion ASM further reduces administration tasks by ena


ASM disk groups to be Oracle-managed files. ASM automatica
when files are created, and automatically deletes files wh
needed.

What is ASM instance in Oracle?


The ASM functionality is controlled by an ASM instance. This is not a full datab
ase instance, just the memory structures and as such is very small and lightweig
ht.

Characteristics of Oracle ASM instance


-------------------------------------1. do not have controlfile and datafiles, do not have online redo logs
2. do have init.ora and a passwordfile
3. for connecting remotely, create passwordfile and set following in init.ora
remote_login_passwordfile=exclusive
create a password file:
$ORACLE_HOME/bin/orapwd file=orapw+ASM1 password=yourpw entries=10
4. ASM instance can not be in open status as there are not datafiles. Can be in
mount (although
there is no controlfile) and nomount status. When in mount status, database can
use the
diskgroup. The mount status actually means mount disk groups.
What are ASM Background Processes in Oracle?Both an Oracle ASM instance and an O
racle Database instance are built on the same technology. Like a database instan
ce, an Oracle ASM instance has memory structures (System Global Area) and backgr
ound processes. Besides, Oracle ASM has a minimal performance impact on a server
. Rather than mounting a database, Oracle ASM instances mount disk groups to mak
e Oracle ASM files available to database instances.
There are at least two new background processes added for an ASM instance:
ASM Instance Background Processes:
--------------------------------ARBx (ASM) Rebalance working processARBn performs the actual rebalance data exte
nt movements in an Automatic Storage Management instance. There can be many of t
hese processes running at a time, named ARB0, ARB1, and so on.These processes ar
e managed by the RBAL process. The number of ARBx processes invoked is directly
influenced by the asm_power_limit parameter.
RBAL (Re-balancer) RBAL runs in both database and ASM instances. In the database
instance, it does a global open of ASM disks. In an ASM instance, it also coord
inates rebalance activity for disk groups.RBAL, which coordinates rebalance acti
vities
for disk resources controlled by ASM.
Database Instance ASM Background Processes:
------------------------------------------In the database instances, there are t
hree background process to support ASM, namely:
ASMB, this process contact CSS using the group name and acquires the associated
ASM connect string. The connect string is subsequently used to connect to the AS
M instance.
RBAL, which performs global opens on all disks in the disk group.A global open m
eans that more than one database instance can be accessing the ASM disks at a ti
me.
O00x, a group slave processes, with a numeric sequence starting at 000.
What are the components of components of ASM are disk groups?
The main components of ASM are disk groups, each of which comprise of several ph
ysical disks that are controlled as a single unit. The physical disks are known
as ASM disks, while the files that reside on the disks are know as ASM files. Th
e locations and names for the files are controlled by ASM, but user-friendly ali
ases and directory structures can be defined for ease of reference.

Failure groups 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 f
ailure groups so individual files are written to two locations.
What are ASM instance initialization parameters?
INSTANCE_TYPE - Set to ASM or RDBMS depending on the instance type. The default
is RDBMS.
DB_UNIQUE_NAME - Specifies a globally unique name for the database. This default
s to +ASM but must be altered if you intend to run multiple ASM instances.
ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instanc
e. The valid values range from 1 to 11, with 1 being the default. The higher the
limit the more resources are allocated resulting in faster rebalancing operatio
ns. This value is also used as the default when the POWER clause is omitted from
a rebalance operation.
ASM_DISKGROUPS - The list of disk groups that should be mounted by an ASM instan
ce during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM c
onfiguration changes are automatically reflected in this parameter.
ASM_DISKSTRING - Specifies a value that can be used to limit the disks considere
d for discovery. Altering the default value may improve the speed of disk group
mount time and the speed of adding a disk to a disk group. Changing the paramete
r to a value which prevents the discovery of already mounted disks results in an
error. The default value is NULL allowing all suitable disks to be considered.
Advantages of ASM in Oracle?
Provides automatic load balancing over all the available disks, thus reducing ho
t spots in the file system
Prevents fragmentation of disks, so you don't need to manually relocate data to
tune I/O performance
Adding disks is straight forward - ASM automatically performs online disk reorga
nization when you add or remove storage
Uses redundancy features available in intelligent storage arrays
The storage system can store all types of database files
Using disk group makes configuration easier, as files are placed into disk group
s
ASM provides stripping and mirroring (fine and coarse gain - see below)
ASM and non-ASM oracle files can coexist
Striping ASM spreads data evenly across all disks in a disk group to optimize perf
ormance and utilization. This even distribution of database files eliminates the
need for regular monitoring and I/O performance tuning.
For example, if there are six disks in a disk group, pieces of each ASM file are
written to all six disks. These pieces come in 1 MB chunks known as extents. Wh
en a database file is created, it is striped (divided into extents and distribut
ed) across the six disks, and allocated disk space on all six disks grows evenly
. When reading the file, file extents are read from all six disks in parallel, g
reatly increasing performance.

Mirroring ASM can increase availability by optionally mirroring any file. ASM mirr
ors at the file level, unlike operating system mirroring, which mirrors at the d
isk level. Mirroring means keeping redundant copies, or mirrored copies, of each
extent of the file, to help avoid data loss caused by disk failures. The mirror
ed copy of each file extent is always kept on a different disk from the original
copy. If a disk fails, ASM can continue to access affected files by accessing m
irrored copies on the surviving disks in the disk group.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and
3-way mirroring, where each file extent gets two mirrored copies.
Online storage reconfiguration and dynamic rebalancing ASM permits you to add or r
emove disks from your disk storage system while the database is operating. When
you add a disk, ASM automatically redistributes the data so that it is evenly sp
read across all disks in the disk group, including the new disk. This redistribu
tion is known as rebalancing. It is done in the background and with minimal impa
ct to database performance. When you request to remove a disk, ASM first rebalan
ces by evenly relocating all file extents from the disk being removed to the oth
er disks in the disk group.
Managed file creation
bling files stored in
lly assigns filenames
en they are no longer

and deletion ASM further reduces administration tasks by ena


ASM disk groups to be Oracle-managed files. ASM automatica
when files are created, and automatically deletes files wh
needed.

Why should we use 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 m
ultiple 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, et
c).
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 (see FRA).
Data with different storage characteristics should be stored in different disk g
roups. Each disk group can have different redundancy (mirroring) settings (high,
normal and external), different fail-groups, etc. However, it is generally not
necessary to create many disk groups with the same storage characteristics (i.e.
+DATA1, +DATA2, etc. all on the same type of disks).
To get started, create 2 disk groups - one for data and one for recovery files.
Here is an example:
CREATE DISKGROUP data
EXTERNAL REDUNDANCY DISK '/dev/d1', '/dev/d2', '/dev/d3
', ....;
CREATE DISKGROUP recover EXTERNAL REDUNDANCY DISK '/dev/d10', '/dev/d11', '/dev/
d12', ....;
Here is an example how you can enable automatic file management with such a setu
p:
ALTER SYSTEM SET db_create_file_dest

= '+DATA' SCOPE=SPFILE;

ALTER SYSTEM SET db_recovery_file_dest = '+RECOVER' SCOPE=SPFILE;


You may also decide to introduce additional disk groups - for example, if you de
cide to put historic data on low cost disks, or if you want ASM to mirror critic
al data across 2 storage cabinets.
What is ASM Rebalancing?
The rebalancing speed is controlled by the ASM_POWER_LIMIT initialization parame
ter. Setting it to 0 will disable disk rebalancing.
ALTER DISKGROUP data REBALANCE POWER 11;
What happens when an Oracle ASM diskgroup is created?
When an ASM diskgroup is created, a hierarchialfilesystem structure is created.
How does this filesystem structure appear?
Oracle ASM diskgroup'sfilesystem structure is similar to UNIX filesystem hierarc
hy or Windows filesystem hierarchy.
Where are the Oracle ASM files stored?
Oracle ASM files are stored within the Oracle ASM diskgroup. If we dig into inte
rnals, oracle ASM files are stored within the Oracle ASM filesystem structures.
How are the Oracle ASM files stored within the Oracle ASM filesystem structure?
Oralce ASM files are stored within the Oracle ASM filesystem structures as objec
ts that RDBMS instances/Oracle database instance access. RDBMS/Oracle instance t
reats the Oracle ASM files as standard filesystem files.
What are the Oracle ASM files that are stored within the Oracle ASM file hierarc
hy?
Files stored in Oracle ASM diskgroup/Oracl ASM filestructures include:
1) Datafile
2) Controlfiles
3) Server Parameter Files(SPFILE)
4) Redo Log files
What happens when you create a file/database file in ASM?What commands do you us
e to create database files?
Some common commands used for creating database files are :
1) Create tabespace
2) Add Datafile
3) Add Logfile
For example,
SQL> CREATE TABLESPACE TS1 DATAFILE '+DATA1' SIZE 10GB;
Above command creates a datafile in DATA1 diskgroup
How can you access a databasefile in ASM diskgroup under RDBMS?
Once the ASM file is created in ASM diskgroup, a filename is generated. This fil
e 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 as follows:
+diskgroup_name/database_name/database_file_type/tag_name.file_number.incarnatio
n
where,
+diskgroup_name - Name of the diskgroup that contains this file
database_name - Name of the database that contains this file
datafile - Can be one among 20 different ASM file types
tag_name - corresponds to tablespace name for datafiles, groupnumber for redo lo

g files
file_number - file_number in ASM instance is used to correlate filenames in data
base instance
incarnation_number - It is derived from the timestamp. IT is used to provide uni
queness
What is an incarnation number?
An incarnation number is a part of ASM filename syntax. It is derived from the t
imestamp. Once the file is created, its incarnation number doesnot change.
What is the use of an incarnation number in 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
ASM's SPFile will be residing inside ASM itself. This could be found out in numb
er of ways, looking at the alert log of ASM when ASM starts
Machine:
x86_64
Using parameter settings in server-side spfile +DATA/asm/asmparameterfile/regist
ry.253.766260991
System parameters with non-default values:
large_pool_size
= 12M
instance_type
= "asm"
remote_login_passwordfile= "EXCLUSIVE"
asm_diskgroups
= "FLASH"
asm_diskgroups
= "DATA"
asm_power_limit
= 1
diagnostic_dest
= "/opt/app/oracle"
Or using the asmcmd's spget command which shows the spfile location registered w
ith GnP profile
ASMCMD> spget
+DATA/asm/asmparameterfile/registry.253.766260991

Potrebbero piacerti anche