[go: up one dir, main page]

0% found this document useful (0 votes)
53 views7 pages

Automatic Storage Management: Why ASM ?

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 7

AUTOMATIC STORAGE MANAGEMENT

1. It was introduce in 10g, prior to 10g don’t have ASM.


2. ASM is providing storage solution, most of production database use ASM. It’s an very powerful
tool.

Why ASM ?

1. Storage should offer me – file bigger than disk.


In SOHO we typically use DISK as a DISK or We partition the DISK and then use a partition as
DISK, but the biggest limitation as this kind of is the file we put on that disk are limited to the
size of disk or partition as of disk. So file is bigger than disk is not possible.
Implement either or via RAID level 0 or Volume Manager

2. IO Throughput should be best


When we used disk as a disk or when we create the partition on disk, you keep multiple file on
the partition. Since there only one read/write controller or one disk cache available when you
perform IO operation. The IO operation is constraint by the capacity of the disk so you don’t get
the best IO throughput available when you start disk as a disk and partition as a disk.
3. Disk Fault Tolerance for critical data
Disk fault tolerance we don’t get in small office or home office kind of environment. Assume
that we had disk which we formatted, accessing and its get failed. So there is no online
resilience available for such loss of critical data. So whatever on that disk is everything loss
4. Clustered Environment
Cluster file give you ease of performing in daily operation. In cluster environment two or more
node sharing the same shared storage devices. If you don’t have clustered environment then
only choice is raw devices but the biggest problem in raw devices is there is high admin cost and
explicit planning is required. RAW device can store only one file so the estimation of your future
requirement should be explicitly state and there should be proper planning process. Suppose
you allocated 10 gb of raw partition on raw device and your file never grown beyond 2 gb so rest
of the 8 gb space can not reclaimed back it all wastage.
5. IO Load Balancing
IO load balancing is an activity driven by personnel. Suppose you have four different disk and
place some n number of file on all disk. So some of the disk are experiencing high IO and other
are sitting idle. So in this situation we moved some file from busy disk to IO disk which is the
manual activity. So somebody gives you the statistics that one disk is utilizing more than user
we normally monitor those disk using iostat unix command. Si IO load balancing acivity required
dba intervention to relocate the file due to this maintenance cost is high
/u01 -
/u02 –
/u03 –
/u04 -
AUTOMATIC STORAGE MANAGEMENT
Disk In linux

When you attached disk in linux. Linux has a long deprecated

Block => /dev/sd<x> x could be a,b,c,d,e,f

There no raw device name assign by linux because raw is deprecated from linux kernel.

ASM Disk Group

Mutliple Raw Devices ASM disk group

ASM disk group is collection or multiple raw devices. This disk group is managed by ASM instance.
Instance is a collection of memory and background processes.

Files

20 GB 20 GB 20 GB

When we store file on ASM disk group the files are stripped and those stripped are spread across each
participating disk in the ASM disk group. The files is divided into multiple pieces and those pieces are
stored evenly in participating disk. Assume that you are doing the full read of entire file it will get the
read from all disks so IO throughput is good where in traditional way multiple file stored on single disk
so there is IO throughput is not good.
AUTOMATIC STORAGE MANAGEMENT
Volume Management

Disk

Phy.vol (PV)

Volume Group (VG)

/u01 /u02 Logical Volume (LV)

Once you mounted logical volume, when you kept file on /u01 around 60 gb and each disk size is 25 gb

Then total space available in VG is 100 gb and when you store file of 60 gb data is stripped on stored on
each of physical volume is nothing just representation of actual disks. So this is the benefit of volume
management that data is spread across different disks.

Whatever you store on ASM disk group is stripped. Each piece of storage allocation unit in ASM disk
group is call AU (Allocation Unit)

Datafiles – For datafiles ASM apply coarse stripping method means each AU is 1 MB. If we store data file
of 100 MB file on ASM disk group which has 3 raw devices 100 pieces of 1 MB each are spread across are
evenly in the participating disk of the ASM disk group.

Control files / Redo log files - Each AU is of 128 KB and such method is called as Fine Stripping

1 MB AU 1 MB AU 1 MB AU

AUAU
20 GB 128 KB 20 GB
128 KB 20 GB 128 KB
AUTOMATIC STORAGE MANAGEMENT

If one of the disk get failed and if you not divided your disk group into subgroup then entire disk grop
get failed. If disk group is not divided into further disk group is called as EXTERNAL REDUDENCY.

High REDUDENCY (1 Master copy and 2Mirror Copy)

In high reududency if one disk get failed then entire disk not get failed.

NORMAL REDUDENCY

If you have 2 failure group is called normal redundancy. (1 Master copy and 1Mirror Copy)

ASM INSTANCE
Parameter file – init_ASM.ora or spfile+ASM.ora

Instance _type=ASM

ASM_power_limit= 0 to 10

Asm_diskgroup= datadg, logdg ,archdg

Asm_diskstring=’/dev/raw/raw’ linux =’/dev/raw’

Large_pool_size=12 MB to 24 MB

Instance_name=+ASM
AUTOMATIC STORAGE MANAGEMENT
ASM instance doesn’t have control file, datafile,redo log file. So ASM instance can go only mount state.

ASM instance has SYS users, ASM instance SYS user is password file authentication so the only way to
change the password for SYS user delete you existing password file and recreate it using orapwd
command

ASM METHODS

For Linux platform (where RAW devices are deprecated)

a. Create/identify/set up block device


b. Install asmlib software
c. Install asm software
d. Create asm instance
e. Create asm disk group using block device
f. Start using asm disk group

Creation of ASM Instance


1. Need to create the ORACLE_SID for Asm instance in oracle home directory under database
folder.
Database > set ORACLE_SID=+ASM
2. Now need to create parameter file ASM
Database> edit init+ASM.ora
And edit in the file instance_type=asm . Save the file and close
You can cross verify the file using below query
Database > type init_ASM.ora
3. Now create the service for asm instance
Database > oradim –new –sid +ASM
This will automatically start the service
4. Now create the directory and check newly created directory
Database > mkdir c:\asmdisks
Database > dir c:\asmdisks
5. Run the below command
Database > asmtool –create c:\asmdisks1.asm 300
6. Move the asmdisks1 to newly created directory
Database > move c:\asmdisks1.asm c:\asmdisks\asmdisks1.asm
7. Now create two more and move and check the file in the directory
Database > asmtool –create c:\asmdisks2.asm 300
Database > asmtool –create c:\asmdisks3.asm 300
Database > move c:\asmdisks1.asm c:\asmdisks\asmdisks2.asm
AUTOMATIC STORAGE MANAGEMENT
Database > move c:\asmdisks1.asm c:\asmdisks\asmdisks3.asm
8. Go to the inti file and add asm diskstring value
Database> edit init+ASM.ora
ASM_DISKSTRING = ’c:\asmdisk\*’
_ASM_ALLOW_ONLY_RAW_DISKS =FALSE
9. Login as sysdba and start the instance
Sql > startup
It will show asm instance started and ORA : 15110 no diskgroup mounted.
10. Now check the location and status of mount using below query.
Sql > select path,mount_status from v$asm_disk;
It show the status as CLOSED which means not mounted and not in use.
11. Now mount them in diskgroup.
Sql > create diskgroup dggroup1 normal redundancy dis
‘c:\asmdisks\asmdisks1.asm’
‘c”\asmdisks\asmdisks2.asm’;
12. Once diskgroup created then shutdown the asm instance and again start
Sql > shutdown
Sql > startup
13. Still it will show diskgroup is not mounted but we mounted it. Go to the init file and add
asm_diskgroup parameter with appropriate values.
Database > edit init+ASM.ora
ASM_DISKGROUPS=’dgroup1’
Save and exit. Next shutdown the instance and start again.
Sql > select name, state, total_mb from V$asm_diskgroup;

How to add a disk to a diskgroup in Oracle ASM

1. Set the ASM instance and login as sysdba


2. Check the name and path of the asm diskgroup
Sql > select name, path from v$asm_disk;
3. Check the size of the diskgroup
Sql > select name, total_mb from v$asm_diskgroup;
4. Now add the disk in the diskgroup.
Sql > alter diskgroup dgroup1 add disk ‘c:\asmdisks\asmdisks3.asm’;
5. Now check the size of diskgroup whether increased or not if increased disk is added to diskgroup
Sql > select name, total_mb from v$asm_diskgroup;

How to drop a disk from a diskgroup in Oracle ASM

1. We have director in which there are 3 disk in the dgroup (c:\asmdisks)


2. Connect to asm instance and login as sysdba
AUTOMATIC STORAGE MANAGEMENT
3. Execute the below query, note down the name and remove it
Sql > select name, path from v$asm_disk;
Sql > alter diskgroup dgroup1 drop disk dgroup1_0002

How to convert a cooked filesystem Oracle database to ASM

You might also like