给磁盘分区
...
配置udev磁盘绑定
[root@centos6 etc]# cat scsi_id.config
options=-g
[root@centos6 etc]# scsi_id -u -g -d /dev/sdb
1ATA_VBOX_HARDDISK_VB9a9f82c1-ae6d0bdb
[root@centos6 etc]# scsi_id -u -g -d /dev/sdc
1ATA_VBOX_HARDDISK_VB49fee5e2-fb8e4829
[root@centos6 rules.d]# cat 89-oracle-asmdevices.rules
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB9a9f82c1-ae6d0bdb", NAME="asm1", OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB49fee5e2-fb8e4829", NAME="asm2", OWNER="oracle", GROUP="oinstall", MODE="0660"
[root@rh6 rules.d]# udevadm control --reload-rules
[root@rh6 rules.d]# start_udev
(redhat5的scsi_id命令是scsi_id -g -u -s /block/sda,如果scsi_id不行,可以用/lib/udev/xxx_id)
做安装rac的准备工作
...
安装grid,选择只安装grid软件,最后执行完root.sh脚本后,在安装root.sh的结果提示,执行一个perl脚本
用grid执行asmca,创建asm实例,磁盘组这块,路径选择/dev 然后磁盘里就会出现asm1和asm2,然后指定一个磁盘组名称。
编辑asm参数,将磁盘组名称添加到参数中。
启动asm,执行crsctl start resource css
通过crs_stat -t可以查看asm状态
链接asm的时候用grid用户 sqlplus / as sysasm
如果实在不行了,可以重新配置crs
执行GRID_HOME/crs/install/rootcrs.pl -deconfig -force
然后GRID_HOME/grid/root.sh
再根据提示执行perl脚本
最后执行crsctl start resource -all
创建参数文件
[grid@rh6 dbs]$ cat init+ASM.ora
*.asm_diskstring='/dev'
*.asm_diskgroups='ASMDG'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
参数文件如果指定了dump目录,启动时会提示让删除参数,并且它自动使用/u01/app/11.2.0/grid/log/diag/asm/+asm/+ASM/trace目录
Mon Dec 17 18:23:24 2012
WARNING: The background_dump_dest init.ora parameter has been deprecated.
WARNING: Please remove the background_dump_dest parameter from the init.ora file.
WARNING: The diagnostic_dest init.ora parameter now determines the location of the diagnostic data
WARNING: The new location for the background logs and traces is /u01/app/11.2.0/grid/log/diag/asm/+asm/+ASM/trace
Mon Dec 17 18:23:24 2012
WARNING: The user_dump_dest init.ora parameter has been deprecated.
WARNING: Please remove the user_dump_dest parameter from the init.ora file.
WARNING: The diagnostic_dest init.ora parameter now determines the location of the diagnostic data
WARNING: The new location for the user logs and traces is /u01/app/11.2.0/grid/log/diag/asm/+asm/+ASM/trace
由于是手工创建ASM实例,因此需要手工把ASM添加为crs资源
[grid@rh6 dbs]$ srvctl add asm -p /u01/app/11.2.0/grid/dbs/init+ASM.ora
启动资源,此时oracle自动将磁盘组ASMDG也加为资源了
[grid@rh6 dbs]$ srvctl start asm
[grid@rh6 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.ASMDG.dg ora....up.type ONLINE ONLINE rh6
ora.asm ora.asm.type ONLINE ONLINE rh6
ora.cssd ora.cssd.type ONLINE ONLINE rh6
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE rh6
ora.ons ora.ons.type OFFLINE OFFLINE
关闭服务需要先关闭ora.ASMDG.dg
[grid@rh6 dbs]$ crsctl stop resource ora.ASMDG.dg
CRS-2673: Attempting to stop 'ora.ASMDG.dg' on 'rh6'
CRS-2677: Stop of 'ora.ASMDG.dg' on 'rh6' succeeded
[grid@rh6 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.ASMDG.dg ora....up.type OFFLINE OFFLINE
ora.asm ora.asm.type ONLINE ONLINE rh6
ora.cssd ora.cssd.type ONLINE ONLINE rh6
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE rh6
ora.ons ora.ons.type OFFLINE OFFLINE
[grid@rh6 dbs]$ crsctl stop resource ora.asm
CRS-2673: Attempting to stop 'ora.asm' on 'rh6'
CRS-2677: Stop of 'ora.asm' on 'rh6' succeeded
[grid@rh6 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.ASMDG.dg ora....up.type OFFLINE OFFLINE
ora.asm ora.asm.type OFFLINE OFFLINE
ora.cssd ora.cssd.type ONLINE ONLINE rh6
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE rh6
ora.ons ora.ons.type OFFLINE OFFLINE