What are different types of redundancies in ASM & explain?
When you will use external redundancy and what are the advantages of it?
How to copy file to/from ASM from/to filesystem?
By using ASMCMD cp command
How to find out the databases, which are using the ASM instance?
ASMCMD> lsct
SQL> select DB_NAME from V$ASM_CLIENT;
What is Automatic Storage Management (ASM)?
Automatic Storage Management (ASM) is a new feature that has be introduced in Oracle 10g to simplify the storage of Oracle datafiles, controlfiles and logfiles.Automatic Storage Management (ASM) is an integrated file system and volume manager expressly built for Oracle database files.An Oracle ASM instance is built on the same technology as an Oracle Database instance. An Oracle ASM instance has a System Global Area (SGA) and background processes that are similar to those of Oracle Database. However, because Oracle ASM performs fewer tasks than a database, an Oracle ASM SGA is much smaller than a database SGA. In addition, Oracle ASM has a minimal performance effect on a server. Oracle ASM instances mount disk groups to make Oracle ASM files available to database instances; Oracle ASM instances do not mount databases.
What are ASM Background Processes in Oracle?
ASMB – Oracle background process. In an DB instance, keeps a (bequeath) persistent DB connection to the local ASM instance. Provides heart-beat and ASM statistics. During a diskgroups rebalancing operation ASM communicates to the DB AU changes via this connection.
RBAL – Re-Balance - RBAL is the ASM related process that performs rebalancing of disk resources controlled by ASM. In a DB instance, opens and mount diskgroups from the local ASM instance.
ARBx – Actual Rebalance - ARBx is configured by ASM_POWER_LIMIT, a slave for rebalancing operations.
PSPx – Oracle backgroud processes. In an ASM instance, Process Spawners
GMON – Oracle backgroud processes. In an ASM instance, diskgroup monitor.
O00x – Oracle backgroud processes. Slaves used to connected from the DB to the ASM instance for ‘short operations’.
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 defaults 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 instance. 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 operations. 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 instance during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM configuration changes are automatically reflected in this parameter.
ASM_DISKSTRING – Specifies a value that can be used to limit the disks considered 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 parameter 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.
What is ASM Disks ?The physical disks are known as ASM disks, while the files that reside on the disks are know as ASM files.The disks in a disk group are referred to as ASM disks. On Windows operating systems, an ASM disk is always a partition.
When an ASM instance starts, it automatically discovers all available ASM disks.Discovery is the process of determining every disk device to which the ASM instance has been given I/O permissions (by some operating system mechanism), and of examining the contents of the first block of such disks to see if they are recognized as belonging to a disk group. ASM discovers disks in the paths that are listed in an initialization parameter, or if the parameter is NULL, in an operating system–dependent default path.
What is ASM diskgroups?
The primary component of ASM is the disk group. A disk group consists of a grouping of disks that are managed together as a unit.
What is Failure groups?
They 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 failure groups so individual files are written to two locations.
A Failure Group is a subset of the disks in a Diskgroup, which could fail at the same time because they
share a common piece of hardware. The failure of that common piece of hardware must be tolerated.
**A Failure Group is a subset of the disks in a Diskgroup.They are defined within a disk group to support the required level of redundancy.Failure Groups are used to place mirror copies of data.
Failure groups are used to determine which ASM disks to use for storing redundant copies of data. For example, if 2-way mirroring is specified for a file, ASM automatically stores redundant copies of file extents in separate failure groups. Failure groups apply only to normal and high redundancy disk groups. You define the failure groups in a disk group when you create or alter the disk group.
What is stripping and mirroring?
Striping is spreading data across multiple disks so that IO is spread across multiple disks and hence increase in throughput. It provides read/write performance but fail over support.
ASM offers two types of striping, with the choice depending on the type of database file. Coarse striping uses a stripe size of 1MB, and you can use coarse striping for every file in your database, except for the control files, online redo log files, and flashback files. Fine striping uses a stripe size of 128KB. You can use fine striping for control files, online redo log files, and flashback files.
Mirroring means redundancy. It may add performance benefit for read operations but overhead for write operations. It’s basic purpose is to provide fail over support.
If you specify mirroring for a file, then Oracle ASM automatically stores redundant copies of the file extents in separate failure groups.
There are three ASM mirroring options/There are three types of ASM disk groups:
High Redundancy – In this configuration, for each primary extent, there are two mirrored extents. For Oracle Database Appliance this means, during normal operations there would be three extents (one primary and two secondary) containing the same data, thus providing “high” level of protection. Since ASM distributes the partnering extents in a way that prevents all extents to be unable due to a component failure in the IO path, this configuration can sustain at least two simultaneous disk failures on Oracle Database Appliance (which should be rare but is possible).
******
Oracle ASM provides triple mirroring by default. A loss of two Oracle ASM disks in different failure groups is tolerated.
A high redundancy disk group can tolerate the failure of two failure groups. If one or two failure groups fail, the disk group remains mounted and serviceable, and ASM performs a rebalance of the surviving disks to restore redundancy for the data in the failed disks. If more than two failure groups fail, ASM dismounts the disk group.
Normal Redundancy – In this configuration, for each primary extent, there is one mirrored (secondary) extent. This configuration protects against at least one disk failure. Note that in the event a disk fails in this configuration, although there is typically no outage or data loss, the system operates in a vulnerable state, should a second disk fail while the old failed disk replacement has not completed. Many Oracle Database Appliance customers thus prefer the High Redundancy configuration to mitigate the lack of additional protection during this time.
**********
Oracle ASM provides two-way mirroring by default, which means that all files are mirrored so that there are two copies of every extentOpens a new window. A loss of one Oracle ASM disk is tolerated. You can optionally choose three-way or unprotected mirroring.
A file specified with HIGH redundancy (three-way mirroring) in a NORMAL redundancy disk group provides additional protection from a bad disk sector, not protection from a disk failure.
A normal redundancy disk group can tolerate the failure of one failure group. If only one failure group fails, the disk group remains mounted and serviceable, and ASM performs a rebalance of the surviving disks (including the surviving disks in the failed failure group) to restore redundancy for the data in the failed disks. If more than one failure group fails, ASM dismounts the disk group.
External Redundancy – In this configuration there are only primary extents and no mirrored extents. This option is typically used in traditional non-appliance environments when the storage sub-system may have existing redundancy such as hardware mirroring or other types of third-party mirroring in place. Oracle Database Appliance does not support External Redundancy.8. What is a diskgroup?
A disk group consists of multiple disks and is the fundamental object that ASM manages. Each disk group contains the metadata that is required for the management of space in the disk group. The ASM instance manages the metadata about the files in a Disk Group in the same way that a file system manages metadata about its files. However, the vast majority of I/O operations do not pass through the ASM instance. In a moment we will look at how file
I/O works with respect to the ASM instance.
*****
Oracle ASM does not provide mirroring redundancy and relies on the storage system to provide RAID functionality. Any write error causes a forced dismount of the disk group. All disks must be located to successfully mount the disk group.
An external redundancy disk group cannot tolerate the failure of any disks in the disk group. Any kind of disk failure causes ASM to dismount the disk group.
What are different types of redundancies in ASM & explain?
* Normal redundancy
* High redundancy
* External redundancy
The redundancy level controls how many disk failures are tolerated without dismounting the disk group or losing data.
External redundancy
Oracle ASM does not provide mirroring redundancy and relies on the storage system to provide RAID functionality. Any write error causes a forced dismount of the disk group. All disks must be located to successfully mount the disk group.
An external redundancy disk group cannot tolerate the failure of any disks in the disk group. Any kind of disk failure causes ASM to dismount the disk group.
Normal redundancy
Oracle ASM provides two-way mirroring by default, which means that all files are mirrored so that there are two copies of every extentOpens a new window. A loss of one Oracle ASM disk is tolerated. You can optionally choose three-way or unprotected mirroring.
A file specified with HIGH redundancy (three-way mirroring) in a NORMAL redundancy disk group provides additional protection from a bad disk sector, not protection from a disk failure.
A normal redundancy disk group can tolerate the failure of one failure group. If only one failure group fails, the disk group remains mounted and serviceable, and ASM performs a rebalance of the surviving disks (including the surviving disks in the failed failure group) to restore redundancy for the data in the failed disks. If more than one failure group fails, ASM dismounts the disk group.
High redundancy
Oracle ASM provides triple mirroring by default. A loss of two Oracle ASM disks in different failure groups is tolerated.
A high redundancy disk group can tolerate the failure of two failure groups. If one or two failure groups fail, the disk group remains mounted and serviceable, and ASM performs a rebalance of the surviving disks to restore redundancy for the data in the failed disks. If more than two failure groups fail, ASM dismounts the disk group.
******
Normal redundancy - for 2-way mirroring, requiring two failure groups, when ASM allocates an extent for a normal redundancy file, ASM allocates a primary copy and a secondary copy. ASM chooses the disk on which to store the secondary copy in a different failure group other than the primary copy.
High redundancy - for 3-way mirroring, requiring three failure groups, in this case the extent is mirrored across 3 disks.
External redundancy - to not use ASM mirroring. This is used if you are using hardware mirroring or third party redundancy mechanism like RAID, Storage arrays.
What is ASM Rebalancing?
Any change in the storage configuration like disk addition or dropping will trigger a oracle ASM rebalance operation The main objective of the oracle ASM rebalance operation is to always provide an even distribution of file extents and space usage across all disks in the diskgroup. Rebalancing is performed on all database files on a per file basis.
RBAL will calculate estimation time and work required to perform the task and then message the
ARBx processes to actually handle the request. The number of ARBx processes invoked is
directly determined by the asm_power_limit.
Select * from v$asm_operation
****************
ASM enables you to change the storage configuration without having to take the database offline. It automatically rebalances—redistributes file data evenly across all the disks of the disk group—after you add disks to or drop disks from a disk group.
Effects of Adding and Dropping Disks from a Disk Group
ASM automatically rebalances whenever disks are added or dropped. For a normal drop operation (without the FORCE option), a disk is not released from a disk group until data is moved off of the disk through rebalancing. Likewise, a newly added disk cannot support its share of the I/O workload until rebalancing completes. It is more efficient to add or drop multiple disks at the same time so that they are rebalanced as a single operation. This avoids unnecessary movement of data.
For a drop operation, when rebalance is complete, ASM takes the disk offline momentarily, and then drops it, setting disk header status to FORMER.
You can add or drop disks without shutting down the database. However, a performance impact on I/O activity may result.
Tuning Rebalance Operations
The V$ASM_OPERATION view provides information that can be used for adjusting ASM_POWER_LIMIT and the resulting power of rebalance operations. The V$ASM_OPERATION view also gives an estimate in the EST_MINUTES column of the amount of time remaining for the rebalance operation to complete. You can see the effect of changing the rebalance power by observing the change in the time estimate.
SET pagesize 299
SET lines 2999
SELECT GROUP_NUMBER,
OPERATION,
STATE,
POWER,
ACTUAL,
ACTUAL,
EST_MINUTES
FROM gv$asm_operation;
What processes does the rebalancing?
RBAL, ARBx
What is the use of ASM_POWER_LIMIT?
ASM_POWER_LIMIT is dynamic parameter, which will be useful for rebalancing the data across disks.Value can be 1(lowest) to 11 (highest).
What is an incarnation number?
An incarnation number is a part of ASM filename syntax. It is derived from the time stamp. Once the file is created, its incarnation number doesn’t 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
What is an oracle flex ASM?
Answer Oracle flex ASM is a feature that enables an ASM instance to run on separate physical servers from the database servers
What is the use of asmadmin?
Answer asadmin is the operating system group that holds users who have sysasm database privilege. This privilege is needed for operations like mounting disk group, dismounting disk group, storage administration
What is the purpose of asmoper operating system group?
asmoper operating system group is used for users that have the privilege to startup and stop the oracle ASM instance. The database privilege for these users will be sysoper for asm
What is the difference between asmdba and asmoper?
The users belonging to asmdba group have sysdba database privilege at ASM level. This is the highest administrative privilege needed for oracle ASM. Whereas, asmoper is given sysoper privilege which is less than asmdba
What are different types of stripings in ASM & their differences?
Fine-grained striping
Coarse-grained striping
What are different types of stripings in ASM & their differences?
Fine-grained striping
Coarse-grained striping
What happen if you miss "+" sign while adding datafile in ASM disk group ?
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';
lsdg
select NAME,ALLOCATION_UNIT_SIZE from v$asm_diskgroup;
What are different types of redundancies in ASM & explain?
Normal redundancy - for 2-way mirroring, requiring two failure groups, when ASM allocates an extent for a normal redundancy file, ASM allocates a primary copy and a secondary copy. ASM chooses the disk on which to store the secondary copy in a different failure group other than the primary copy.
High redundancy - for 3-way mirroring, requiring three failure groups, in this case the extent is mirrored across 3 disks.
External redundancy - to not use ASM mirroring. This is used if you are using hardware mirroring or third party redundancy mechanism like RAID, Storage arrays.
When you will use external redundancy and what are the advantages of it?
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';
lsdg
select NAME,ALLOCATION_UNIT_SIZE from v$asm_diskgroup;
What are different types of redundancies in ASM & explain?
Normal redundancy - for 2-way mirroring, requiring two failure groups, when ASM allocates an extent for a normal redundancy file, ASM allocates a primary copy and a secondary copy. ASM chooses the disk on which to store the secondary copy in a different failure group other than the primary copy.
High redundancy - for 3-way mirroring, requiring three failure groups, in this case the extent is mirrored across 3 disks.
External redundancy - to not use ASM mirroring. This is used if you are using hardware mirroring or third party redundancy mechanism like RAID, Storage arrays.
When you will use external redundancy and what are the advantages of it?
What can be the various header status that an ASM disk can assume?
MEMBER :
Disks that belong to a disk group, that is, disks that have a disk group name in the disk header, show a header status of MEMBER.
CANDIDATE :
Disks that were discovered, but that have not yet been assigned to a disk group, have a status of CANDIDATE
PROVISIONED :
PROVISIONED status implies that an additional platform-specific action has been taken by an administrator to make the disk available for Oracle ASM. These disks are discovered by ASM
FORMER :
Disks that previously belonged to a disk group and were dropped cleanly from the disk group have a status of FORMER.
FOREIGN :
When adding a disk, the FORCE option must be used if Oracle ASM recognizes that the disk was managed by Oracle. Such a disk appears in the V$ASM_DISK view with a status of FOREIGN. In this case, you can only add the disk to a disk group by using the FORCE keyword.
What is ASM: Backup and restore DG metadata?
Overview – ASMCMD md_backup and md_restore
ASMCMD 11g is extended to include ASM disk group metadata backup and restore functionality.
This provides the ability to recreate a pre-existing ASM disk group with the same disk paths,disk names,failure groups, attributes, templates and alias directory structure
In 10g you have to manually recreate the ASM disk group and any required user directories/templates.
In 11g we can take backup of ASM diskgroup metadata
The md_backup command creates a backup file containing metadata for one or more disk groups. i
By default all the mounted disk groups are included in the backup file which is saved in the current working directory.
ASM diskgroup metadata backup is performed using md_backup command. If no diskgroup specified ASM md_backup backs up all the mounted diskgroup metadata.
ASMCMD 11g is extended to include ASM disk group metadata backup and restore functionality.
Backup All Mounted Diskgroup
ASMCMD> md_backup /home/oragrid/dg_bkp
Backup Specific Diskgroup
ASMCMD> md_backup /home/oragrid/dg_bkp_DG_TST2_DATA -G DG_TST2_DATA
ASMCMD> md_backup /home/oragrid/dg_bkp_DG_FLEX_DATA -G DG_FLEX_DATA
Disk group metadata to be backed up: DG_FLEX_DATA
How to Restore ASM DiskGroup Metadata
Backup taken using md_backup can only be stored using md_restore
Restoring Diskgroup with Same Name as Before
ASMCMD> md_restore /home/oragrid/dg_bkp_DG_FLEX_DATA --full -G DG_FLEX_DATA
Restoring Diskgroup with Different Name
Restoring the diskgroup DG_FLEX_DATA as DG_FLEX_FRA
ASMCMD>md_restore /home/oragrid/dg_bkp_DG_FLEX_DATA --newdg -o 'DG_FLEX_DATA:DG_FLEX_FRA'
**ASMCMD – New commands in 11gR1 (Doc ID 451900.1)
Adding New Disk To ASM Diskgroup >>https://dbaclass.com/article/adding-new-disk-asm-diskgroup/
http://www.nazmulhuda.info/how-to-add-disk-in-asm-disk-group
https://dbaclass.com/article/adding-new-disk-asm-diskgroup/
https://www.thegeekdiary.com/how-to-add-new-disk-to-an-existing-diskgroup-on-rac-cluster-or-standalone-asm-configuration/