Creating and Managing ASM Disk Groups
Creating and Managing ASM Disk Groups
This tutorial illustrates the disk rebalancing that Automatic
Storage Management (ASM) does when disk volumes are added or removed to or from
disk groups.
Approximately 1 hour.
This tutorial covers the following topics:
Place the cursor over this icon to load and view all
the screenshots for this tutorial. (Caution: Because this action loads all screenshots
simultaneously, response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor
over each individual icon in the following steps to load and view only the screenshot
associated with that step.
This example illustrates how Automatic Storage Management
manages the data stored on the disks available to it at the time. Striping is
done across whatever disks are allocated to it. When a disk is removed, rebalancing
is automatically done, 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 onto the newly added one.
Back to Topic List
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 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 then
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.
Back to Topic List
Before starting this tutorial, you should have:
Back to Topic List
To create a database for ASM, perform the following
steps:
| 1. |
Open a terminal window and execute the following command:
dbca
|
| 2. |
At the Welcome window, click Next.
|
| 3. |
At the Operations window, make sure Create a Database is selected
and click Next.

|
| 4. |
At the Database Templates window, select General Purpose and click
Next.

|
| 5. |
At the Database Identification window, enter asm.oracle.com for
the Global Database Name and asm for the SID and click Next.

|
| 6. |
At the Management Options window, accept the defaults and click Next.

|
| 7. |
At the Database Credentials window, enter a Password and Confirm Password
and click Next.

|
| 8. |
At the Storage Options window, select Automatic Storage Management (ASM)
and click Next.

|
| 9. |
At the Create ASM Instance window, click ASM Parameters.

|
| 10. |
Enter /u02/asmdisks/* (or the path where your disks are located)
in the asm_diskstring value field and click Close.

|
| 11. |
Enter a SYS Password and Confirm SYS Password and click Next.

|
| 12. |
Click OK to create and start the ASM instance.

|
| 13. |
Now you will create your ASM Disk Group. At the ASM Disk Group window,
click Create New.

|
| 14. |
Enter DGROUP1 in the Disk Group Name field. A list od Member Disks
should appear. Check the checkbox next to Disk Path to select all the
disks. If a list of Member Disks does not appear,

|
| 15. |
Select the Disk Group you just created and click Next.

|
| 16. |
Make sure Use Oracle-Managed Files is selected and +DGROUP1
is entered in the Database Area and click Next.

|
| 17. |
Deselect Specify Flash Recovery Area and click Next.

|
| 18. |
Accept the defaults. Click Next.

|
| 19. |
Accept the defaults. Click Next.

|
| 20. |
Accept the defaults. Click Next.

|
| 21. |
Click Finish.

|
| 22. |
Click OK.

|
| 23. |
The progress window appears. The database is being created.

|
| 24. |
The ASM database was created successfully. Note the Enterprise Manager
URL. Click Exit.

|
Back to Topic List
To view the existing Disk Groups in an ASM instance,
perform the following steps:
| 1. |
Start Oracle Enterprise Manager (Desktop icon) by entering the URL http://<your
hostname>:5501/em/ and enter sys/<password>
as SYSDBA. Then click Login.

|
| 2. |
At the Licensing window, scroll down to the bottom and click I Agree.
|
| 3. |
Click the instance name that ends with +ASM1.

|
| 4. |
See the pie chart on the right. Click the piece of the pie belonging
to ASM DGROUP1 Disk Group.

|
| 5. |
Login to the ASM instance using userid sys/<password> as
SYSDBA. You need to login to the ASM instance because you've selected
a disk group, and disk groups are managed in the ASM instance.

|
| 6. |
View the disks in the disk group. Note that the data is evenly spread
across the four disks.

|
Back to Topic List
To remove a disk from a disk group in an ASM instance,
perform the following steps:
| 1. |
On the page from the last step of the previous topic (the disk listing
for the disk group) select the disk DGROUP1_0002 and then click
Delete.

|
| 2. |
Confirm the delete. Click Yes.
|
| 3. |
Click the Performance tab.

|
| 4. |
Set the Refresh rate (see the top right of the page) to 15 seconds
and observe the graph changes after refreshes.

After the graph changes settle (this may take several minutes) click
the General link in the upper left of the page to go back to the
general disk group information page.

|
| 5. |
Note that the DGROUP1_0002 disk no longer appears in the list. If it
is still there, it should have a "State" of "DROPPING".
Refresh the page until it is removed from the list.

Note that each of the 3 disks now has a greater percentage used. That
is because the data from the dropped disk has been rebalanced onto the
remaining three disks.
|
Back to Topic List
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. Alt-tab to a terminal session
and type the commands below:
cd /home/oracle/wkdir
./pop_t1.sh
|
| 2. |
Note the "Elapsed" timing value for the query at the end. You
will compare this to later query timings.

Keep this window open, sitting at that directory.
|
| 3. |
Go back to the Enterprise Manager page, and click Add Disks.

|
| 4. |
On the left, select the disk that was removed previously, whose path
is "/u02/asmdisks/disk4". (Note that it is the only disk
with a "Header Status" of "FORMER". In the
"ASM Disk Name" column, enter DGROUP1_0002. Leave the
other column values as the default.
Do not click on the OK button yet.

|
| 5. |
Alt-tab back to the terminal window, and run the command below. As soon
as you press <enter> to start this script.
./poll_timing.sh

|
| 6. |
Immediately alt-tab back to the Enterprise Manager page and click on
the OK button.

|
| 7. |
Switch back to the Enterprise Manager window. Click the browser's Reload
button, observing the change in the bar graph for the "Used"
column, for each disk, especially noting the growth in the value for the
disk just added.

Click Reload again.

|
| 8. |
Alt-tab back to the terminal window, and scroll through the timings that
were output for the same query being run while the data was being rebalanced.
Note the change in times for each run. Press ctrl-c to cancel the
script when done.

|
Back to Topic List
In this tutorial, you've learned how to:
 |
Create an ASM Database |
 |
View a Disk Group |
 |
Remove and Add a Disk Group |
Back to Topic List
 |
To learn more about
Oracle Database 10g, refer to additional OBEs on the OTN
Web site. |
 |
To ask a question about this OBE tutorial,
post a query on the OBE
Discussion Forum |
Back to Topic List
|