1. 软件准备 2
1.1 ASM driver-Asmlib2
2. 安装驱动-Asmlib2
2.1 安装ASM Driver2
2.2 配置驱动 3
2.3 创建ASM磁盘4
3. 安装ASM软件-Grid Infrastructure12
3.1 Pre install 12
3.2 Installing the Software Binaries 15
3.3 Post install: 28
4. 创建ASM实例-ASM Instance29
4.1 手动创建ASM实例29
4.2 用asmca创建ASM实例31
5. 启动和关闭ASM实例32
5.1 启动ASM实例32
5.2 关闭ASM实例34
6. 添加新磁盘 34
7. 添加/删除新磁盘组36
7.1 添加新磁盘组 36
7.2 删除磁盘组 38
8. 向已有的磁盘组添加/删除新磁盘39
8.1 向已有的磁盘组添加新磁盘 39
8.2 从已有的磁盘组删除磁盘 41
l oracleasm-support-version.arch.rpm
l oracleasm-kernel-version.arch.rpm
l oracleasmlib-version.arch.rpm
Enter the following command to determine the kernel version and architecture of the system:
# uname -rm
Download the required ASMLIB packages from the Oracle Technology Network (OTN) Web site:
http://www.oracle.com/us/technologies/linux/downloading-asmlib-176895.html
Note:
You must install oracleasm-support package version 2.0.1 or later to use ASMLIB on Red Hat Enterprise Linux Advanced Server, or SUSE Linux Enterprise Server.
You must install the following packages, where version is the version of the ASMLIB driver, arch is the system architecture, and kernel is the version of the kernel that you are using.
http://www.oracle.com/technetwork/products/clusterware/downloads/index.html
Switch user to the root user:
$ su -
Enter a command similar to the following to install the packages:
# rpm -Uvh oracleasm-support-version.arch.rpm \
oracleasm-kernel-version.arch.rpm \
oracleasmlib-version.arch.rpm
For example, if you are using the Red Hat Enterprise Linux AS 4 enterprise kernel on an AMD64 system, then enter a command similar to the following:
# rpm -Uvh oracleasm-support-2.0.1.x86_64.rpm \
oracleasmlib-2.0.1.x86_64.rpm \
oracleasm-2.6.9-11.EL-2.0.1.x86_64.rpm
[root@rac1 rpm]# ls | grep asm
oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
oracleasm-support-2.1.7-1.el4.i386.rpm
rpm -Uvh oracleasm-support-2.1.7-1.el4.i386.rpm \
oracleasmlib-2.0.4-1.el4.i386.rpm \
oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
[root@rac1 rpm]# rpm -qa |grep asm
[root@rac1 rpm]# rpm -Uvh oracleasm-support-2.1.7-1.el4.i386.rpm \
> oracleasmlib-2.0.4-1.el4.i386.rpm \
> oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
warning: oracleasm-support-2.1.7-1.el4.i386.rpm: V3 DSA signature: NOKEY, key ID b38a8516
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-89.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
[root@rac1 rpm]#
Enter the following command to run the oracleasm initialization script with the configure option:
# /usr/sbin/oracleasm configure -i
or
#/etc/init.d/oracleasm configure
[root@rac1 rpm]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface [grid]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac1 rpm]#
If you intend to use IDE, SCSI, or RAID devices in the Oracle ASM disk group, then follow these steps:
If necessary, install or configure the shared disk devices that you intend to use for the disk group and restart the system.
To identify the device name for the disks to use, enter the following command:
Depending on the type of disk, the device name can vary:
Disk Type |
Device Name Format |
Description |
IDE disk |
/dev/hdxn |
In this example, x is a letter that identifies the IDE disk and n is the partition number. For example, /dev/hda is the first disk on the first IDE bus. |
SCSI disk |
/dev/sdxn |
In this example, x is a letter that identifies the SCSI disk and n is the partition number. For example, /dev/sda is the first disk on the first SCSI bus. |
To include devices in a disk group, you can specify either whole-drive device names or partition device names.
Note:
Oracle recommends that you create a single whole-disk partition on each disk.
Use either fdisk or parted to create a single whole-disk partition on the disk devices.
Enter a command similar to the following to mark a disk as an Oracle ASM disk:
# /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
In this example, DISK1 is the name you assign to the disk.
Note:
The disk names that you specify can contain uppercase letters, numbers, and the underscore character. They must start with an uppercase letter.
If you are using a multi-pathing disk driver with Oracle ASM, then make sure that you specify the correct logical device name for the disk.
To make the disk available on the other nodes in the cluster, enter the following command as root on each node:
# /usr/sbin/oracleasm scandisks
This command identifies shared disks attached to the node that are marked as Oracle ASM disks.
[root@rac1 rpm]# fdisk -l
Disk /dev/sda: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12662 101707483+ 83 Linux
/dev/sda2 12663 13054 3148740 82 Linux swap
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
[root@rac1 rpm]# fdisk /dev/sdb
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.
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-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 rpm]# 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.
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-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 rpm]# fdisk /dev/sdd
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.
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-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 rpm]# fdisk /dev/sde
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.
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-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Create asm disk
/etc/init.d/oracleasm createdisk ASMDISK1 /dev/sdb1
/etc/init.d/oracleasm createdisk ASMDISK2 /dev/sdc1
/etc/init.d/oracleasm createdisk ASMDISK3 /dev/sdd1
/etc/init.d/oracleasm createdisk ASMDISK4 /dev/sde1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
[root@rac1 rpm]# /etc/init.d/oracleasm createdisk ASMDISK1 /dev/sdb1
Marking disk "ASMDISK1" as an ASM disk: [ OK ]
[root@rac1 rpm]# /etc/init.d/oracleasm createdisk ASMDISK2 /dev/sdc1
Marking disk "ASMDISK2" as an ASM disk: [ OK ]
[root@rac1 rpm]# /etc/init.d/oracleasm createdisk ASMDISK3 /dev/sdd1
Marking disk "ASMDISK3" as an ASM disk: [ OK ]
[root@rac1 rpm]# /etc/init.d/oracleasm createdisk ASMDISK4 /dev/sde1
Marking disk "ASMDISK4" as an ASM disk: [ OK ]
[root@rac1 rpm]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac1 rpm]# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
ASMDISK3
ASMDISK4
查询ASM磁盘和物理磁盘的对应关系:
/etc/init.d/oracleasm listdisks
/etc/init.d/oracleasm querydisk -d ASMDISK1
/etc/init.d/oracleasm querydisk -d ASMDISK2
/etc/init.d/oracleasm querydisk -d ASMDISK3
/etc/init.d/oracleasm querydisk -d ASMDISK4
[root@rac1 rpm]# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
ASMDISK3
ASMDISK4
[root@rac1 rpm]# /etc/init.d/oracleasm querydisk -d ASMDISK1
Disk "ASMDISK1" is a valid ASM disk on device /dev/sdb1[8,17]
[root@rac1 rpm]# /etc/init.d/oracleasm querydisk -d ASMDISK2
Disk "ASMDISK2" is a valid ASM disk on device /dev/sdc1[8,33]
[root@rac1 rpm]# /etc/init.d/oracleasm querydisk -d ASMDISK3
Disk "ASMDISK3" is a valid ASM disk on device /dev/sdd1[8,49]
[root@rac1 rpm]# /etc/init.d/oracleasm querydisk -d ASMDISK4
Disk "ASMDISK4" is a valid ASM disk on device /dev/sde1[8,65]
groupadd -g 501 oinstall
groupadd -g 502 dba
useradd -u 1100 -g oinstall -G dba grid
useradd -u 1101 -g oinstall -G dba oracle
mkdir -p /u01/grid_base
mkdir -p /u01/grid_home
chmod -R 775 /u01/
chown -R grid:oinstall /u01/grid_base
chown -R grid:oinstall /u01/grid_home
passwd grid
[root@rac1 rpm]# useradd -u 1100 -g oinstall -G dba grid
[root@rac1 rpm]# mkdir -p /u01/grid_base
[root@rac1 rpm]# mkdir -p /u01/grid_home
[root@rac1 rpm]# chmod -R 775 /u01/
[root@rac1 rpm]# chown -R grid:oinstall /u01/grid_base
[root@rac1 rpm]# chown -R grid:oinstall /u01/grid_home
[root@rac1 rpm]# passwd grid
Changing password for user grid.
New UNIX password:
BAD PASSWORD: it is too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Edit .bash_profile add the follow parameter to it:
export ORACLE_BASE=/u01/grid_base
export ORACLE_HOME=/u01/grid_home
export ORACLE_SID=+ASM
export PATH=$PATH:$ORACLE_HOME/bin
[root@rac1 rpm]# su - grid
[grid@rac1 ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export ORACLE_BASE=/u01/grid_base
export ORACLE_HOME=/u01/grid_home
export ORACLE_SID=+ASM
export PATH=$PATH:$ORACLE_HOME/bin
~
~
~
~
~
".bash_profile" 18L, 318C written
[grid@rac1 ~]$
To perform a software-only installation:
Run the runInstaller command from the relevant directory on the Oracle Database 11g release 2 (11.2) installation media or download directory. For example:
$ cd /home/grid/oracle_sw/Disk1
$ ./runInstaller
Complete a software-only installation of Oracle Grid Infrastructure on the first node.
When the software has been installed, run the orainstRoot.sh script when prompted.
The root.sh script output provides information about how to proceed, depending on the configuration you plan to complete in this installation. Make note of this information.
上传安装包linux_11gR2_11.2.0.1.0_grid.zip
[root@rac1 grid_installer]# pwd
/u01/grid_installer
[root@rac1 grid_installer]# ll
total 958788
-rw-r--r-- 1 root root 980831749 Aug 21 2011 linux_11gR2_11.2.0.1.0_grid.zip
[root@rac1 grid_installer]# chown -R grid:oinstall linux_11gR2_11.2.0.1.0_grid.zip
[root@rac1 grid_installer]# ll
total 958788
-rw-r--r-- 1 grid oinstall 980831749 Aug 21 2011 linux_11gR2_11.2.0.1.0_grid.zip
解压linux_11gR2_11.2.0.1.0_grid.zip
unzip linux_11gR2_11.2.0.1.0_grid.zip
开始安装
以grid用户运行runInstall
./runInstaller
[root@rac1 grid]# su - grid
[grid@rac1 ~]$ cd /u01/grid_installer/grid/
[grid@rac1 grid]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB. Actual 88470 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3074 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-08-03_04-55-20PM. Please wait ...[grid@rac1 grid]$
here, where click Next, we will wait for about 1 minute.
Create /u01/oraInventory manually and then click OK:
[root@rac1 ~]# mkdir -p /u01/oraInventory
[root@rac1 ~]# chmod -R 775 /u01/oraInventory/
[root@rac1 ~]# chown -R grid:oinstall /u01/oraInventory/
[root@rac1 ~]# /u01/oraInventory/orainstRoot.sh
Changing permissions of /u01/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/oraInventory to oinstall.
The execution of the script is complete.
[root@rac1 ~]#
[root@rac1 ~]# /u01/grid_home/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/grid_home
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/grid_home/perl/bin/perl -I/u01/grid_home/perl/lib -I/u01/grid_home/crs/install /u01/grid_home/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file - /u01/grid_home/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
/u01/grid_home/perl/bin/perl -I/u01/grid_home/perl/lib -I/u01/grid_home/crs/install /u01/grid_home/crs/install/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument -cfs.
[root@rac1 ~]#
运行完root.sh后,一定要仔细看它的提示,可能还要执行别的脚本,此处提示执行:
/u01/grid_home/perl/bin/perl -I/u01/grid_home/perl/lib -I/u01/grid_home/crs/install /u01/grid_home/crs/install/roothas.pl
[root@rac1 ~]# /u01/grid_home/perl/bin/perl -I/u01/grid_home/perl/lib -I/u01/grid_home/crs/install /u01/grid_home/crs/install/roothas.pl
2012-08-03 17:22:56: Checking for super user privileges
2012-08-03 17:22:56: User has super user privileges
2012-08-03 17:22:56: Parsing the host name
Using configuration parameter file: /u01/grid_home/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node rac1 successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
ADVM/ACFS is not supported on centos-release-4-8
rac1 2012/08/03 17:23:22 /u01/grid_home/cdata/rac1/backup_20120803_172322.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@rac1 ~]#
crsctl enable has
crsctl start has
crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
crsctl start resource ora.cssd
[root@rac1 ~]# su - grid
[grid@rac1 ~]$ crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.
[grid@rac1 ~]$ crsctl start has
CRS-4640: Oracle High Availability Services is already active
CRS-4000: Command Start failed, or completed with errors.
[grid@rac1 ~]$ crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
[grid@rac1 ~]$ crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
[grid@rac1 ~]$ crsctl start resource ora.cssd
CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
create init+ASM.ora in $ORACLE_HOME/dbs/
The content as follow:
INSTANCE_TYPE = ASM
[grid@rac1 ~]$ vi $ORACLE_HOME/dbs/init+ASM.ora
INSTANCE_TYPE = ASM
创建密码文件:
[grid@rac1 grid]$ orapwd file='/u01/grid_home/dbs/orapw' password=oracle
[grid@rac1 grid]$
srvctl add asm -p $ORACLE_HOME/dbs/init+ASM.ora
[grid@rac1 ~]$ srvctl add asm -p $ORACLE_HOME/dbs/init+ASM.ora
[grid@rac1 ~]$
validate the ASM instance can start:
sqlplus "/as sysasm"
startup
[grid@rac1 ~]$ sqlplus "/as sysasm"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 3 17:34:06 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1336036 bytes
Variable Size 258063644 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL>
[grid@rac1 dbs]$ sqlplus "/as sysasm"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 3 17:44:18 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option
SQL> create spfile='/u01/grid_home/dbs/spfile+ASM.ora' from pfile='/u01/grid_home/dbs/init+ASM.ora';
File created.
[grid@rac1 dbs]$ asmcmd
ASMCMD> spset /u01/grid_home/dbs/spfile+ASM.ora
ASMCMD> spget
/u01/grid_home/dbs/spfile+ASM.ora
ASMCMD>
asmca
sqlplus "/as sysasm"
startup
[grid@rac1 dbs]$ ps -ef |grep asm
grid 2457 1 0 17:47 ? 00:00:00 asm_pmon_+ASM
grid 2459 1 0 17:47 ? 00:00:00 asm_vktm_+ASM
grid 2463 1 0 17:47 ? 00:00:00 asm_gen0_+ASM
grid 2465 1 0 17:47 ? 00:00:00 asm_diag_+ASM
grid 2467 1 0 17:47 ? 00:00:00 asm_psp0_+ASM
grid 2469 1 0 17:47 ? 00:00:00 asm_dia0_+ASM
grid 2471 1 0 17:47 ? 00:00:00 asm_mman_+ASM
grid 2473 1 0 17:47 ? 00:00:00 asm_dbw0_+ASM
grid 2475 1 0 17:47 ? 00:00:00 asm_lgwr_+ASM
grid 2477 1 0 17:47 ? 00:00:00 asm_ckpt_+ASM
grid 2479 1 0 17:47 ? 00:00:00 asm_smon_+ASM
grid 2481 1 0 17:47 ? 00:00:00 asm_rbal_+ASM
grid 2483 1 0 17:47 ? 00:00:00 asm_gmon_+ASM
grid 2485 1 0 17:47 ? 00:00:00 asm_mmon_+ASM
grid 2487 1 0 17:47 ? 00:00:00 asm_mmnl_+ASM
[grid@rac1 dbs]$
sqlplus "/as sysasm"
shutdown
[grid@rac1 dbs]$ ps -ef | grep asm
grid 2602 1927 0 17:59 pts/1 00:00:00 grep asm
[grid@rac1 dbs]$
To add a new hard disk conference 2.3.
[grid@rac1 dbs]$ cd /dev/oracleasm/disks/
[grid@rac1 disks]$ ll
total 0
brw-rw---- 1 grid dba 8, 17 Aug 3 16:22 ASMDISK1
brw-rw---- 1 grid dba 8, 33 Aug 3 16:22 ASMDISK2
brw-rw---- 1 grid dba 8, 49 Aug 3 16:22 ASMDISK3
brw-rw---- 1 grid dba 8, 65 Aug 3 16:22 ASMDISK4
[grid@rac1 disks]$ sqlplus "/as sysasm"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 3 18:54:02 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option
SQL> col path format a30
SQL> col name format a10
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
no rows selected
SQL> show parameter disk
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string
asm_diskstring string
SQL> ALTER SYSTEM SET asm_diskstring='/dev/oracleasm/disks';
System altered.
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
0 /dev/oracleasm/disks/ASMDISK4 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK1 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK2 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK3 0 NORMAL
SQL>
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
no rows selected
SQL> CREATE DISKGROUP DATA1 EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/ASMDISK1' NAME ASMDISK1,'/dev/oracleasm/disks/ASMDISK2' NAME ASMDISK2;
Diskgroup created.
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB STATE
------------ ------------------------------ ---------- -----------
1 DATA1 2038 MOUNTED
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
0 /dev/oracleasm/disks/ASMDISK4 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK3 0 NORMAL
1 /dev/oracleasm/disks/ASMDISK2 ASMDISK2 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK1 ASMDISK1 1019 NORMAL
SQL>
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB STATE
------------ ---------- ---------- -----------
1 DATA1 4076 MOUNTED
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
1 /dev/oracleasm/disks/ASMDISK4 ASMDISK4 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK3 ASMDISK3 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK2 ASMDISK2 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK1 ASMDISK1 1019 NORMAL
SQL> DROP DISKGROUP data1;
Diskgroup dropped.
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
no rows selected
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
0 /dev/oracleasm/disks/ASMDISK1 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK4 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK3 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK2 0 NORMAL
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB STATE
------------ ---------- ---------- -----------
1 DATA1 2038 MOUNTED
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
0 /dev/oracleasm/disks/ASMDISK4 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK3 0 NORMAL
1 /dev/oracleasm/disks/ASMDISK2 ASMDISK2 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK1 ASMDISK1 1019 NORMAL
SQL> ALTER DISKGROUP data1 ADD DISK '/dev/oracleasm/disks/ASMDISK3' NAME ASMDISK3,'/dev/oracleasm/disks/ASMDISK4' NAME ASMDISK4;
Diskgroup altered.
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB STATE
------------ ---------- ---------- -----------
1 DATA1 4076 MOUNTED
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
1 /dev/oracleasm/disks/ASMDISK4 ASMDISK4 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK3 ASMDISK3 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK2 ASMDISK2 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK1 ASMDISK1 1019 NORMAL
SQL> ALTER DISKGROUP data1 DROP DISK asmdisk3,asmdisk4;
Diskgroup altered.
SQL> SELECT group_number,name,total_mb,state FROM v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB STATE
------------ ---------- ---------- -----------
1 DATA1 2038 MOUNTED
SQL> SELECT group_number,path,name,total_mb,state FROM v$asm_disk;
GROUP_NUMBER PATH NAME TOTAL_MB STATE
------------ ------------------------------ ---------- ---------- --------
0 /dev/oracleasm/disks/ASMDISK4 0 NORMAL
0 /dev/oracleasm/disks/ASMDISK3 0 NORMAL
1 /dev/oracleasm/disks/ASMDISK2 ASMDISK2 1019 NORMAL
1 /dev/oracleasm/disks/ASMDISK1 ASMDISK1 1019 NORMAL