ASM (Automatic Storage Management)
ASM (Automatic Storage Management)
1. What is ASM?
2. What is ASM INSTANCE?
3. What are the background process in ASM and what is use?
4. What is extent in ASM?
5. What is difference between ASM and normal storage?
6. How to configure ASM?
7. How many type of redundancy and how many disk are there?
8. How to start the ASM?
9. How to shut down the ASM INSTANCE and what is the process?
10. What are the parameter in ASMSPFILE and uses each parameter?
11. What is failure group, striping and rebalance?
12. What is AU(allocation UNIT) and max value?
13. What are disk group status in ASM DISKS?
14. How to create ASM disk group and add/remove disk in DISKGROUP?
15. How to check ASM version? V$asm_client
16. How to check the ASM disk group information?
17. How check the rebalance activity operations?
18. How to disable/enable the rebalance on disk groups?
19. If ASM disk not showing in system.what is the issue and how to resolve the issue?
20. Where is the ASM disk alter logfile store?
21. How to mount/dismount the ASM DISKGROPS?
22. How to check the ASM Clients information?
23. How to check ASM space information?
24. How to check the asm mirror copy size (or) required ASMdisk for mirroring?
25. I will store 3GB data in asm normal redundancy. How will store the data in ASM Normal
RDUNDENCY?
26. if OS is corrupted what about DATA in ASM?
27. If lose lunes from storeage team u will lose u r data?
28. What is are the attribute in ASM and how to find out?
29. What are the store in ASM DISKGROUP?
30. How many disk to add disk group and how many disk group for one asm instance? 63
dg,10000disks
31. How to check the ASM statistics?
32. Where is the ASM configuration information?
33. If u plane to patch the database what will check first?
34. How to take the asm meta data backup?
35.
What is ASM?
ASM stands for automatic storage management it is have own instance, process and spfile.it is integrity
and high-performance database file system.it is maintain thousands of file in asm diskgroup.it provides
striping ,mirroring and disk level rebalance activity across the disk group.
ASM INSTANCE is a instance it start the SGA and BACK ground process and try to mount the asm disk
group depending on the asm parameters. Its only instance and the status of asm is STARTED only in
v$instance.
ARBN,RBAL,ASMB
RBAL This opens all device files as part of discovery and coordinates the
rebalance activity.
ARBx - Actual Rebalancer: They perform the actual rebalancing activities. The number of ARBx processes depends
on the ASM_POWER_LIMIT init parameter.
ASMB - ASM Bridge: This process is used to provide information to and from the Cluster Synchronization Service
(CSS) used by ASM to manage the disk resources. It is also used to update statistics and provide a heartbeat
mechanism.
What is striping?
Share the data across asmdisks in diskgroup using small extents. (Or)
Share equal amount of small data extents on disks across the diskgroup.
What is EXTENT?
REDUNDENCY TYPES
$GRID_HOME/diag/asm/+asm/+ASM/trace/
ASM configuration file location?
Three ways
ASMCMD: startup
Sqlplus / as sysasm
GUI (ASMCA)
Three ways
ASMCMD: shutdown
Sqlplus / as sysasm
Sql>shut immediate (if u shut immediate command fire to sql promt at the time database instance not
connect to the database.if connected the command is through error)
GUI (ASMCA)
Using md_backup
Restoring is md_restore
o Datafiles
o Control files
o Online redo logs
o Archive logs
o Flashback logs
o SPFILEs
o RMAN backups
o Temporary datafiles
o Datafile copies
o Disaster recovery configurations
o Change tracking bitmaps
o Datapump dumpsets
ASM Summary :
Manages group of disks, called diskgroups. Must be careful while choosing disks for a
diskgroup.
Manages disk redundancy within a diskgroup.
Provides near-optimal I/O balancing without any manual tuning.
Enables management of database objects without specifying mount points and
filenames.
Supports large files.
Replacement for CFS (Cluster File System).
Also useful for Non-RAC databases.
A new instance type - ASM is introduced in 10g.
ASM instance has no data dictionary.
A Disk can be a partial, full or a LUN from the RG.
I/O is spread evenly across all disks of a diskgroup.
Disks can be dynamically added to any diskgroup.
When combined with OMF increases manageability.
ASM cannot maintain empty directories “delete input” has issues, create a dummy
directory.
Use of ASM diskgroup is very simple create tablespace.
Enterprise Manager can also be used for administering diskgroups.
Only RMAN can be used with ASM.
Disk Addition - Adding a disk is very easy. No downtime is required and file extents
are redistributed automatically.
I/O Distribution - I/O is spread over all the available disks automatically, without
manual intervention, reducing chances of a hot spot.
Stripe Width - Striping can be fine grained as in redolog files (128K for faster
transfer rate) and coarse for datafiles (1MB for transfer of a large number of blocks at one
time).
Mirroring - Software mirroring can be set up easily, if hardware mirroring is
not available.
Buffering - The ASM file system is not buffered, making it direct I/O capable by
design.
Kernelized Asynchronous I/O - There is no special setup necessary to enable
kernelized asynchronous I/O, without using raw or third-party file systems such as Veritas
Quick I/O.
ASM PARAMETERS
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.
Creating diskgroups
For two-way mirroring we would expect a diskgroup to contain two failure groups, so
individual files are written to two locations.
For three-way mirroring we would expect a diskgroup to contain three failure groups, so
individual files are written to three locations.
SQL> CREATE DISKGROUP dg_grp1 EXTERNAL REDUNDANCY
DISK '/dev/d1','/dev/d2','/dev/d3','/dev/d4' ... ...;
CHANGE ATTRIBUTE
Select * from
v$asm_diskgroup(name,total_mb,free_mb,state,required_mirror_free_mb,
Select * from v$asm_diskgroup_stat(asm disk group statistics)
ASMCMD:lsdg –GH <diskgroup name>
Dropping diskgroups
Diskgroups can be deleted using the DROP DISKGROUP statement.
SQL> DROP DISKGROUP disk_group_1 INCLUDING CONTENTS;
SQL> DROP DISKGROUP disk_group_1 FORCE; (11g R1 command)
SQL> DROP DISKGROUP disk_group_1 FORCE INCLUDING CONTENTS; (11gR1 command)
Altering diskgroups
Adding disks
We may have to add additional disks into the diskgroup to accommodate growing demand.
SQL> ALTER DISKGROUP dskgrp1 ADD DISK '/dev/d5';
SQL> ALTER DISKGROUP dg1 ADD DISK '/devices/disk*3', '/devices/disk*4';
Listing disks
Dropping disks
ASMCMD: chdg
Resizing disks
Disks can be resized using the RESIZE clause of the ALTER DISKGROUP statement. The
statement can be used to resize individual disks, all disks in a failure group or all disks in
the diskgroup. If the SIZE clause is omitted the disks are resized to the size of the disk
returned by the OS.
SQL> ALTER DISKGROUP dg_data_1 RESIZE DISK diska1 SIZE 150G;
Undropping disks
The UNDROP DISKS clause of the ALTER DISKGROUP statement allows pending disk drops
to be undone. It will not revert drops that have completed, or disk drops associated with the
dropping of a diskgroup.
SQL> ALTER DISKGROUP disk_group_1 UNDROP DISKS;
Online disks
ASMCMD : online
Offline disks
SQL> ALTER DISKGROUP data OFFLINE DISK 'disk_0000', 'disk_0001';
SQL> ALTER DISKGROUP data OFFLINE DISKS IN FAILGROUP 'fg_99';
SQL> ALTER DISKGROUP data OFFLINE DISK d1_0001 DROP AFTER 30m;
ASMCMD:offline
Mounting diskgroups
Diskgroups are mounted at ASM instance startup and unmounted at ASM instance
shutdown. Manual mounting and dismounting can be accomplished using the ALTER
DISKGROUP statement as below.
ASMCMD: mount
Changing attributes
ASMCMD:lsattr
lsattr command
List attributes of a diskgroup, from V$ASM_ATTRIBUTE.
lsattr [-G diskgroup] [-Hlm] [pattern]
Flag Description
-G Diskgroup name.
-H Suppresses column headings.
-l Display names with values.
-m Displays additional information, such as the RO and Sys columns.
pattern Display the attributes that contain pattern expression.
SQL Equivalent
Rebalancing
ASMCMD: lsop
IO statistics of a diskgroup
Flag Description
-e Displays error statistics (Read_Err, Write_Err).
-t Displays time statistics (Read_Time, Write_Time).
-H Suppresses column headings.
--io Displays information in number of I/Os, instead of bytes.
-- Displays information for cold and hot disk regions (Cold_Reads, Cold_Writes,
region Hot_Reads, Hot_Writes).
-G Displays statistics for the diskgroup name.
Refreshes the statistics display based on the interval value (seconds). Use Ctrl-C to
interval
stop the interval displ