Beruflich Dokumente
Kultur Dokumente
By Emmanuel Adarkwah
Overview
ASM is an integrated, high-performance database file system and disk manager. ASM is based on the principle that the database should manage storage instead of requiring an administrator to do it. ASM eliminates the need for directly managing potentially thousands of Oracle database files. ASM groups the disks in your storage system into one or more disk groups.
ASM Instance
ASM is implemented as a special kind of Oracle instance, with its own System Global Area and background processes. The ASM instance is tightly integrated with the database instance. Every server running one or more database instances that use ASM for storage has an ASM instance. In an Oracle RAC environment, there is one ASM instance for each node. Only one ASM instance is required for each node regardless of the number of database instances on the node. The ASM instance on oradb1 is called +ASM1 and on oradb2 +ASM2. The ASM instances communicate with each other on a peer-topeer basis. The ASM instance log on each server is under /oraprod/admin/+ASM/bdump and is called alert_+ASM1.log on oradb1 and alert_+ASM2.log on oradb2.
ASM DISKS
Currently, in 10g and 11gR1, ASM disks cannot be larger than 2TB, and needs to be a minimum of 4MB. For NHIA System, ASM manages two diskgroups. o +DATA_DG: Stores Control file, Datafiles, Online Redo Log files and Temp files. It has 4 disks; (DATA1,DATA2,DATA3,DATA4). o +FRA_DG: Archived Logs are kept on this diskgroup. It has 1 disk (ARCH1).
Advantages
ASM provides the following benefits: StripingASM spreads data evenly across all disks in a disk group to optimize performance and utilization. This even distribution of database files eliminates the need for regular monitoring and I/O performance tuning. MirroringASM can increase data availability by optionally mirroring any file.ASM mirrors at the file level, unlike operating system mirroring, which mirrors at the disk level.
Advantages
Online storage reconfiguration and dynamic rebalancingASM permits : o Addition or removal of disks from disk storage system while the database is up. When a disk is added, ASM automatically redistributes the data so that it is evenly spread across all disks in the disk group, including the new disk. o The process of redistributing data so that it is also spread across the newly added disks is known as rebalancing. It is done in the background and with minimal impact to database performance.
Advantages
Manages file creation and deletion o ASM further reduces administration tasks by enabling files stored in ASM disk groups to be managed by Oracle Database. o ASM automatically assigns file names when files are created, and automatically deletes files when they are no longer needed.
Mirroring
Mirroring means keeping redundant copies or mirrored copies of each extent of the file to help avoid data loss caused by disk failures. The mirrored copy of each file extent is always kept on a different disk from the original copy. If a disk fails, ASM can continue to access affected files by accessing mirrored copies on the surviving disks in the disk group.
ASMCMD
ASMCMD is a command-line utility introduced in 10gR2 to manage ASM(Automatic Storage Management) diskgroups. It manages the interface between the ASM logical data view and the physical disk files. The idea of this tool is to make administering the ASM files similar to administering standard operating system files. The asmcmd utility is located in $ORACLE_HOME/bin/asmcmd.
Invoking ASMCMD
The asmcmd interface is launched by: o Setting the environment for +ASM. o Calling it with the asmcmd command. [oraprod@oradb1 10.2.0]$ export ORACLE_SID=+ASM [oraprod@oradb1 10.2.0]$ cd $ORACLE_HOME/asm [oraprod@oradb1 asm]$ asmcmd -p
ASMCMD [+] > help asmcmd [-p] [command] The environment variables ORACLE_HOME and ORACLE_SID determine the instance to which the program connects, and ASMCMD establishes a bequeath connection to it, in the same manner as a SQLPLUS / AS SYSDBA. The user must be a member of the SYSDBA group. Specifying the -p option allows the current directory to be displayed in the command prompt, like so: ASMCMD [+DATAFILE/ORCL/CONTROLFILE] >
[command] specifies one of the following commands, along with its parameters. Type "help [command]" to get help on a specific ASMCMD command. commands: -------cd du find help ls lsct lsdg mkalias mkdir pwd rm rmalias
list all connected Oracle instances ASMCMD [+] > lsct DB_Name Status Software_Version Compatible_version Instance_Name prod CONNECTED 10.2.0.3.0 10.2.0.0.0 prod1 display current directory ASMCMD [+] > pwd + list directory contents ASMCMD [+] > ls DATA_DG/ FRA_DG/ change directory ASMCMD [+] > cd DATA_DG/ ASMCMD [+DATA_DG] >
ASMCMD [+DATA_DG] > ls prod/ ASMCMD [+DATA_DG] > cd prod/ ASMCMD [+DATA_DG/prod] > ls DATAFILE/ controlfile/ onlinelog/ tempfile/
ASM V$ VIEWS
The ASM configuration can be viewed using the V$ASM_% views. These views often contain different information depending on whether they are queried from the ASM instance or a dependant database instance.
ASM V$ VIEWS
View V$ASM_ALIAS ASM Instance Displays a row for each alias present in every disk group mounted by the ASM instance. Displays a row for each database instance using a disk group managed by the ASM instance. Displays a row for each disk discovered by the ASM instance, including disks which are not part of any disk group. Displays a row for each disk group discovered by the ASM instance. Displays a row for each file for each disk group mounted by the ASM instance. Displays a row for each file for each long running operation executing in the ASM instance. DB Instance Returns no rows
V$ASM_CLIENT
Displays a row for the ASM instance if the database has open ASM files.
V$ASM_DISK
Displays a row for each disk in disk groups in use by the database instance.
Displays a row for each disk group mounted by the local ASM instance.
V$ASM_DISKGROUP
V$ASM_FILE
Displays no rows.
V$ASM_OPERATION
Displays no rows. Displays a row for each template present in each disk group mounted by the ASM instance with which the database instance communicates.
V$ASM_TEMPLATE
Displays a row for each template present in each disk group mounted by the ASM instance.
Conclusion
In summary ASM provides the following functionalities: o Manages groups of disks, called disk groups. o Manages disk redundancy within a disk group. o Provides near-optimal I/O balancing without any manual tuning. o Enables management of database objects without specifying mount points and filenames. o Supports large files.
Thank You