Home » RDBMS Server » Server Administration » How do I add disk to ASM diskgroup? (Oracle 10.2.0.5, RHEL 5)
How do I add disk to ASM diskgroup? [message #510805] |
Tue, 07 June 2011 21:52 |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Dear!
This is the first time I must do this: Resize or add disk in ASM. So, I will do it on production, and I need your guide.
Let me describe something.
- The storage has partitions like:
- And now, the size of ASM disk was full
Because I've not ever done for adding disk to diskgroup, then I list the tasks here, wish you help me to verify.
Step 1- Format the storage, add partitions (I will create 4 partitions of 120gb, 1 partitions 60gb, 1 partitions 27gb).
Step 2- Add the rawdevice in /etc/sysconfig/rawdevices
In the picture here, I'll not just add rawdevice in /etc/sysconfig/rawdevices. So I'll do:
add lines in /etc/sysconfig/rawdevices
/dev/raw/raw7 /dev/cciss/c0d1p9
/dev/raw/raw8 /dev/cciss/c0d1p10
/dev/raw/raw9 /dev/cciss/c0d1p11
/dev/raw/raw10 /dev/cciss/c0d1p12
restart rawdevices service to bind in asm
# service rawdevices stop
# service rawdevices start
change owner to oracle
# chown oracle:oinstall /dev/dev/raw*
# chmod 640 /dev/raw/raw*
Step 3- Add disk by /etc/init.d/oracleasm create disk
Step 4- Add in CSS ( # $ORACLE_HOME/bin/localconfig add).
Step 5- Verify disk: /etc/init.d/oracleasm scandisks
Are my steps right?
And I do not know how to do continue after step 5.
May you help me?
Thank you very much!
[Updated on: Tue, 07 June 2011 21:59] Report message to a moderator
|
|
|
|
Re: How do I add disk to ASM diskgroup? [message #510816 is a reply to message #510809] |
Tue, 07 June 2011 23:03 |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Dear Michel!
First, thank you for your reply.
Second, let me do a brief in text.
My purpose is:
+ Adding disk to one diskgroup exists.
Question: Why do I add disk?
Answer: Because the exists diskgroup was small.
Question: How about diskgroup size?
Answer:
- I have got 6 disks, one disk as one rawdevices, per rawdevices was 17gb.
sys@+ASM> /
DISK_GROUP_N DISK_FILE_PATH DISK_FILE_NAME DISK_FILE_FAIL_GROUP
------------ -------------------- ------------------------------ ------------------------------
DATA ORCL:DATA1 DATA1 DATA1
DATA ORCL:DATA2 DATA2 DATA2
DATA ORCL:DATA6 DATA6 DATA6
DATA ORCL:DATA4 DATA4 DATA4
DATA ORCL:DATA5 DATA5 DATA5
DATA ORCL:DATA3 DATA3 DATA3
$ export ORACLE_SID=+ASM
$ asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED NORMAL N N 512 4096 1048576 137382 15344 22897 -3776 0 DATA/
The total diskgroup was 137382Mb.
Question: How will I do to add rawdevice to exists disk?
Answer: I follow this tasks.
Step 1: Adding partitions in storage.
root@cloudsme sysconfig]# fdisk /dev/cciss/c0d1
The number of cylinders for this disk is set to 109434.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/cciss/c0d1: 900.1 GB, 900129153024 bytes
255 heads, 63 sectors/track, 109434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 * 1 8924 71681998+ 83 Linux
/dev/cciss/c0d1p2 8925 13003 32764567+ 83 Linux
/dev/cciss/c0d1p3 13004 14150 9213277+ 83 Linux
/dev/cciss/c0d1p4 14151 109434 765368730 5 Extended
/dev/cciss/c0d1p5 14151 15297 9213246 83 Linux
/dev/cciss/c0d1p6 15298 18216 23446836 83 Linux
/dev/cciss/c0d1p7 18217 21135 23446836 83 Linux
/dev/cciss/c0d1p8 21136 24054 23446836 83 Linux
Command (m for help): n
First cylinder (24055-109434, default 24055):
Using default value 24055
Last cylinder or +size or +sizeM or +sizeK (24055-109434, default 109434): +102400M
.....
Command (m for help): p
Disk /dev/cciss/c0d1: 900.1 GB, 900129153024 bytes
255 heads, 63 sectors/track, 109434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 * 1 8924 71681998+ 83 Linux
/dev/cciss/c0d1p2 8925 13003 32764567+ 83 Linux
/dev/cciss/c0d1p3 13004 14150 9213277+ 83 Linux
/dev/cciss/c0d1p4 14151 109434 765368730 5 Extended
/dev/cciss/c0d1p5 14151 15297 9213246 83 Linux
/dev/cciss/c0d1p6 15298 18216 23446836 83 Linux
/dev/cciss/c0d1p7 18217 21135 23446836 83 Linux
/dev/cciss/c0d1p8 21136 24054 23446836 83 Linux
/dev/cciss/c0d1p9 24055 36504 100004593+ 83 Linux
/dev/cciss/c0d1p10 36505 48954 100004593+ 83 Linux
/dev/cciss/c0d1p11 48955 61404 100004593+ 83 Linux
/dev/cciss/c0d1p12 61405 73854 100004593+ 83 Linux
/dev/cciss/c0d1p13 73855 86304 100004593+ 83 Linux
/dev/cciss/c0d1p14 86305 98754 100004593+ 83 Linux
Command (m for help):
Step 2: After I create 6 partitions, 100gb per, I will add in /etc/sysconfig/rawdevice as:
[root@cloudsme sysconfig]# cat rawdevices
# raw device bindings
# format: <rawdev> <major> <minor>
# <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/cciss/c0d0p8
/dev/raw/raw2 /dev/cciss/c0d0p9
/dev/raw/raw3 /dev/cciss/c0d0p10
/dev/raw/raw4 /dev/cciss/c0d1p6
/dev/raw/raw5 /dev/cciss/c0d1p7
/dev/raw/raw6 /dev/cciss/c0d1p8
/dev/raw/raw7 /dev/cciss/c0d1p9
/dev/raw/raw8 /dev/cciss/c0d1p10
/dev/raw/raw9 /dev/cciss/c0d1p11
/dev/raw/raw10 /dev/cciss/c0d1p12
/dev/raw/raw11 /dev/cciss/c0d1p13
/dev/raw/raw12 /dev/cciss/c0d1p14
Step 3: Restart service rawdevices
Before restart service rawdevices, do I need to shutdown database and ASM instance?
# service rawdevice restart
Step 4: Change owner
# chown oracle:dba /dev/raw/raw*
# chmod 600 /dev/raw/raw*
Step 5: Add disk:
# oracleasm createdisk DATA7 /dev/cciss/c0d1p9
# oracleasm createdisk DATA8 /dev/cciss/c0d1p10
# oracleasm createdisk DATA9 /dev/cciss/c0d1p11
# oracleasm createdisk DATA10 /dev/cciss/c0d1p12
# oracleasm createdisk DATA11 /dev/cciss/c0d1p13
# oracleasm createdisk DATA12 /dev/cciss/c0d1p14
# oracleasm listdisks
Step 6: Add information to CSS
And, please help me to verify:
- My tasks list are right?
- What will I do next?
Thank you very much!
|
|
|
Re: How do I add disk to ASM diskgroup? [message #510863 is a reply to message #510816] |
Wed, 08 June 2011 02:34 |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Well, I try to do it in a test machine, then I briefed now.
1- Create some partitions
[root@ttud bin]# fdisk -l /dev/hda
Disk /dev/hda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 64 514048+ 83 Linux
/dev/hda2 65 7713 61440592+ 83 Linux
/dev/hda3 7714 12812 40957717+ 83 Linux
/dev/hda4 12813 38913 209656282+ 5 Extended
/dev/hda5 12813 13959 9213246 83 Linux
/dev/hda6 13960 15106 9213246 83 Linux
/dev/hda7 15107 16253 9213246 83 Linux
/dev/hda8 16254 17018 6144831 83 Linux
/dev/hda9 17019 17528 4096543+ 82 Linux swap / Solaris
/dev/hda10 17529 20933 27350631 83 Linux
/dev/hda11 20934 24338 27350631 83 Linux
/dev/hda12 24339 27743 27350631 83 Linux
/dev/hda13 27744 31148 27350631 83 Linux
/dev/hda14 31149 32608 11727418+ 83 Linux
/dev/hda15 32609 34068 11727418+ 83 Linux
[root@ttud bin]#
2 new partitions will be created /dev/hda14 & /dev/hda15, per partition was 12gb.
2- Add in /etc/sysconfig/rawdevices
[root@ttud bin]# cat /etc/sysconfig/rawdevices
# raw device bindings
# format: <rawdev> <major> <minor>
# <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/hda10
/dev/raw/raw2 /dev/hda11
/dev/raw/raw3 /dev/hda12
/dev/raw/raw4 /dev/hda13
/dev/raw/raw5 /dev/hda14
/dev/raw/raw6 /dev/hda15
3- Change owner to oracle, restart service to bind rawdevice
# chown oracle:dba /dev/raw/raw*
# chmod 640 /dev/raw/raw*
# service rawdevices restart
Note: I restart rawdevice service without shutting down ASM instance or Database.
4- Binding disk
[root@ttud sysconfig]# oracleasm createdisk DATA5
Usage: oracleasm-createdisk [-l <manager>] [-v] <label> <device>
[root@ttud sysconfig]# oracleasm createdisk DATA5 /dev/hda14
Writing disk header: done
Instantiating disk: done
[root@ttud sysconfig]# oracleasm createdisk DATA6 /dev/hda15
Writing disk header: done
Instantiating disk: done
[root@ttud sysconfig]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@ttud sysconfig]# oracleasm listdisks
DATA1
DATA2
DATA3
DATA4
DATA5
DATA6
5- Add disk to diskgroup
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
idle> alter diskgroup data add disk '/dev/raw/raw14';
Database altered.
idle> alter diskgroup data add disk '/dev/raw/raw15';
Database altered.
6- Verify balance in asm operations
idle> SELECT group_number, operation, state, power, est_minutes FROM v$asm_operation;
GROUP_NUMBER OPERA STAT POWER EST_MINUTES
------------ ----- ---- ---------- -----------
1 REBAL RUN 1 10
idle> col disk_group_name format a20
col disk_file_path format a20
col disk_file_name format a20
col disk_file_fail_group format a25idle> idle> idle>
idle> SELECT
2 NVL(a.name, '[CANDIDATE]') disk_group_name
3 , b.path disk_file_path
4 , b.name disk_file_name
5 , b.failgroup disk_file_fail_group
6 FROM
7 v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
8 ORDER BY
9 a.name;
DISK_GROUP_NAME DISK_FILE_PATH DISK_FILE_NAME DISK_FILE_FAIL_GROUP
-------------------- -------------------- -------------------- -------------------------
DATA ORCL:DATA2 DATA2 DATA2
DATA /dev/raw/raw6 DATA_0005 DATA_0005
DATA ORCL:DATA1 DATA1 DATA1
DATA /dev/raw/raw5 DATA_0004 DATA_0004
DATA ORCL:DATA3 DATA3 DATA3
DATA ORCL:DATA4 DATA4 DATA4
[CANDIDATE] ORCL:DATA6
[CANDIDATE] ORCL:DATA5
8 rows selected.
after 10minutes, I retried to verify
idle> SELECT group_number, operation, state, power, est_minutes FROM v$asm_operation;
GROUP_NUMBER OPERA STAT POWER EST_MINUTES
------------ ----- ---- ---------- -----------
1 REBAL RUN 1 5
idle> /
no rows selected
idle> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
OKie!
Thank you for your looking.
I am a newbie to ASM, I often work with tuning data, tuning sql, and I'd got a few time to configure, installation or building. So, may I ask something ASM:
1- What is the FAIL_DISK_GROUP? What does it do?
2- How the ASM mirrors between 2 controller in Normal redundancy?
3- In document, I see the example:
SQL> ALTER DISKGROUP testdb_data1 ADD
2 FAILGROUP controller1 DISK '/dev/raw/raw5'
3 FAILGROUP controller2 DISK '/dev/raw/raw6' REBALANCE POWER 11;
Diskgroup altered.
What is the "REBALANCE POWER 11"?
Thank you!
|
|
|
|
Re: How do I add disk to ASM diskgroup? [message #510866 is a reply to message #510864] |
Wed, 08 June 2011 02:43 |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Michel Cadot wrote on Wed, 08 June 2011 14:36It indicates to ASM how many processes it will use to rebalance the blocks all over the disks including the new ones.
Regards
Michel
Michel!
Wish the best day to you!
In the document's example which issue the fail_group by "controller1". But, in my test machine (I create normal redundancy), when the re-balance operation finished, I found 2 CANDIDATE in ASM right now. Please explain to me:
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Jun 8 14:45:42 2011
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
idle> col disk_group_name format a20
col disk_file_path format a20
col disk_file_name format a20
col disk_file_fail_group format a25idle> idle> idle>
idle> SELECT
2 NVL(a.name, '[CANDIDATE]') disk_group_name
3 , b.path disk_file_path
4 , b.name disk_file_name
5 , b.failgroup disk_file_fail_group
6 FROM
7 v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
8 ORDER BY
9 a.name;
DISK_GROUP_NAME DISK_FILE_PATH DISK_FILE_NAME DISK_FILE_FAIL_GROUP
-------------------- -------------------- -------------------- -------------------------
DATA ORCL:DATA2 DATA2 DATA2
DATA /dev/raw/raw6 DATA_0005 DATA_0005
DATA ORCL:DATA1 DATA1 DATA1
DATA /dev/raw/raw5 DATA_0004 DATA_0004
DATA ORCL:DATA3 DATA3 DATA3
DATA ORCL:DATA4 DATA4 DATA4
[CANDIDATE] ORCL:DATA6
[CANDIDATE] ORCL:DATA5
8 rows selected.
idle>
|
|
|
Goto Forum:
Current Time: Sun Dec 01 12:28:23 CST 2024
|