Oracle® Database 2 Day DBA 10g Release 2 (10.2) Part Number B14196-01 |
|
|
View PDF |
This appendix discusses using Oracle Automatic Storage Management (ASM) to provision and manage storage for the Oracle Database datafiles. It includes the following topics:
Automatic Storage Management (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 you to directly manage potentially thousands of Oracle database files.
ASM groups the disks in your storage system into one or more disk groups. You manage a small set of disk groups and ASM automates the placement of the database files within those disk groups.
ASM provides the following benefits:
Striping—ASM 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.
For example, if there are six disks in a disk group, pieces of each ASM file are written to all six disks. These pieces come in 1 MB chunks known as extents. When a database file is created, it is striped (divided into extents and distributed) across the six disks, and allocated disk space on all six disks grows evenly. When reading the file, file extents are read from all six disks in parallel, greatly increasing performance.
Mirroring—ASM can increase availability by optionally mirroring any file. ASM mirrors at the file level, unlike operating system mirroring, which mirrors at the disk level. 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.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and 3-way mirroring, where each file extent gets two mirrored copies.
Online storage reconfiguration and dynamic rebalancing—ASM permits you to add or remove disks from your disk storage system while the database is operating. When you add a disk, ASM automatically redistributes the data so that it is evenly spread across all disks in the disk group, including the new disk. This redistribution is known as rebalancing. It is done in the background and with minimal impact to database performance. When you request to remove a disk, ASM first rebalances by evenly relocating all file extents from the disk being removed to the other disks in the disk group.
Managed file creation and deletion—ASM further reduces administration tasks by enabling files stored in ASM disk groups to be Oracle-managed files. ASM automatically assigns filenames when files are created, and automatically deletes files when they are no longer needed. For information about Oracle-managed files, see Oracle Database Administrator's Guide.
Oracle recommends that you use ASM for your database file storage, instead of raw devices or the operating system file system. However, databases can have a mixture of ASM files and non-ASM files. Oracle Enterprise Manager includes a wizard that enables you to migrate non-ASM database files to ASM.
The 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 a Real Application Clusters environment, there is one ASM instance for each node, and the ASM instances communicate with each other on a peer-to-peer basis. Only one ASM instance is required for each node regardless of the number of database instances on the node.
You administer ASM with Oracle Enterprise Manager Database Control or Grid Control. This Appendix assumes that you are using Database Control.
You configure ASM by creating disk groups that become the default location for files created in the database. The disk group type determines how ASM mirrors files. When you create a disk group, you indicate whether the disk group is a normal redundancy disk group (2-way mirroring for most files by default), a high redundancy disk group (3-way mirroring), or an external redundancy disk group (no mirroring by ASM). You use an external redundancy disk group if your storage system already does mirroring at the hardware level, or if you have no need for redundant data. The default disk group type is normal redundancy.
A disk group consists of a grouping of disks that are managed together as a unit. These disks are referred to as ASM disks. An ASM disk can be a disk device, a partition, or a network-attached file.
When an ASM instance starts, it automatically discovers all available ASM disks. Discovery is the process of finding all disks that have been prepared for ASM by your system administrator, examining their disk headers, and determining which disks belong to disk groups and which are available for assignment to disk groups. 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.
Failure groups define ASM disks that share a common potential failure mechanism. An example of a failure group is a set of SCSI disks sharing the same SCSI controller. 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.
Note: By default, when you create a disk group, every disk in the disk group belongs to exactly one failure group. For most systems, the default failure groups work well to prevent data loss. |
See Also: Oracle Database Administrator's Guide for additional information about failure groups, and for instructions on how to configure and use failure groups. |
This appendix assumes that Automatic Storage Management (ASM) is already installed and configured on your single-instance server or on your Real Application Clusters (RAC) nodes. For information on installing and initially configuring ASM, see the following Oracle publications:
For a single-instance server, the Installation Guide for your operating system
For RAC, the Real Application Clusters Installation and Configuration Guide for your operating system
In addition, see Oracle Database Administrator's Guide for a list of installation tips.
All Automatic Storage Management (ASM) administration tasks begin with the ASM Home page in Enterprise Manager. The ASM Home page displays:
The status of the ASM instance
A chart that shows the used and free space of each disk group
A list of databases that are serviced by the ASM instance
Alerts and metrics
Links to the ASM Performance, Administration, and Configuration pages
To access the ASM Home page on a single instance system:
Log in to Enterprise Manager Database Control as the SYS
user, connecting as SYSDBA
. Provide the SYS
password that is stored in the password file for the ASM instance. This password was set up when the ASM instance was created.
See "Accessing the Oracle Enterprise Manager" for more information.
Note: You can also log in to Enterprise Manager as a user other thanSYS . In this case, Enterprise Manager displays the Automatic Storage Management Login page when you attempt any ASM administration tasks. You must then log in to ASM as the SYS user, connecting as SYSDBA . |
On the Database Instance Home page, under the General heading, click the link next to the label ASM.
To access the ASM Home page on a Real Application Clusters (RAC) system:
Log in to Enterprise Manager Database Control on any node that is running the Oracle Management Service (OMS).
OMS is automatically started on the node where Database Configuration Assistant (DBCA) was run to create the cluster database. Depending on your configuration, OMS may also be running on other nodes.
See "Accessing the Oracle Enterprise Manager" for more information.
On the Cluster Database page, under the Instances heading, click the link for the desired ASM instance.
To start up or to shut down the ASM instance, all database instances that are serviced by the ASM instance must first be shut down, and you must have operating system user credentials and ASM SYS
user credentials.
Note: The ASM instance must be started before you start any of the database instances that are serviced by it. |
To start or stop the ASM instance:
Access the Automatic Storage Management Home page.
See "Accessing the Automatic Storage Management Home Page" for instructions.
Under the General heading, click Startup/Shutdown
Enter the required operating system and ASM user names and passwords, and click OK.
If you are prompted for the operation to perform, select the desired operation.
Click Yes on the Startup/Shutdown Confirmation page.
To view Automatic Storage Management (ASM) disk group usage and free space:
Access the ASM Home page.
See "Accessing the Automatic Storage Management Home Page" for instructions.
Click the Administration tab.
If the Automatic Storage Management Login page appears, log in as the SYS
user, connecting as SYSDBA
. Provide the SYS
password that is stored in the password file for the ASM instance. This password was set up when the ASM instance was created.
The ASM Administration page displays all disk groups with their space usage information.
Note: The Usable Free column displays the space in MB that is actually available in the disk group. It takes into account the redundancy level of the disk group, and excludes the space that the disk group reserves for restoring full redundancy for all files in the disk group after a disk failure. See Oracle Database Administrator's Guide for more information. |
You may want to create additional Automatic Storage Management (ASM) disk groups to:
Have disk groups with different redundancy levels (normal, high, or external), depending on availability requirements and storage system capabilities.
Separate different classes of storage (for example, SCSI drives and SATA drives) into different disk groups. (Disks in a disk group should have similar size and performance characteristics.)
Store the flash recovery area in a separate disk group from the database.
To create a disk group:
Access the ASM Home page.
See "Accessing the Automatic Storage Management Home Page" for instructions.
Click the Administration tab.
If the Automatic Storage Management Login page appears, log in as the SYS
user, connecting as SYSDBA
. Provide the SYS
password that is stored in the password file for the ASM instance. This password was set up when the ASM instance was created.
On the ASM Administration page, under the Disk Groups heading, click Create.
The Create Disk Group page appears. It displays a list of ASM disks that are available to be added to a disk group. This includes disks with the header status of CANDIDATE
, PROVISIONED
, or FORMER
.
If you want to display not only disks that are available to be added to a disk group, but all ASM disks, including disks that already belong to a disk group (header status = MEMBER
), select All Disks from the Select Member Disks drop-down list.
The page is redisplayed with the complete list of ASM disks that were discovered by the ASM instance.
Enter the disk group name, and select redundancy type (high, normal, or external).
Select disks as follows:
Select the check box to the left of each disk that you want to include in the new disk group.
If you want to force the inclusion of a disk in the disk group, select the Force Usage check box for that disk.
Caution: The Force Usage check box causes the disk to be added to the new disk group even if the disk already belongs to another disk group and has valid database data. This data will be lost. You must be certain that you are selecting a disk that can legitimately be added to the disk group. See Oracle Database Administrator's Guide for a discussion of theFORCE option. |
Optionally enter an ASM name for each selected disk. (ASM provides a name if you do not.)
Click OK to create the disk group.
See Also: The discussion of theV$ASM_DISK view in Oracle Database Reference for information on the various header statuses of ASM disks. |
When you drop a disk group, you delete the disk group, and optionally all of its files. You cannot drop a disk group if any of its database files are open. After dropping a disk group, you can add its member disks to other disk groups or use them for other purposes.
One reason to drop a disk group is to change redundancy (normal, high, or external). Because you cannot change the redundancy of a disk group, you must drop the disk group and then re-create it with the proper redundancy. In this case, you must back up or move disk group data before you drop the disk group.
To drop a disk group:
Access the ASM Home page.
See "Accessing the Automatic Storage Management Home Page" for instructions.
Click the Administration tab.
If the Automatic Storage Management Login page appears, log in as the SYS
user, connecting as SYSDBA
. Provide the SYS
password that is stored in the password file for the ASM instance. This password was set up when the ASM instance was created.
On the ASM Administration page, under the Disk Groups heading, click in the Select column to select the disk group that you want to drop.
Click Delete.
A confirmation page appears.
If you want to delete the contents of the disk group, click Advanced Options, ensure that the INCLUDING CONTENTS
option is selected, and then click OK.
On the confirmation page, click Yes.
You add disks to a disk group to increase the total amount of storage space in a disk group. You can add one or multiple disks in a single operation. ASM then rebalances the disk group so that data is evenly distributed on all disks, including the newly added disks.
You can control the power of the rebalance operation, which is a number from 0 to 11. The higher the number, the faster the rebalance operation completes. Lower numbers cause rebalancing to take longer, but consume fewer processing and I/O resources. This leaves these resources available for the database. The default value of 1 minimizes disruption to the database. A value of 0 blocks the rebalance operation altogether. Manual or automatic rebalance can then occur at a later time. (You may want to postpone rebalancing because you want to wait for a time when there are fewer demands on the database, or because you want to add more disks or drop disks later and want the rebalancing to be done only once for all disk group changes.)
See Oracle Database Administrator's Guide for more information about controlling rebalance operations.
To add one or more disks to a disk group:
Access the ASM Home page.
See "Accessing the Automatic Storage Management Home Page" for instructions.
Click the Administration tab.
If the Automatic Storage Management Login page appears, log in as the SYS
user, connecting as SYSDBA
. Provide the SYS
password that is stored in the password file for the ASM instance. This password was set up when the ASM instance was created.
On the ASM Administration page, under the Disk Groups heading, click a link in the Name column to select the disk group to which you want to add disks.
The Disk Group page appears, displaying a list of disks that are already in the disk group.
Click Add.
The Add Disks page appears. It displays a list of ASM disks that are available to be added to the disk group. This includes disks with the header status of CANDIDATE
, PROVISIONED
, or FORMER
.
If you want to display not only disks that are available to be added to a disk group, but all ASM disks, including disks that already belong to a disk group (header status = MEMBER
), select All Disks from the Select Member Disks drop-down list.
The page is redisplayed with the complete list of ASM disks that were discovered by the ASM instance.
Optionally change the rebalance power by selecting from the Rebalance Power drop-down list.
Select disks as follows:
Select the check box to the left of each disk that you want to add to the disk group.
If you want to force the inclusion of a disk in the disk group, select the Force Usage check box at the right.
Caution: The Force Usage check box causes the disk to be added to the disk group even if the disk already belongs to another disk group and has valid database data. This data will be lost. You must be certain that you are selecting a disk that can legitimately be added to the disk group. See Oracle Database Administrator's Guide for a discussion of theFORCE option. |
Optionally enter an ASM name for each disk. (ASM provides a name if you do not.)
Click OK to add the selected disks.
When you drop a disk from the disk group, the disk group is rebalanced by moving all of the file extents from the dropped disk to other disks in the disk group. ASM then releases the disk, and you can then add it to another disk group or use it for other purposes. You can drop one or multiple disks in a single operation. You can also optionally set rebalance power for the drop operation.
The following is a list of possible reasons for dropping a disk:
A disk is starting to fail, and you need to replace it.
You want to upgrade a disk.
You want to reallocate the disk to a different disk group, or reallocate the disk to a different storage system.
Note: Dropping disks from a disk group only logically deletes the disks from the disk group. It does not delete the disk contents. However, the contents are lost when you add the disk to a new disk group. |
To drop one or more disks from a disk group:
Access the ASM Home page.
See "Accessing the Automatic Storage Management Home Page" for instructions.
Click the Administration tab.
If the Automatic Storage Management Login page appears, log in as the SYS
user, connecting as SYSDBA
. Provide the SYS
password that is stored in the password file for the ASM instance. This password was set up when the ASM instance was created.
On the ASM Administration page, under the Disk Groups heading, click a link in the Name column to select the disk group from which you want to drop disks.
The Disk Group page appears.
Under the Member Disks heading, in the Select column, select the check boxes for the disks that you want to drop, and then click Remove.
A confirmation page appears.
If you want to change rebalance power, or if you want set the FORCE
option for dropping disks, do the following:
Click Advanced Options.
On the Advanced Options page, optionally select the FORCE
option or select a rebalance power in the drop-down list.
Click OK to return to the confirmation page.
Note: You may need theFORCE option if ASM cannot read from or write to the disk. See Oracle Database Administrator's Guide for more information on the FORCE option. |
Click Yes to drop the disks.
The Disk Group page returns, and displays a state of DROPPING
for each disk being dropped.
Refresh the page until the dropped disks no longer appear in the disk group.
Caution: You cannot reuse or disconnect the dropped disks until the drop and rebalance operations are complete—that is, until the dropped disks no longer appear in the disk group. See Oracle Database Administrator's Guide for more information, and for other caveats for dropping disks. |
Oracle recommends that you use RMAN to back up files managed by ASM. The procedures for using RMAN are documented in Chapter 9, "Performing Backup and Recovery".
Oracle by Example (OBE) has a series on the Oracle Database 2 Day DBA book. This OBE steps you through the tasks in this appendix and includes annotated screen shots.
To view the Automatic Storage Management OBE, point your browser to the following location:
http://www.oracle.com/technology/obe/10gr2_2day_dba/asm/asm.htm