Manage ASM instance-creating diskgroup,adding/dropping/resizing disks_270066.1

rongshiyuan發表於2015-02-28

Manage ASM instance-creating diskgroup,adding/dropping/resizing disks. (Doc ID 270066.1)


In this Document

Goal
Fix

Applies to:

Oracle Server - Enterprise Edition - Version 10.1.0.2 to 10.2.0.4 [Release 10.1 to 10.2]
Information in this document applies to any platform.
***Checked for relevance on 27-Feb-2011***


Goal

This article will help to understand:
--------------------------------------------------
1.Basic managebility of an ASM Instance
2.Creating diskgroups and Failure groups.
3.Adding,dropping and resizing disks.

Fix

Currently there are 5 disks that are mapped to Raw Partitions,the directory /asmdisks acts as a RAW interface to the parttion in /dev/rdsk



Creating a Disk Group “dg2” with 2 FAILGROUP and 2 DISKS added

SQL> create diskgroup dg2 normal redundancy
2 failgroup f1 disk '/asmdisks/disk5' name disk5
3 failgroup f2 disk '/asmdisks/disk6' name disk6;



SQL> select group_number,disk_number,name,failgroup from v$asm_dis

GROUP_NUMBER DISK_NUMBER NAME
------------ ----------- ------------------------------
FAILGROUP
------------------------------
1 0 DG1_0000
DG1_0000

1 1 DG1_0001
DG1_0001

1 2 DG1_0002
DG1_0002


GROUP_NUMBER DISK_NUMBER NAME
------------ ----------- ------------------------------
FAILGROUP
------------------------------
2 0 DISK5
F1

2 1 DISK6
F2



++Now the above ASM instance has 2 DSKGRP->DG1 and DG2

DG1---&gt3 disks .....every disk it's own failure group
DG2--&gt 2 Disks ......DISK5 in Failure Group F1,DISK6 in Failure Group F2

When adding a disk to a group that is already in a different group(Adding DISK5 ,which is in DG2)to DG1

SQL> alter diskgroup dg1 add disk '/asmdisks/disk5' name som;
alter diskgroup dg1 add disk '/asmdisks/disk5' name som
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15029: disk '/asmdisks/disk5' is already mounted by this instance

Created 1 more disk(disk7) in the RAW Interface
-------------------------------------------

Now, adding disk7 to DG2 in the following format:
------------------------------------------------------
SQL> alter diskgroup dg2 add disk '/asmdisks/disk7' name disk7;

Diskgroup altered.

Dropping disk
=============
SQL> alter diskgroup dg2 drop disk disk7;

Diskgroup altered.

When we drop the last disk from the FAILGRP, the FG automatically drops.

Dropped the disks in a FG, then added a FG with 2 disks:
==========================================================
SQL> alter diskgroup dg2 add failgroup f2 disk '/asmdisks/disk6' name disk6,'/asmdisks/disk7' name disk7;

SQL> select group_number,disk_number,name,failgroup from v$asm_disk;

GROUP_NUMBER DISK_NUMBER NAME
------------ ----------- ------------------------------
FAILGROUP
------------------------------
1 0 DG1_0000
DG1_0000

1 1 DG1_0001
DG1_0001

1 2 DG1_0002
DG1_0002


GROUP_NUMBER DISK_NUMBER NAME
------------ ----------- ------------------------------
FAILGROUP
------------------------------
2 0 DISK5
F1

2 1 DISK6
F2

2 2 DISK7
F2


6 rows selected.



We can drop all the DISKS in a FAILURE GROUP like this:
-------------------------------------------------------

SQL> alter diskgroup dg2 drop disks in failgroup f2;

SQL> select group_number,disk_number,name,failgroup from v$asm_disk;

GROUP_NUMBER DISK_NUMBER NAME
------------ ----------- ------------------------------
FAILGROUP
------------------------------
0 0


0 1


1 0 DG1_0000
DG1_0000


GROUP_NUMBER DISK_NUMBER NAME
------------ ----------- ------------------------------
FAILGROUP
------------------------------
1 1 DG1_0001
DG1_0001

1 2 DG1_0002
DG1_0002

2 0 DISK5
F1


6 rows selected.


Dropping a disk and adding a FG
---------------------------------


SQL> alter diskgroup dg2 drop disk disk5
2 add failgroup f2 disk '/asmdisks/disk6' name disk6,'/asmdisks/disk7' name disk7;


When we try to resize a disk beyond OS Capacity
-------------------------------------------------
SQL> alter diskgroup dg2 resize disk disk5 size 2G;
alter diskgroup dg2 resize disk disk5 size 2G
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15057: specified size of 2048 MB is larger than actual size of 1025 MB

SQL> alter diskgroup dg2 resize disk disk5 size 800M;

Diskgroup altered.

SQL> select name,total_mb,free_mb from v$asm_disk;

NAME TOTAL_MB FREE_MB
------------------------------ ---------- ----------
DG1_0000 1025 277
DG1_0001 1025 260
DG1_0002 1025 312
DISK5 800 750
DISK6 1025 1002
DISK7 1025 996

Resizing all disks in a failgroup
-------------------------------
SQL> alter diskgroup dg2 resize disks in failgroup f2 size 900M;

Diskgroup altered.

SQL> select name,total_mb,free_mb from v$asm_disk;

NAME TOTAL_MB FREE_MB
------------------------------ ---------- ----------
DG1_0000 1025 277
DG1_0001 1025 260
DG1_0002 1025 312
DISK5 800 750
DISK6 900 877
DISK7 900 871


Now deleting the ASM instance(using DBCA) without dismounting the disks in "dg2".The disks still have the diskgroup information in the disk header


SQL> create diskgroup dg2 normal redundancy
2 failgroup f1 disk '/asmdisks1/dsk1' name disk1
3 failgroup f2 disk '/asmdisks1/dsk2' name disk2;
create diskgroup dg2 normal redundancy
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15033: disk '/asmdisks1/dsk2' belongs to diskgroup "DG2"
ORA-15033: disk '/asmdisks1/dsk1' belongs to diskgroup "DG2"

To resolve this,FORCE the disks to mount:
--------------------------------------------------------------

NOW FORCING TO MOUNT:


create diskgroup dg2 normal redundancy
2 failgroup f1 disk '/asmdisks1/dsk1' name disk1 FORCE
3 failgroup f2 disk '/asmdisks1/dsk2' name disk2 FORCE;


 

Document Details

 
Rate this document Email link to this documentOpen document in new windowPrintable Page
Type:
Status:
Last Major Update:
Last Update:
HOWTO
ARCHIVED
22-Aug-2012
22-Aug-2012
     
 

Related Products

 
Oracle Database - Enterprise Edition
     
 

Document References

 
     
 

Recently Viewed

 
     




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1443465/,如需轉載,請註明出處,否則將追究法律責任。

相關文章