Prepare the environment:
Oracle 10g online documentation, host with 10g database software configured, oracleasm library rpm package, 2 5 Gb hard disks
1. View local disk Information
[Root @ shiyueasm ~] # Fdisk-l
Disk/dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Device Boot Start End Blocks Id System
/Dev/sda1*307 1958 13269690 83 Linux
/Dev/sda2 1 306 2457913 + 82 Linux swap
Partitiontable entries are not in disk order
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 1305 10482381 83 Linux
Disk/dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/sdc doesn' t contain a valid partition table
Disk/dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/sdd doesn't contain a validpartition table
2. Partition the two newly added disks.
[Root @ shiyueasm ~] # Fdisk/dev/sdc
Devicecontains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Buildinga new DOS disklabel. Changes will remain in memory only,
Until youdecide to write them. After that, of course, the previous
Contentwon't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite)
Command (m for help): n
Commandaction
E extended
P primary partition (1-4)
P
Partitionnumber (1-4): 1
Firstcylinder (1-652, default 1 ):
Usingdefault value 1
Lastcylinder or + size or + sizeM or + sizeK (1-652, default 652 ):
Usingdefault value 652
Command (m for help): w
Thepartition table has been altered!
Callingioctl () to re-read partition table.
Syncingdisks.
[Root @ shiyueasm ~] # Fdisk/dev/sdd
Devicecontains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Buildinga new DOS disklabel. Changes will remain in memory only,
Until youdecide to write them. After that, of course, the previous
Contentwon't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite)
Command (m for help): n
Commandaction
E extended
P primary partition (1-4)
P
Partitionnumber (1-4): 1
Firstcylinder (1-652, default 1 ):
Usingdefault value 1
Lastcylinder or + size or + sizeM or + sizeK (1-652, default 652 ):
Usingdefault value 652
Command (m for help): w
Thepartition table has been altered!
Callingioctl () to re-read partition table.
Syncing disks.
3. Upload the oracle asmlibrary rpm package and install the uploaded package
[Root @ shiyueasmu01] # cd asm \ rpm \ for \ rhel4.0/
[Root @ shiyueasmasm rpm for rhel4.0] # ll
Total 236
-Rw-r -- 1 root 129218 Apr 29 2010oracleasm-2.6.9-42.ELsmp-2.0.3-1.i686.rpm
-Rw-r -- 1 root 13105 Apr 29 2010oracleasmlib-2.0.4-1.el4.i386.rpm
-Rw-r -- 1 root 82542 Apr 29 2010oracleasm-support-2.1.3-1.el4.i386.rpm
[Root @ shiyueasmasm rpm for rhel4.0] # rpm-ivh *
Warning: oracleasmlib-2.0.4-1.el4.i386.rpm: V3 DSA signature: NOKEY, key ID b38a8516
Preparing... ######################################## ### [100%]
1: oracleasm-support ##################################### ###### [33%]
2: oracleasm-2.6.9-42.ELsm ####################################### #### [67%]
3: oracleasmlib ####################################### #### [100%]
4. Configure the ASM driver
[Root @ shiyueasm ~] #/Etc/init. d/oracleasm configure
Configuringthe Oracle ASM library driver.
This willconfigure the on-boot properties of the Oracle ASM library
Driver. The following questions will determinewhether the driver is
Loaded onboot and what permissions it will have. The current values
Will beshown in brackets ('[]'). Hitting <ENTER> without typing
Answerwill keep that current value. Ctrl-Cwill abort.
Defaultuser to own the driver interface []: oracle
Defaultgroup to own the driver interface []: oinstall
StartOracle ASM library driver on boot (y/n) [n]: y
Scan forOracle ASM disks on boot (y/n) [y]:
WritingOracle ASM library driver configuration: done
Initializingthe Oracle ASMLib driver: [OK]
Scanning the system for Oracle ASMLibdisks: [OK]
5. Create an ASM disk group
[Root @ shiyueasm ~] #/Etc/init. d/oracleasm createdisk VOL01 '/dev/sdc1'
Markingdisk "VOL02" as an ASM disk: [OK]
[Root @ shiyueasm ~] #/Etc/init. d/oracleasm createdisk VOL02 '/dev/sdd1'
Marking disk "VOL01" as anASM disk: [OK]
6. manually create a parameter file for the disk group
[Oracle @ shiyueasm ~] $ Cd $ ORACLE_HOME/dbs
[Oracle @ shiyueasmdbs] $ ll
Total 48
-Rw-r -- 1 oracle oinstall 934 May 26 10:52 db. SQL
-Rw ---- 1 oracle oinstall 1544 May 26 hc_shiyue.dat
-Rw-r ----- 1 oracle oinstall 12920 May 3 2001initdw. ora
-Rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora
-Rw-r -- 1 oracle oinstall 996 May 26 10:31 initshiyue. ora
-Rw ---- 1 oracle oinstall 24 May 26 :52 lkSHIYUE
-Rw-r ----- 1 oracle oinstall 1536 May 26 orapwshiyue
[Oracle @ shiyueasm dbs] $ viinit + ASM. ora
Asm_diskstring =''
Background_dump_dest =/u01/admin/shiyueasm/bdump
Core_dump_dest =/u01/admin/shiyueasm/cdump
User_dump_dest =/u01/admin/shiyueasm/udump
Instance_type = 'asm'
Large_pool_size = 20 m
Remote_login_passwordfile = 'shared'
7. Create related directories
[Oracle @ shiyueasm ~] $ Mkdir-p/u01/admin/shiyueasm/bdump
[Oracle @ shiyueasm ~] $ Mkdir-p/u01/admin/shiyueasm/cdump
[Oracle @ shiyueasm ~] $ Mkdir-p/u01/admin/shiyueasm/udump
8. Switch to the ASM instance
[Oracle @ shiyueasm ~] $ Export ORACLE_SID = + ASM