[root@localhost ~]# fdisk -l
Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 127 1020096 83 Linux
/dev/sda2 128 318 1534207+ 82 Linux swap
/dev/sda3 319 1566 10024560 83 Linux
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 250 2008093+ 83 Linux
/dev/sdb2 251 500 2008125 83 Linux
/dev/sdb3 501 750 2008125 83 Linux
/dev/sdb4 751 1000 2008125 83 Linux
Disk /dev/sdc: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
[root@localhost ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1044.
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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): +500m
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (63-1044, default 63):
Using default value 63
Last cylinder or +size or +sizeM or +sizeK (63-1044, default 1044): +500m
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (125-1044, default 125):
Using default value 125
Last cylinder or +size or +sizeM or +sizeK (125-1044, default 1044): +500m
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Selected partition 4
First cylinder (187-1044, default 187): 4
Value out of range.
First cylinder (187-1044, default 187):
Using default value 187
Last cylinder or +size or +sizeM or +sizeK (187-1044, default 1044):
Using default value 1044
Command (m for help): n
First cylinder (187-1044, default 187):
Using default value 187
Last cylinder or +size or +sizeM or +sizeK (187-1044, default 1044): +500m
Command (m for help): n
First cylinder (249-1044, default 249):
Using default value 249
Last cylinder or +size or +sizeM or +sizeK (249-1044, default 1044): +500m
Command (m for help): n
First cylinder (311-1044, default 311): +500m
Value out of range.
First cylinder (311-1044, default 311):
Using default value 311
Last cylinder or +size or +sizeM or +sizeK (311-1044, default 1044): +500m
Command (m for help): n
First cylinder (373-1044, default 373):
Using default value 373
Last cylinder or +size or +sizeM or +sizeK (373-1044, default 1044): +500m
Command (m for help): n
First cylinder (435-1044, default 435):
Using default value 435
Last cylinder or +size or +sizeM or +sizeK (435-1044, default 1044): +500m
Command (m for help): n
First cylinder (497-1044, default 497):
Using default value 497
Last cylinder or +size or +sizeM or +sizeK (497-1044, default 1044): +500m
Command (m for help): n
First cylinder (559-1044, default 559):
Using default value 559
Last cylinder or +size or +sizeM or +sizeK (559-1044, default 1044): +500m
Command (m for help): n
First cylinder (621-1044, default 621):
Using default value 621
Last cylinder or +size or +sizeM or +sizeK (621-1044, default 1044): +500m
Command (m for help): n
First cylinder (683-1044, default 683):
Using default value 683
Last cylinder or +size or +sizeM or +sizeK (683-1044, default 1044): +500m
Command (m for help): n
First cylinder (745-1044, default 745):
Using default value 745
Last cylinder or +size or +sizeM or +sizeK (745-1044, default 1044): +500m
Command (m for help): n
First cylinder (807-1044, default 807):
Using default value 807
Last cylinder or +size or +sizeM or +sizeK (807-1044, default 1044): +500m
Command (m for help): n
First cylinder (869-1044, default 869):
Using default value 869
Last cylinder or +size or +sizeM or +sizeK (869-1044, default 1044): +500m
Command (m for help): n
The maximum number of partitions has been created
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# partprobe
Error: Error informing the kernel about modifications to partition /dev/sdc16 - Invalid argument. This means Linux won't know about any changes you made to /dev/sdc16 until you reboot - so you shouldn't mount it or use it in any way before rebooting.
No changes made to disk, exiting partprobe.
Error: Error adding partition 16: Invalid argument
No changes made to disk, exiting partprobe.
[root@localhost ~]# fdisk -l
Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 127 1020096 83 Linux
/dev/sda2 128 318 1534207+ 82 Linux swap
/dev/sda3 319 1566 10024560 83 Linux
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 250 2008093+ 83 Linux
/dev/sdb2 251 500 2008125 83 Linux
/dev/sdb3 501 750 2008125 83 Linux
/dev/sdb4 751 1000 2008125 83 Linux
Disk /dev/sdc: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 62 497983+ 83 Linux
/dev/sdc2 63 124 498015 83 Linux
/dev/sdc3 125 186 498015 83 Linux
/dev/sdc4 187 1044 6891885 5 Extended
/dev/sdc5 187 248 497983+ 83 Linux
/dev/sdc6 249 310 497983+ 83 Linux
/dev/sdc7 311 372 497983+ 83 Linux
/dev/sdc8 373 434 497983+ 83 Linux
/dev/sdc9 435 496 497983+ 83 Linux
/dev/sdc10 497 558 497983+ 83 Linux
/dev/sdc11 559 620 497983+ 83 Linux
/dev/sdc12 621 682 497983+ 83 Linux
/dev/sdc13 683 744 497983+ 83 Linux
/dev/sdc14 745 806 497983+ 83 Linux
/dev/sdc15 807 868 497983+ 83 Linux
/dev/sdc16 869 930 497983+ 83 Linux
[root@localhost ~]# partprobe
Error: Error informing the kernel about modifications to partition /dev/sdc16 - Invalid argument. This means Linux won't know about any changes you made to /dev/sdc16 until you reboot - so you shouldn't mount it or use it in any way before rebooting.
No changes made to disk, exiting partprobe.
Error: Error adding partition 16: Invalid argument
No changes made to disk, exiting partprobe.
[root@localhost ~]# fdisk /dev/sdc
The number of cylinders for this disk is set to 1044.
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): d
Partition number (1-16): 16
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# partprobe
[root@localhost ~]# fdisk -l
Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 127 1020096 83 Linux
/dev/sda2 128 318 1534207+ 82 Linux swap
/dev/sda3 319 1566 10024560 83 Linux
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 250 2008093+ 83 Linux
/dev/sdb2 251 500 2008125 83 Linux
/dev/sdb3 501 750 2008125 83 Linux
/dev/sdb4 751 1000 2008125 83 Linux
Disk /dev/sdc: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 62 497983+ 83 Linux
/dev/sdc2 63 124 498015 83 Linux
/dev/sdc3 125 186 498015 83 Linux
/dev/sdc4 187 1044 6891885 5 Extended
/dev/sdc5 187 248 497983+ 83 Linux
/dev/sdc6 249 310 497983+ 83 Linux
/dev/sdc7 311 372 497983+ 83 Linux
/dev/sdc8 373 434 497983+ 83 Linux
/dev/sdc9 435 496 497983+ 83 Linux
/dev/sdc10 497 558 497983+ 83 Linux
/dev/sdc11 559 620 497983+ 83 Linux
/dev/sdc12 621 682 497983+ 83 Linux
/dev/sdc13 683 744 497983+ 83 Linux
/dev/sdc14 745 806 497983+ 83 Linux
/dev/sdc15 807 868 497983+ 83 Linux
[root@localhost ~]#
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 04:00:52 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysDBA
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ export ORACLE_SID=orcl
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 04:01:33 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 67111156 bytes
Database Buffers 96468992 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> desc v$asm_disk;
Name Null? Type
----------------------------------------- -------- ---------------------------- GROUP_NUMBER NUMBER
DISK_NUMBER NUMBER
COMPOUND_INDEX NUMBER
INCARNATION NUMBER
MOUNT_STATUS VARCHAR2(7)
HEADER_STATUS VARCHAR2(12)
MODE_STATUS VARCHAR2(7)
STATE VARCHAR2(8)
REDUNDANCY VARCHAR2(7)
LIBRARY VARCHAR2(64)
TOTAL_MB NUMBER
FREE_MB NUMBER
NAME VARCHAR2(30)
FAILGROUP VARCHAR2(30)
LABEL VARCHAR2(31)
PATH VARCHAR2(256)
UDID VARCHAR2(64)
PRODUCT VARCHAR2(32)
CREATE_DATE DATE
MOUNT_DATE DATE
REPAIR_TIMER NUMBER
READS NUMBER
WRITES NUMBER
READ_ERRS NUMBER
WRITE_ERRS NUMBER
READ_TIME NUMBER
WRITE_TIME NUMBER
BYTES_READ NUMBER
BYTES_WRITTEN NUMBER
SQL> select group_number,disk_number from v$asm_disk;
GROUP_NUMBER DISK_NUMBER
------------ -----------
2 0
3 0
1 0
SQL> desc v$asm_diskgroup;
Name Null? Type
----------------------------------------- -------- ---------------------------- GROUP_NUMBER NUMBER
NAME VARCHAR2(30)
SECTOR_SIZE NUMBER
BLOCK_SIZE NUMBER
ALLOCATION_UNIT_SIZE NUMBER
STATE VARCHAR2(11)
TYPE VARCHAR2(6)
TOTAL_MB NUMBER
FREE_MB NUMBER
REQUIRED_MIRROR_FREE_MB NUMBER
USABLE_FILE_MB NUMBER
OFFLINE_DISKS NUMBER
UNBALANCED VARCHAR2(1)
COMPATIBILITY VARCHAR2(60)
DATABASE_COMPATIBILITY VARCHAR2(60)
SQL> select group_number,name from v$asm_diskgroup;
GROUP_NUMBER NAME
------------ ------------------------------
1 DATA
2 DGLOG1
3 DGLOG2
4 RECOVERY
SQL> select group_number,name,type,total_mb,free_mb,total_mb-free_mb
2 from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB
------------ ------------------------------ ------ ---------- ----------
TOTAL_MB-FREE_MB
----------------
1 DATA EXTERN 1961 546
1415
2 DGLOG1 EXTERN 1961 1734
227
3 DGLOG2 EXTERN 1961 1734
227
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB
------------ ------------------------------ ------ ---------- ----------
TOTAL_MB-FREE_MB
----------------
4 RECOVERY EXTERN 1961 1881
80
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
[oracle@localhost ~]$ ps -ef | grep css
root 6959 1 0 03:51 ? 00:00:00 /bin/su -l oracle -c sh -c 'cd /u01/app/oracle/product/10.2.0/db_1/log/localhost/cssd; ulimit -c unlimited; exec /u01/app/oracle/product/10.2.0/db_1/bin/ocssd '
oracle 8145 6959 0 03:52 ? 00:00:00 /u01/app/oracle/product/10.2.0/db_1/bin/ocssd.bin
oracle 13674 12599 0 04:08 pts/1 00:00:00 grep css
[oracle@localhost ~]$ /etc/init.d/oracleasm createdisk VOL5 /dev/sdc1;
Marking disk "VOL5" as an ASM disk: /etc/init.d/oracleasm: line 242: /var/log/oracleasm: Permission denied
[FAILED]
[oracle@localhost ~]$ su - root
Password:
[root@localhost ~]# /etc/init.d/oracleasm createdisk VOL5 /dev/sdc1
Marking disk "VOL5" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk VOL6 /dev/sdc2
Marking disk "VOL6" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk VOL7 /dev/sdc3
Marking disk "VOL7" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk VOL8 /dev/sdc5
Marking disk "VOL8" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk VOL9 /dev/sdc6
Marking disk "VOL9" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk VOL10 /dev/sdc7
Marking disk "VOL10" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL10
VOL2
VOL3
VOL4
VOL5
VOL6
VOL7
VOL8
VOL9
[root@localhost ~]#
create diskgroup dgroup1 normal redundancy
failgroup fgroup1 disk 'ORCL:VOL5','ORCL:VOL6'
failgroup fgroup2 disk 'ORCL:VOL7';
alter diskgroup dgroup1 dismount;
alter diskgroup dgroup1 mount;
alter diskgroup dgroup1 add failgroup fgroup2 disk 'ORCL:VOL8';
ALTER DISKGROUP DATA REBALANCE POWER 11 WAIT;
alter diskgroup dgroup1 drop disk 'VOL5';
alter diskgroup DATA add disk 'ORCL:VOL5';
alter diskgroup DATA drop disk 'VOL5';
ALTER DISKGROUP DATA REBLANCE POWER 11 WAIT;
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 04:16:06 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> create diskgroup dgroup1 normal redundancy
failgroup fgroup1 disk 'ORCL:VOL5','ORCL:VOL6'
failgroup fgroup2 disk 'ORCL:VOL7'; 2 3
Diskgroup created.
SQL> select name,type from v$asm_diskgroup;
NAME TYPE
------------------------------ ------
DATA EXTERN
DGLOG1 EXTERN
DGLOG2 EXTERN
RECOVERY EXTERN
DGROUP1 NORMAL
SQL> select name,type,state from v$asm_diskgroup;
NAME TYPE STATE
------------------------------ ------ -----------
DATA EXTERN MOUNTED
DGLOG1 EXTERN MOUNTED
DGLOG2 EXTERN MOUNTED
RECOVERY EXTERN MOUNTED
DGROUP1 NORMAL MOUNTED
SQL> alter diskgroup dgroup1 dismount;
Diskgroup altered.
SQL> l
1* alter diskgroup dgroup1 dismount
SQL> select name,type from v$asm_diskgroup;
NAME TYPE
------------------------------ ------
DATA EXTERN
DGLOG1 EXTERN
DGLOG2 EXTERN
RECOVERY EXTERN
DGROUP1
SQL> alter diskgroup dgroup1 mount;
Diskgroup altered.
SQL> select name,type from v$asm_diskgroup;
NAME TYPE
------------------------------ ------
DATA EXTERN
DGLOG1 EXTERN
DGLOG2 EXTERN
RECOVERY EXTERN
DGROUP1 NORMAL
SQL> alter diskgroup dgroup1 add failgroup fgroup2 disk 'ORCL:VOL8';
Diskgroup altered.
SQL> desc v$asm_disk;
Name Null? Type
----------------------------------------- -------- ---------------------------- GROUP_NUMBER NUMBER
DISK_NUMBER NUMBER
COMPOUND_INDEX NUMBER
INCARNATION NUMBER
MOUNT_STATUS VARCHAR2(7)
HEADER_STATUS VARCHAR2(12)
MODE_STATUS VARCHAR2(7)
STATE VARCHAR2(8)
REDUNDANCY VARCHAR2(7)
LIBRARY VARCHAR2(64)
TOTAL_MB NUMBER
FREE_MB NUMBER
NAME VARCHAR2(30)
FAILGROUP VARCHAR2(30)
LABEL VARCHAR2(31)
PATH VARCHAR2(256)
UDID VARCHAR2(64)
PRODUCT VARCHAR2(32)
CREATE_DATE DATE
MOUNT_DATE DATE
REPAIR_TIMER NUMBER
READS NUMBER
WRITES NUMBER
READ_ERRS NUMBER
WRITE_ERRS NUMBER
READ_TIME NUMBER
WRITE_TIME NUMBER
BYTES_READ NUMBER
BYTES_WRITTEN NUMBER
SQL> col path for a20;
SQL> r
1* select group_number,path from v$asm_disk
GROUP_NUMBER PATH
------------ --------------------
0 ORCL:VOL10
0 ORCL:VOL9
1 ORCL:VOL1
4 ORCL:VOL2
2 ORCL:VOL3
3 ORCL:VOL4
5 ORCL:VOL5
5 ORCL:VOL6
5 ORCL:VOL7
5 ORCL:VOL8
10 rows selected.
SQL> select name,group_number,path from v$asm_disk;
NAME GROUP_NUMBER PATH
------------------------------ ------------ --------------------
0 ORCL:VOL10
0 ORCL:VOL9
VOL1 1 ORCL:VOL1
VOL2 4 ORCL:VOL2
VOL3 2 ORCL:VOL3
VOL4 3 ORCL:VOL4
VOL5 5 ORCL:VOL5
VOL6 5 ORCL:VOL6
VOL7 5 ORCL:VOL7
VOL8 5 ORCL:VOL8
10 rows selected.
SQL> alter diskgroup dgroup1 drop disk 'VOL5';
Diskgroup altered.
SQL> select name,group_number,path from v$asm_disk;
NAME GROUP_NUMBER PATH
------------------------------ ------------ --------------------
0 ORCL:VOL10
0 ORCL:VOL5
0 ORCL:VOL9
VOL1 1 ORCL:VOL1
VOL2 4 ORCL:VOL2
VOL3 2 ORCL:VOL3
VOL4 3 ORCL:VOL4
VOL6 5 ORCL:VOL6
VOL7 5 ORCL:VOL7
VOL8 5 ORCL:VOL8
10 rows selected.
SQL> alter diskgroup DATA add disk 'ORCL:VOL5';
Diskgroup altered.
SQL> select name,group_number,path from v$asm_disk;
NAME GROUP_NUMBER PATH
------------------------------ ------------ --------------------
0 ORCL:VOL10
0 ORCL:VOL9
VOL1 1 ORCL:VOL1
VOL2 4 ORCL:VOL2
VOL3 2 ORCL:VOL3
VOL4 3 ORCL:VOL4
VOL6 5 ORCL:VOL6
VOL7 5 ORCL:VOL7
VOL8 5 ORCL:VOL8
VOL5 1 ORCL:VOL5
10 rows selected.
SQL> desc v$asm_operation;
Name Null? Type
----------------------------------------- -------- ---------------------------- GROUP_NUMBER NUMBER
OPERATION VARCHAR2(5)
STATE VARCHAR2(4)
POWER NUMBER
ACTUAL NUMBER
SOFAR NUMBER
EST_WORK NUMBER
EST_RATE NUMBER
EST_MINUTES NUMBER
SQL> select operation from v$asm_operation;
no rows selected
SQL> ALTER DISKGROUP DATA REBALANCE POWER 11 WAIT;
Diskgroup altered.
SQL> alter diskgroup DATA drop disk 'VOL5';
Diskgroup altered.
SQL> select name,group_number,path from v$asm_disk;
NAME GROUP_NUMBER PATH
------------------------------ ------------ --------------------
0 ORCL:VOL10
0 ORCL:VOL5
0 ORCL:VOL9
VOL1 1 ORCL:VOL1
VOL2 4 ORCL:VOL2
VOL3 2 ORCL:VOL3
VOL4 3 ORCL:VOL4
VOL6 5 ORCL:VOL6
VOL7 5 ORCL:VOL7
VOL8 5 ORCL:VOL8
10 rows selected.
SQL> ALTER DISKGROUP DATA REBALANCE POWER 11 WAIT;
Diskgroup altered.
SQL>
[root@localhost ~]# vi /etc/sysconfig/rawdevices
[root@localhost ~]# cat /etc/sysconfig/rawdevices |grep ^[^#]
/dev/raw/raw1 /dev/sdc8
/dev/raw/raw2 /dev/sdc9
/dev/raw/raw3 /dev/sdc10
/dev/raw/raw4 /dev/sdc11
/dev/raw/raw5 /dev/sdc12
/dev/raw/raw6 /dev/sdc13
/dev/raw/raw7 /dev/sdc14
/dev/raw/raw8 /dev/sdc15
[root@localhost ~]# vi /etc/udev/permissions.d/50-udev.permissions
[root@localhost ~]# cat /etc/udev/permissions.d/50-udev.permissions |grep raw
# raw devices
raw*racle:dba:0660
raw/*racle:dba:0660
[root@localhost ~]# service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdc8
/dev/raw/raw1: bound to major 8, minor 40
/dev/raw/raw2 --> /dev/sdc9
/dev/raw/raw2: bound to major 8, minor 41
/dev/raw/raw3 --> /dev/sdc10
/dev/raw/raw3: bound to major 8, minor 42
/dev/raw/raw4 --> /dev/sdc11
/dev/raw/raw4: bound to major 8, minor 43
/dev/raw/raw5 --> /dev/sdc12
/dev/raw/raw5: bound to major 8, minor 44
/dev/raw/raw6 --> /dev/sdc13
/dev/raw/raw6: bound to major 8, minor 45
/dev/raw/raw7 --> /dev/sdc14
/dev/raw/raw7: bound to major 8, minor 46
/dev/raw/raw8 --> /dev/sdc15
/dev/raw/raw8: bound to major 8, minor 47
done
[root@localhost ~]# chkconfig --level 2345 rawdevices on
[root@localhost ~]#
create diskgroup dgroup2 normal redundancy
failgroup fgroup1 disk '/dev/raw/raw1','/dev/raw/raw3'
failgroup fgroup2 disk '/dev/raw/raw2','/dev/raw/raw4';
[root@localhost ~]# export ORACLE_SID=+ASM
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 05:22:20 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ export ORACLE_SID=orcl
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 05:22:47 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 67111156 bytes
Database Buffers 96468992 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> show parameter asm
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------asm_diskgroups string
asm_diskstring string
asm_power_limit integer 1
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 05:23:40 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
+ASM
SQL> show parameter asm
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------asm_diskgroups string DATA, RECOVERY, DGLOG1, DGLOG2 , DGROUP1
asm_diskstring string ORCL:VOL*
asm_power_limit integer 3
SQL> alter system set asm_diskstring='ORCL:VOL*','/dev/raw/raw*' scope=spfile;
System altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ export ORACLE_SID=orcl
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 05:25:19 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 28 05:27:37 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> shutdown immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> show parameter asm
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------asm_diskgroups string DATA, RECOVERY, DGLOG1, DGLOG2 , DGROUP1
asm_diskstring string ORCL:VOL*, /dev/raw/raw*
asm_power_limit integer 3
SQL> create diskgroup dgroup2 normal redundancy
failgroup fgroup1 disk '/dev/raw/raw1','/dev/raw/raw3'
failgroup fgroup2 disk '/dev/raw/raw2','/dev/raw/raw4'; 2 3
Diskgroup created.
SQL> select name,group_number,path from v$asm_disk;
NAME GROUP_NUMBER
------------------------------ ------------
PATH
--------------------------------------------------------------------------------
0
ORCL:VOL10
0
ORCL:VOL5
0
ORCL:VOL9
NAME GROUP_NUMBER
------------------------------ ------------
PATH
--------------------------------------------------------------------------------
0
/dev/raw/raw8
0
/dev/raw/raw7
0
/dev/raw/raw5
NAME GROUP_NUMBER
------------------------------ ------------
PATH
--------------------------------------------------------------------------------
0
/dev/raw/raw6
VOL1 1
ORCL:VOL1
VOL2 5
ORCL:VOL2
NAME GROUP_NUMBER
------------------------------ ------------
PATH
--------------------------------------------------------------------------------
VOL3 2
ORCL:VOL3
VOL4 3
ORCL:VOL4
VOL6 4
ORCL:VOL6
NAME GROUP_NUMBER
------------------------------ ------------
PATH
--------------------------------------------------------------------------------
VOL7 4
ORCL:VOL7
VOL8 4
ORCL:VOL8
DGROUP2_0003 6
/dev/raw/raw4
NAME GROUP_NUMBER
------------------------------ ------------
PATH
--------------------------------------------------------------------------------
DGROUP2_0001 6
/dev/raw/raw3
DGROUP2_0002 6
/dev/raw/raw2
DGROUP2_0000 6
/dev/raw/raw1
18 rows selected.
SQL> col path for a20;
SQL> r
1* select name,group_number,path from v$asm_disk
NAME GROUP_NUMBER PATH
------------------------------ ------------ --------------------
0 ORCL:VOL10
0 ORCL:VOL5
0 ORCL:VOL9
0 /dev/raw/raw8
0 /dev/raw/raw7
0 /dev/raw/raw5
0 /dev/raw/raw6
VOL1 1 ORCL:VOL1
VOL2 5 ORCL:VOL2
VOL3 2 ORCL:VOL3
VOL4 3 ORCL:VOL4
NAME GROUP_NUMBER PATH
------------------------------ ------------ --------------------
VOL6 4 ORCL:VOL6
VOL7 4 ORCL:VOL7
VOL8 4 ORCL:VOL8
DGROUP2_0003 6 /dev/raw/raw4
DGROUP2_0001 6 /dev/raw/raw3
DGROUP2_0002 6 /dev/raw/raw2
DGROUP2_0000 6 /dev/raw/raw1
18 rows selected.
SQL>
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
DGLOG1 MOUNTED
DGLOG2 MOUNTED
DGROUP1 MOUNTED
RECOVERY MOUNTED
DGROUP2 MOUNTED
6 rows selected.
*****************************************************************************************************
利用dbca创建oracle数据库.
注意需要选择asm存放。
此处需要考虑到有的时候找不到dgroup1组,需要输入密码创建,总是提示spfile正在使用,此时可以采用
关闭+ASM实例(shutdown immediate),在重试就行了
|
|