0% found this document useful (0 votes)
88 views10 pages

ASM (Automatic Storage Management)

- ASM (Automatic Storage Management) manages groups of disks called diskgroups and provides striping, mirroring, and automatic rebalancing of data. - An ASM instance is started which mounts the ASM diskgroups based on parameters in the ASMSPFILE. - Background processes like RBAL and ARBx perform rebalancing activities and coordinate the distribution of data across ASM disks. - Data is stored in ASM diskgroups which support different types of redundancy like normal, high, and external. Diskgroups can be managed and altered using SQL statements.

Uploaded by

krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views10 pages

ASM (Automatic Storage Management)

- ASM (Automatic Storage Management) manages groups of disks called diskgroups and provides striping, mirroring, and automatic rebalancing of data. - An ASM instance is started which mounts the ASM diskgroups based on parameters in the ASMSPFILE. - Background processes like RBAL and ARBx perform rebalancing activities and coordinate the distribution of data across ASM disks. - Data is stored in ASM diskgroups which support different types of redundancy like normal, high, and external. Diskgroups can be managed and altered using SQL statements.

Uploaded by

krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

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.

What is ASM INSTANCE?

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.

ASM BACKGROUN PROCESS?

ARBN,RBAL,ASMB
RBAL This opens all device files as part of discovery and coordinates the
rebalance activity.

RBAL - coordinates rebalance activity for disk groups

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?

Contiguous alloction units is called ASM Extent.

What is allocation unit (AU)?

it is specified the data unit size in diskgoup.parameter is au_size={1,2,4,8,16,32}

REDUNDENCY TYPES

1)EXTERNAL NORMAL: it is no mirroring in asm level.

2) NORMAL : it is two way mirroring. It have minimum 2 disks

3)HIGH REDUNDENCY : it is three way mirroring. It have minimum 3 disk

Provisioned, member, former, candidate, unknown

Asm alert LOGFILE Location:

$GRID_HOME/diag/asm/+asm/+ASM/trace/
ASM configuration file location?

The Oracle ASMLib configuration file is located at /etc/sysconfig/oracleasm, and this


file contains all the startup configuration that the system administrator originally
specified via the /etc/init.d/oracleasm configure command.
(http://www.dba-oracle.com/t_etc_sysconfig_oracleasm_scanorder_scanexclude.htm)

What is use of ASMLib?


ASMLib runs this scan every time it starts up.

HOW many ways start the ASM INSTANCE?

Three ways

ASMCMD: startup

Sqlplus / as sysasm

GUI (ASMCA)

How many ways to stop the ASM instance?

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)

How to take ASM METADATA BACKUP and restore?

Using md_backup

Restoring is md_restore

What are the store in ASM DISKGROUP?

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.

The advantages of ASM are

 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

INSTANCE_TYPE (INSTANCE NAME BASICALY DEFINED BY + SIGN)


ASM_DISKGROUP (DISK GROUP INFORMATION IN ASM)
ASM_DISKSTRING (DISK GROUP PATH IS DIFFEND BY asm)
ASM_POWER_LIMIT(1 T0 11, IN 11GR2 1 TO 1024)

STARUP OF ASM TYPES

NOMOUNT(START THE ASM INSTANCE WITH OUT MOUNT THE DISKGROUP)


MOUNT( START THE ASM ISTANCE AND MOUNT THE DISKGOUP WHICH ARE MENTION IN
THE ASM DISK_GROUP PARAMETER)
OPEN ( ASM ISNTANCE NOT OPEN)
FORCE ( PERFOMANCE A SHUTDOWN ABORT BEFORE RESTAARTING ASM INSTANCEE)
Shutdown of ASM Instances

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

SQL> CREATE DISKGROUP dg_asm_data NORMAL REDUNDANCY


FAILGROUP failure_group_1 DISK
'/devices/diska1' NAME diska1, '/devices/diska2' NAME diska2,
FAILGROUP failure_group_2 DISK
'/devices/diskb1' NAME diskb1, '/devices/diskb2' NAME diskb2;

For two-way mirroring we would expect a diskgroup to contain two failure groups, so
individual files are written to two locations.

SQL> CREATE DISKGROUP dg_asm_fra HIGH REDUNDANCY


FAILGROUP failure_group_1 DISK
'/devices/diska1' NAME diska1, '/devices/diska2' NAME diska2,
FAILGROUP failure_group_2 DISK
'/devices/diskb1' NAME diskb1, '/devices/diskb2' NAME diskb2,
FAILGROUP failure_group_3 DISK
'/devices/diskc1' NAME diskc1, '/devices/diskc2' NAME diskc2;

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

SQL> CREATE DISKGROUP dg1 DISK '/dev/raw/*'


ATTRIBUTE 'compatible.rdbms' = '11.1', 'compatible.asm' = '11.1'; (11g R1 command)

SQL> CREATE DISKGROUP dg2 EXTERNAL REDUNDANCY


DISK '/dev/sde1' ATRRIBUTE 'au_size' = '32M'; (11g R1 command)

SQL> CREATE DISKGROUP archdg NORMAL REDUNDANCY


FAILGROUP fg1 DISK
'/devices/diska1','/devices/diska2','/devices/diska3','/devices/diska4'
FAILGROUP fg2 DISK
'/devices/diskb1','/devices/diskb2','/devices/diskb3','/devices/diskb4'
ATTRIBUTE
'au_size'='4M','compatible.asm'='11.2','compatible.rdbms'='11.2','compatible.advm'='11.2';
(11g R2command)

LIST DISK GROUP

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

SQL> SELECT * FROM V$ASM_CLIENT;


ASMCMD: lsct

Dropping disks

SQL> ALTER DISKGROUP dg4 DROP DISK diska4;

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;

Resizing all disks in a failure group


SQL> ALTER DISKGROUP dg_data_1 RESIZE DISKS IN FAILGROUP fg_1 SIZE 50G;

Resizing all disks in a diskgroup


SQL> ALTER DISKGROUP dg_data_1 RESIZE ALL SIZE 100G;

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

SQL> ALTER DISKGROUP data ONLINE DISK 'disk_0000', 'disk_0001';


SQL> ALTER DISKGROUP data ONLINE DISKS IN FAILGROUP 'fg_99';
SQL> ALTER DISKGROUP data ONLINE ALL;

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.

SQL> ALTER DISKGROUP ALL MOUNT;


SQL> ALTER DISKGROUP dg_data2 MOUNT;
SQL> ALTER DISKGROUP dg_data2 MOUNT RESTRICTED; (11gR1 command)

ASMCMD: mount

Changing attributes

SQL> ALTER DISKGROUP data3 SET ATTRIBUTE 'compatible.rdbms' = '11.1';


(11gR1 command)
SQL> ALTER DISKGROUP data3 SET ATTRIBUTE 'compatible.asm' = '11.2';
(11gR1 command)
SQL> ALTER DISKGROUP data3 SET ATTRIBUTE 'disk_repair_time' = '4.5h';
(11gR1 command)

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.

ASMCMD> lsattr -l -G DG_ASM_FRA


ASMCMD>setattr –G <diskgroup> compatible.rdbms 11.2.0.0

SQL Equivalent

SQL> SELECT * FROM V$ASM_ATTRIBUTE;

Rebalancing

SQL> ALTER DISKGROUP diskgroup_name REBALANCE POWER n;


ASMCMD : rebal [--power power_value] [-w] diskgroup

ASMCMD: lsop
IO statistics of a diskgroup

Sql: select * from v$asm_disk_iostat

ASMCMD: iostat [-etH] [--io] [--region] [-G diskgroup] [interval]

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

You might also like