I. Features of ASM
1. automatically adjust the I/O Load
ASM can automatically adjust the I/O load in all available disks, which not only avoids manual I/O adjustment, but also optimizes the performance, with ASM, you can increase the database size online without shutting down the database.
2. Band-based storage
ASM divides files into multiple allocation units (allocation units) for storage, and allocates the AU of each file among all disks.
3. Online Automatic Load Balancing
When shared storage devices change, data in ASM is automatically allocated to existing storage devices. You can also adjust the load balancing speed of data.
4. Automatically manage database files
In ASM storage management, Oracle data files are automatically managed by ASM. Any files created by ASM are automatically deleted once they are no longer needed. However, ASM does not manage binary files, trace files, warning files, and password files.
5. data redundancy
Using a disk image, ASM can achieve data redundancy without third-party tools.
6. Support for various oracle data files
The ASM storage supports oracle data files, log files, control files, archived logs, and RMAN backup sets.
How to copy data files in ASM to the Operating System
Restoration After all Oracle 11g rac asm disks are lost
Oracle 11g from entry to proficient in PDF + CD source code
Installing Oracle 11g R2 using RHEL6 ASM
Oracle 10g manual creation of the ASM Database
Oracle 10g R2 create ASM instance Step By Step
Ii. Structure of ASM
We can see that the physical structure of ASM is the ASM disk group on the top. The ASM instance and the database instance can directly access these disk groups, and then the ASM file, each ASM file can only be contained in one disk group. However, a single disk group can contain multiple ASM files belonging to multiple databases, and a single database can use buckets from multiple disk groups; the third part is the ASM disk. Multiple ASM disk groups are used as the ASM disk groups, but each ASM disk can only belong to one disk group, followed by the allocation unit (AU ), the allocation unit is the minimum continuous disk space allocated by the ASM disk group. The ASM disk is partitioned by AU and the size of each AU is 1 MB. The bottom layer of this structure is the oracle data block, since AU is the smallest contiguous disk space allocated by ASM, ASM does not allow splitting an oracle data block across allocation units.
Iii. ASM architecture and background processes
1. To use ASM, you must first start an instance named "+ ASM" before starting the database instance. The ASM instance will not load the database, it is started to manage disk groups and protect data in them. At the same time, the ASM instance can also transmit information about the file layout to the database. In this way, the database instance can directly access the files stored in the disk group.
2. The bridge between the ASM instance and the database instance is the ASMB process, which runs on each database instance and is a channel for information exchange between the two instances, it first obtains the connection string of the ASM instance managing the disk group through CSS using the disk group name, and then establishes a persistent connection to the ASM, so that information can be exchanged regularly between two instances through this connection, this is also a heartbeat monitoring mechanism.
3. When Using ASM for data storage, ASM instance management is very important. oracle provides a wide range of management functions and requires SYSDBA permissions for managing ASM instances, you can use a new role (SYSASM) in Oracle 11g to manage the ASM instance only.
4. Create an ASM instance
There are two methods to create an ASM instance. The first method is to create an ASM instance using dbca. You only need to run Database configuration Assitant (DBCA) and then create an ASM instance as prompted.
Method 2
1. Create an ASM Disk
You can use RAID-based Luns, partitions, and bare devices to create an ASM disk. However, when using Luns, partitions, or bare devices, note that the owner and group should be changed to oracle users and their corresponding groups. oracle provides ASMLIB to create an ASM disk,
(1) Before creating an ASM instance, ensure that the ASMlib package has been installed on the node and check whether the ASMLib has been automatically loaded:
[Root @ rac1 dev] # lsmod | grep oracleasm
Oracleasm 46356 1
[Root @ rac1 dev] #/etc/init. d/oracleasm createdisk ASMDISK1/dev/sdc1
After creating an ASM disk, you can check whether the disk device has been generated in the/dev/oracleasm/disks/directory of the system. Run the following command to view the asm Disk:
(2), [root @ rac1 dev] # ll/dev/oracleasm/disks/
Total 0
Brw-rw ---- 1 grid dba 8, 17 Apr 29 09: 59 DISK1
Brw-rw ---- 1 grid dba 8, 33 Apr 29 DISK2
Brw-rw ---- 1 grid dba 8, 49 Apr 29 09: 59 DISK3
Brw-rw ---- 1 grid dba 8, 65 Apr 29 09: 59 DISK4
Brw-rw ---- 1 grid dba 8, 81 Apr 29 09: 59 DISK5
[Root @ rac1 dev] #
(3), you can also use the following command to view:
[Root @ rac1 disks] # service oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
[Root @ rac1 disks] #
(4) run the following command to delete the ASM Disk:
[Root @ rac1]/etc/init. d/oracleasm deletedisk ASMDISK5
(5) In the RAC environment, check whether another node can find the corresponding asm disk. Execute the following command to let another node obtain this change.
[Root @ rac1 disks] #/etc/init. d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [OK]
[Root @ rac1 disks] #
So far, the ASM disk has been created.
2. initialization parameters
To start an asm instance, you only need the following parameters, and the memory of the asm instance is automatically allocated and managed.
The following describes the initialization parameters of the ASM instance:
Instance_type = asm
Cluster_database = true
DB_UNIQUE_NAME = + ASM
ASM_POWER_LIMIT = 1
Large_pool_size = 60 M
Asm_diskgroups = 'Flash _ disk', 'arch _ disk', 'Data _ disk'
Asm_diskstring = '/dev/oracleasm/disks /'
The meanings of each parameter are described as follows:
(1) instance_type: Specifies the instance type. for ASM instances, set it to ASM.
(2) cluser_database: Specifies whether the cluster is a database cluster. true indicates the ASM cluster.
(3) DB_UNIQUE_NAME: Specifies the name of the ASM instance. The default value is + ASM.
(4) ASM_POWER_LIMIT: this parameter is used to control the load balancing speed of data in ASM.
(5) large_pool_size: set the size of the large pool. Because the allocation unit ing of the ASM file is allocated from LARGE_POOL, LARGE_POOL_SIZE must be at least 8 Mb. The larger the size, the better.
(6) asm_diskgroups: Specifies the ASM disk groups available when the instance is started. The ASM instance will automatically mount these disk groups when it is started.
(7), asm_diskstring, used to restrict the disk devices that can be used to create a disk group for an ASM instance. If this value is NULL, all disks visible to the ASM instance can be called the optional disks for creating a disk group.
3. Create a password file
[Oracle @ rac1 ~] Su-oracle
[Oracle @ rac1 ~] $ Cd $ ORACLE_HOME/dbs
[Oracle @ rac1 ~] $ Orapwd file = orapw + ASM password = oracle
4. Create a directory structure
[Oracle @ rac1 ~] $ Su-oracle
[Oracle @ rac1 ~] $ Cd $ ORACLE_HOME/dbs
[Oracle @ rac1 ~] $ Mkdir-p $ ORACLE_BASE/admin/+ ASM/udump
[Oracle @ rac1 ~] $ Mkdir-p $ ORACLE_BASE/admin/+ ASM/bdump
[Oracle @ rac1 ~] $ Mkdir-p $ ORACLE_BASE/admin/+ ASM/adump
[Oracle @ rac1 ~] $ Mkdir-p $ ORACLE_BASE/admin/+ ASM/cdump
For more details, please continue to read the highlights on the next page: