You are on page 1of 13

Managing ASM Disk Groups Linux

Purpose

This tutorial illustrates the disk rebalancing that Automatic Storage Management
(ASM) does when disk volumes are added or removed to or from disk groups.

Time to Complete

Approximately 20 minutes

Topics

This tutorial covers the following topics:

Overview
Scenario
Viewing Disk Groups
Removing a Disk
Adding a Disk
Summary

Overview
This example illustrates how Automatic Storage Management manages the data stored
on the disks available to it at the time. Striping is performed on the allocated disks.
When a disk is removed, rebalancing is automatically performed, and the data is
redistributed evenly across the remaining disks. When a disk is added, a proportional
subset of data is evenly reallocated from the legacy disks to the newly added one.

Scenario

A major part of the database performance equation is disk striping. This often requires
many disks in production, and usually entails a lot of administration on the part of the
DBA or the system administrator. Making disks available and then unavailable are
common activities associated with that administration, and thus, having the Oracle
instance react favorably to those changes is a desirable goal. In this scenario, a disk is
taken away, and later made available to Oracle again, showing how ASM reacts by
redistributing the data to take advantage of a disk's presence or accommodate its
absence. This is done while the Oracle database, including the data that is being
redistributed, is online and available for use as normal.

Viewing Disk Groups

To view the existing Disk Groups in an ASM instance, perform the following steps:
1. Start the Oracle Enterprise Manager Database Control utility (Desktop icon). Enter
sys for the username and oracle for the password. Select SYSDBA in the Connect As
drop-down list, then click Login.

2. Click the crs Cluster link.


3. Click Targets.

4. Click the instance name that starts with +ASM1.


5. Click the Administration tab.

6. Click the link for the MY_DG2 disk group.


7. View the disks in the disk group. Note that the data is evenly spread across the four
available disks.

Removing a Disk

To remove a disk from a disk group in an ASM instance, perform the following steps:

1. On the Disk Group page, used in the last step of the previous topic, in the Member
Disks region, select the disk MY_DG2_0000, and then click Remove.
2. Click Yes to confirm.

3.When returned to the Disk Group page, click the Performance tab.
4. Set the Refresh rate (see the top right of the page) to 15 seconds and observe how
the graph changes after refreshing.

5. After the Disk Group I/O Response Time graph returns to 0 ms (this make take a
few minutes), click the General tab in the upper left corner of the page to return to the
Disk Group home page.

6.Note that the MY_DG2_0000 disk no longer appears in the list. Also notice that the
data has been redistributed among the remaining disks.

If the MY_DG2_0000 disk is still listed, it should have a "State" of "DROPPING."


Refresh the page until only three disks appear in the list.
Adding a Disk

To add a disk to an ASM disk group, perform the following steps:

1. Before actually adding the disk back to the disk group, generate some test data for
later use. Open a terminal window. Change to the wkdir directory and start SQL*Plus.
Connect as a SYSDBA user. At the SQL prompt run the pop_t1.sql script.
cd /home/oracle/wkdir
sqlplus "/ as sysdba"
@pop_t1
2. Note the "Elapsed" timing value for the query at the end. You will compare this
with later query timings.
Keep this window open.

3. Return to the Enterprise Manager Console, and click Add in the Member Disks
region of the Disk Group page..
4. On the Add Disks page, select the disk that was removed previously, whose path is
"/dev/raw/raw15." (Note that it is the only disk with a "Header Status" of
"FORMER." In the "ASM Disk Name" column, enter MY_DG2_0004. Leave the
other column values as the default.

Do not click the OK button yet.

5.Return to the terminal window. Start SQL*Plus. Connect as a SYSDBA user. At the
SQL prompt run the poll_timing.sql script.
sqlplus "/ as sysdba"
@poll_timing.sql

After you press [Enter] to start execution of the script, immediately return to the
Enterprise Manager page and click the OK button.

6. In the Enterprise Manager window, click the browser's Reload button. Observe the
change in the bar graph for the "Used" column, for each disk. Specifically note the
growth in the value for the disk just added.
Click Reload again. (Repeat until the graph stops changing.)

7. Return to the terminal window. Scroll through the script output, which shows
timings for a query being run repeatedly while the data was being rebalanced across
the disks in ASM. Note the different elapsed times for each run. Compare the final
elapsed query time which the timing value obtained in step 2. You see that the load on
the disks is distributed equally and while the query time decreases and then stabalizes
Summary

In this tutorial, you've learned how to:

View a Disk Group


Remove and Add a Disk Group

You might also like