I. basic information and concepts
1. ASM is an ORACLE automatic storage management software. It uses bare devices and ASM disks. Before using the software, you need to secure the ASM library driver for the corresponding platform.
2. ASM combines multiple disks to form a disk group. The disk group has the advantages of bare device read/write performance and file system management performance.
3. The ASM disk group consists of multiple disks, each of which consists of multiple AUallocate units: Allocation units. Each AU is 1 MB.
4. The ASM disk group implements data fault tolerance, which includes three levels of redundancy:
External redundancy): The same AU does not have a copy in the ASM disk.
Standard redundancy normal redundancy): The same AU has a copy in the ASM disk.
High redundancy): The same AU has two copies in the ASM disk.
5. In order to realize fault tolerance of a disk GROUP, ASM puts forward the concept of a fault group fail group. It is also stipulated that copies of the same AU can never be placed in the same fault group.
6. The ASM disk group has the data rebalancing function. The essence of the so-called rebalancing is to make all the disk data in the group uniform to achieve I/O load balancing.
How rebalance works:
When a disk is added, ASM reads some AU data from the existing disks in the disk group and writes it to the new disk. To balance the data volume of each disk.
When a disk is deleted, ASM reads all the AU records from the disk to be deleted and writes them to other disks in the group on average. To balance the data volume of each disk.
Ii. Instances
1. The ASM instance and the database instance have their own parameter files and their functions are the same.
2. The ASM instance only uses two statuses: nomount and mount.
3. the startup of the ASM instance is the same as that of the database. Example: startup nomount | mount
4. the close of the ASM instance is the same as that of the database. Example: shutdown immediate | normal | transactional | abort
5. ASM instance services:
An ASM instance has a service called group service. It registers all the disk groups that can be managed by the ASM instance to its management information table. This table also contains the name of the disk group and information about how to access the disk group. The service object is the database frontend process ASMB. The process ASMB is generated only when the database communicates with the ASM instance.
6. Functions of the ASM instance: used to maintain the ASM disk group. Including creating, deleting, and modifying a disk group.
7. operations on the ASM instance:
$ Sqlplus/nolog
SQL> connect/as sysdba # connect to the instance
SQL> startup nomount # Start the instance to the NOMOUNT status,
SQL> startup mount # Start the instance to the MOUNT status
SQL> shutdown immediate # shut down an instance
Note: If the ASM instance is in the NOMOUNT status and you want to upgrade it to the MOUNT status, run the following command:
Alter diskgroup diskgroup_name mount;
Iii. parameter file of the ASM instance
1. The parameter file of the ASM instance is used to create the memory structure of the ASM instance and start the background process of the ASM instance.
2. the initialization parameters of the ASM instance have the same meanings as those of the database initialization parameters.
For example, user_dump_dest,
Background_dump_dest
Core_dump_dest
Remote_login_passwordfile
3. Description of important parameters:
Instance_type = 'asm '# Set Value of the asm instance
Instance_type = 'rdbms '# database instance setting value
Asm_diskgroups = 'dgdata1, dgdata2 '# indicates the disk groups that are mounted by default when ASM is started.
If this value is not set, an error indicating that the disk is not mounted will be reported when ASM is started to MOUNT.
Asm_diskstring = '/dev/raw *' # indicates the format of the ASM instance.
Search for disks. Remember to use the search mode instead of the path.
Asm_power_limit = [0 11] # This parameter indicates the speed and throughput of the rebalancing. The value 1 is the minimum, which affects the user.
Minimum response. And vice versa. 0 indicates that rebalancing is disabled.
4. Background process of the asm instance:
1) GMONglobal monitor): used to monitor and maintain metadata operations on the disk group.
2) RBAL: used to coordinate the rebalancing of disks in the disk group. Generates a rebalancing plan.
3) ARBx: Responsible for the actual rebalancing operation.
5. A special process:
ASMB: communicates with the ASM instance, which reads information from the GSgroup service. Only in
It is generated only when the database instance communicates with the ASM instance. Belongs to the database process.
Iv. View description of the ASM instance:
1. When the initialization parameter asm_diskstring is used:
1) create a disk group
2) append a disk to the disk group
3) Access v $ asm_disk
4) Access v $ asm_diskgroup
In the above four cases, ASM searches for all available Disks Based on the disk string specified by the initialization asm_diskstring. Note: It is a disk string, not a disk path. For example,/dev/oracleasm/disks/DISK *.
To avoid frequent disk searches, You can query the view: v $ asm_disk_stat, v $ asm_diskgroup_stat.
2. View relationship:
View: the fields in v $ asm_disk and v $ asm_disk_stat share the same meaning, except that the former searches for disks and the latter does not.
View: fields in v $ asm_diskgroup and v $ asm_diskgroup_stat share the same meaning, except that the former searches for disks and the latter does not.
V. initialization parameter asm_diskstring) Instructions for use
1. Purpose: Specify the search mode for the asm disk.
2. Definition: alter system set asm_diskstring = '/dev/oracleasm/disk/DISK *' scope = spfile;
Applicable to ASM disks)
Or
Alter system set asm_diskstring = 'orcl: DISK * 'scope = spfile; applicable to ASM disks)
Or
Alter system set asm_diskstring = '/dev/raw *' scope = spfile; applicable to bare devices)
3. Annotations:
Here, the value of this parameter cannot be specified as the disk search path and is case sensitive.
For example, if a bare device is in the/dev/raw/directory, you cannot set asm_diskstring = '/dev/raw /', set it to asm_diskstring = '/dev/raw *'. Otherwise, the ASM cannot find the disk.
4. instance operations:
Group 1:
Before change
SQL> alter system set asm_diskstring = 'orcl: DISK * 'scope = spfile;
SQL> shutdown immediate
SQL> startup nomount
SQL> select group_number, disk_number, name, path, total_mb from v $ asm_disk;
GROUP_NUMBER DISK_NUMBER name path TOTAL_MB
----------------------------------------------------------------
0 0 ORCL: DISK1 8189
0 3 ORCL: DISK4 8189
0 2 ORCL: DISK3 8189
0 1 ORCL: DISK2 8189
After the change:
SQL> alter system set asm_diskstring = 'orcl: disk * 'scope = spfile;
SQL> shutdown immediate
SQL> startup nomount
SQL> select name, path from v $ asm_disk;
No rows selected
Group 2:
Before change:
SQL> alter system set asm_diskstring = '/dev/oracleasm/disks/DISK *' scope = spfile;
SQL> shutdown immediate
SQL> startup nomount
SQL> select group_number, disk_number, name, path, total_mb from v $ asm_disk;
GROUP_NUMBER DISK_NUMBER name path TOTAL_MB
---------------------------------------------------------
0 0/dev/oracleasm/disks/DISK4 8189
0 3/dev/oracleasm/disks/DISK1 8189
0 2/dev/oracleasm/disks/DISK2 8189
0 1/dev/oracleasm/disks/DISK3 8189
After the change:
SQL> alter system set asm_diskstring = '/dev/oracleasm/disks/disk *' scope = spfile;
SQL> startup nomount
SQL> select group_number, disk_number, name, path, total_mb from v $ asm_disk;
No rows selected
Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html