AUTOMATIC STORAGE MANAGEMENT (ASM)
List Key benefits of ASM
1. Stripes files rather than logical volumes
2. Provides redundancy on a file basis
3. Enables online disk reconfiguration and dynamic rebalancing
4. Reduces the time significantly to resynchronize a transient failure by tracking changes while disk is offline
5. Provides adjustable rebalancing speed
6. Is cluster-aware
7. Supports reading from mirrored copy instead of primary copy for extended clusters
8. Is automatically installed as part of the GI.
ASM Parameters
CLUSTER_DATABASE: Required setting for RAC deployments is “TRUE”.
INSTANCE_TYPE: ASM.
ASM_DISKSTRING: This parameter specifies a set of disk locations used by Oracle during disk discovery. When a new disk is added to a disk group, the ASM instance
discovers the new disk by searching in the directories specified by this parameter.The default value is NULL. When using ASMLib, you don’t need to change the
parameter as the disk discovery string is set correctly and uses “ORCL:*”. You need to change the parameter only when you are using udev or device mapper multipathing for ASM disks.
ASM_PREFERRED_READ_FAILURE_GROUPS: The preferred mirror read feature first appeared in Oracle 11.1. Mainly useful for extended distance clusters where it can help reducing latency.
ASM_POWER_LIMIT: When disks are added to or removed from disk groups, ASM moves file extents between disks to balance I/O equally between all disks in the group. The asm_power_limit parameter determines how aggressively the rebalancing operation is performed. The parameter takes a numeric value ranging from 1 (slowest) to 11 (fastest).
ASM_DISKGROUPS: The asm_diskgroups parameter is dynamic and updated when a disk group is created, dropped, or mounted. The mount operation does not
have to be executed within ASM, but can also be initiated by srvctl start diskgroup -g DG_Name. The disk groups specified in the asm_diskgroups parameter will automatically be mounted when the ASM instance starts.
How to copy file to/from ASM from/to filesystem?
By using ASMCMD cp command
Background Processes
RBAL The ASM rebalance master background process coordinates disk rebalancing activity. It also exists in RDBMS instances.
ASMB The ASM Background process is used for interactions between the CSS daemon, mainly during the initial connection to the ASM instance and a heartbeat
mechanism.
GMON The disk group monitor process manages disk group compatibility and monitors disk groups for offline disks in DGs. If it finds offline disks in a DG, it will create up to five slave processes (Bnnn) to keep track of the time
it was offline. If the offline disk can be brought online within the specified disk repair time, it can be prevented from being dropped. The Disk Resynchronization
Slave processes (DRnn) are responsible for resynchronizing the previously offline disk. Another background process, “MARK,” keeps track of extents in need for resynchronization. This process is started in the RDBMS instance.
ARBn The ASM rebalancing slave processes perform the actual rebalancing by moving data extents between disks. When completed, the Disk Expel Slave processes (Xnnn) will remove dropped disks from a disk group.
Metadata operations are handled by the Onnn and OCFn background processes.
Redundancy
ASM supports 3 types of redundancy for ASM DGs:
External redundancy does not involve any mirroring. It uses the existing operating system or storage array protection, such as RAID or LVMs.
Normal redundancy, which is the default, implements two-way mirroring, in which each file extent will be written to two disk groups using one primary extent
and one mirrored extent. To guarantee redundancy, you must define at least two failure groups.
High redundancy implements three-way mirroring, in which each file extent will be written to three disk groups using one primary extent and two mirrored extents. To guarantee redundancy, you must define at least three failure groups.
Migrating to new Disk Group scenario’s
a. Case 1: Migrating disk group from one storage to other with same name
1. Consider the disk group is DATA,
2. Create new disks in DATA pointing towards the new storage (EMC),
a) Partioning provisioning done by storage and they give you the device name
3. Add the new disk to diskgroup DATA
a) Alter diskgroup data add disk '/dev/mapper/asakljdlas'
3. Drop the old disks from DATA with which rebalancing is done automatically.
If you want you can the rebalance by alter system set asm_power_limit =12 for full throttle
alter diskgroup data drop disk 'path to hitachi storage'
Note: you can get the device name in v$asm_disk in path column.
4. Request SAN team to detach the old Storage (HITACHI).
b. Case 2: Migrating disk group from one to another with different diskgroup name.
1) Create the Disk group with new name in the new storage.
2) Create the spfile in new DG and change the parameter scope = spfile for control files etc.
3) Take a control file backup in format +newdiskgroup
4) Shutdown the db, startup nomount the database
5) Restore the control file from backup (now the control will restore to new diskgroup
6) Take the RMAN backup as copy of all the databases with new format.
RMAN> backup database as copy format '+newdiskgroup name' ;
3) RMAN> Switch database to copy.
4) Verify dba_data_files,dba_temp_files, v$log that all files are pointing to new DG.
There are seven new v$ views provided in Oracle Database to monitor ASM structures.
v$asm_diskgroup: Describes a disk group (number, name, size related info, state, and redundancy type) Contains one row for every open ASM disk in the DB instance.
asmcmd>lsdg
v$asm_client: Identifies databases using disk groups managed by the ASM instance. Contains no rows.
asmcmd >lsct: Lists information about current Oracle ASM clients.
select group_number, instance_name, db_name, status, software_version, from gv$asm_client v$asm_disk: Contains one row for every disk discovered by the ASM instance, including disks that are not part of any disk group. Contains rows only for disks in the disk groups in use by that DB instance.
header_status : Former, Candidate, Member
v$asm_file: Contains one row for every ASM file in every disk group mounted by the ASM instance. Contains rows only for files that are currently open in the DB instance.
v$asm_template: Contains one row for every template present in every disk group mounted by the ASM instance.
v$asm_alias: Contains one row for every alias present in every disk group mounted by the ASM instance. v$asm_operation: Contains one row for every active ASM long running operation executing in the ASM instance.
How to find out the databases, which are using the ASM instance?
ASMCMD> lsct
DB_Name Status Software_Version Compatible_version Instance_Name Disk_Group
amxdcmp1 CONNECTED 11.2.0.2.0 11.2.0.2.0 amxdcmp1 DG1_DCM_DATA
amxddip1 CONNECTED 11.2.0.2.0 11.2.0.2.0 amxddip1 DG1_DDI_DATA
(or)
SQL> select DB_NAME from V$ASM_CLIENT;
What is allocation unit and what is default value of au_size and how to change?
Every ASM disk is divided into allocation units (AU).
An AU is the fundamental unit of allocation within a disk group.
A file extent consists of one or more AU. An ASM file consists of one or more file extents.
CREATE DISKGROUP disk_group_2 EXTERNAL REDUNDANCY DISK '/dev/sde1' ATRRIBUTE 'au_size' = '32M';
What process does the rebalancing?
RBAL, ARBn
No comments:
Post a Comment